flat assembler
Message board for the users of flat assembler.

Index > OS Construction > How to find existence of memory?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden 14 Mar 2007, 09:30
quote: "my experience is that you can write to non-existent memory, but you won't retrieve what you wrote".

false... if you use back to back intructions ie:
mov eax, [loc]
mov [loc], eax

It is possible to retrieve voltage still left on the data-bus even if no memory was installed at the address of [loc]

just a footnote for people codeing memory testing alogs.
Post 14 Mar 2007, 09:30
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 314
Mac2004 21 Mar 2007, 19:19
THEWizardGenius wrote:
Simple: If your computer starts up, you have at least 1 byte of memory installed. If no memory exists, it won't startup properly. Very Happy


What else can I add to this? Very Happy


Last edited by Mac2004 on 22 Mar 2007, 18:13; edited 1 time in total
Post 21 Mar 2007, 19:19
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 21 Mar 2007, 22:48
THEWizardGenius wrote:
Simple: If your computer starts up, you have at least 1 byte of memory installed. If no memory exists, it won't startup properly. Very Happy


Are you sure about that? AFAIK it's possible to do some tricks and run ROM code and keep everything in the CPU cache...

_________________
Image - carpe noctem
Post 21 Mar 2007, 22:48
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 21 Mar 2007, 23:39
THEWizardGenius wrote:
Simple: If your computer starts up, you have at least 1 byte of memory installed. If no memory exists, it won't startup properly. Very Happy


Did you know that JMP is in fact a conditional jump? It means "Jump if Memory Present". Wink
Post 21 Mar 2007, 23:39
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 22 Mar 2007, 01:48
or "Jump if Machine is still Processing"
Post 22 Mar 2007, 01:48
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden 26 Mar 2007, 00:55
I've recently just tried theese functions on a Windows Vista ready motherboard
running a 64-bit CPU at my friends workshop and it seems apparent that NONE of theese old BIOS routines are supported anymore.

I have attatched a zip file wich consists of some log files that were generated,
and a program that gives theese functions a workout.

I've included the source code, it's not in FASM, but will be easy to understand.
to most people since it's written in euphoria.

there are three logfiles

#1 My old PIII 450 Running Windows 98
#2 My old PIII 450 Running WinME boot disk with F5 pushed at startup
#3 New Vista ready 64-bit machine running Windows Vista


Description: Public Domain
Download
Filename: E820.zip
Filesize: 175.69 KB
Downloaded: 298 Time(s)


_________________
New User.. Hayden McKay.
Post 26 Mar 2007, 00:55
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 26 Mar 2007, 01:12
Code:
procedure INT15E820()

    RM[REGS_EAX] = #0000E820
    RM[REGS_ECX] = #00000014
    RM[REGS_EDX] = #534D4150   -- phoenix spells "SMAP" P-A-M-S ( arseholes )

    RM = int86(#15, RM)
                
end procedure     


Try adding "RM[REGS_EBX] = #00000000" before int86 call to see if the new Vista ready computers works with it.

http://www.ctyme.com/intr/rb-1741.htm wrote:
The BIOS is permitted to return a nonzero continuation value in EBX and indicate that the end of the list has already been reached by returning with CF set on the next iteration
So initialize EBX to zero to ensure that you are really getting real error and not end of list due to the random value at EBX.
Post 26 Mar 2007, 01:12
View user's profile Send private message Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden 26 Mar 2007, 02:10
At the top level of source code all registers are initialized to zero.
Hence there is no need for RM[REGS_EBX] = 0

the line reads: RM = repeat(0, 15) wich creates the dpmi structure initialezed to all zeros

Before the loop there is a INT15E820 call and a test for CF to see if it's supported.

In the phoenix manual zero is returned in ebx if reached the end although I should probably check for CF flag like it say's in ralf brown's interrupt list. thanks for pointing that out. Wink

If Bios has APIC 3.0 then there is an extra bit to check for to indicate that the entire result for that continuation to be discarded wich is not mentioned in the phoenix manual or the interrupt list. On theese APIC 3.0 systems the data structure is 24 bytes not 20 bytes.

nb. My algo does'nt test for this APIC 3.0 virant of E820.

There has to be an easier way to get the system map?
Post 26 Mar 2007, 02:10
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 26 Mar 2007, 10:55
Hayden: E820 etc. aren't emulated under NT, so try booting the new machine from a floppy or usb drive...
Post 26 Mar 2007, 10:55
View user's profile Send private message Visit poster's website Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden 28 Mar 2007, 02:39
Went to workshop today and booted another windows vista 64-bit ready machine from windows me boot disk ( with F5 pushed at startup ) and this machine also did not have support for INT 15 - E820, E801, E881 & 00C7.

Maybee we now need to test for vendor specific BIOS OEM extentions.
ie: pheonix INT 15 - AH = 8A or maybee theese new boards have a striclty defined system memory map that vendors must adhear to. So all that windows vista has to do is a $PCI/$PNP bus scan? Who knows?

it seems that alot of old bios functions are being left aside theese days as intel is pushing towards the firmware replacemant for bios.

_________________
New User.. Hayden McKay.
Post 28 Mar 2007, 02:39
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 28 Mar 2007, 15:14
Just to be completely sure try my attachment. You have two options, use RawWrite with boot.bin or just execute boot.com which will write the first floppy disk sector with the boot program. Note that both methods makes the floppy disk useless until next format so make sure you don't have any important data on floppy disk before proceeding. Later boot the computer from the floppy disk.


Description:
Download
Filename: Int15-E820 detector.zip
Filesize: 1.83 KB
Downloaded: 263 Time(s)

Post 28 Mar 2007, 15:14
View user's profile Send private message Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden 30 Mar 2007, 00:40
GIGABYTE 775LGA-i945 1333-FSB 'Windows Vista Ready' mainboard running a i3.4mHz duo w/2GBs DDR.

Your program output:

CF is set
EAX contains 'SMAP'
Remove floppy disk and press any key

Tried it on some older computers first but the all produced

CF is clear
EAX contains 'SMAP'
Remove floppy disk and press any key
Post 30 Mar 2007, 00:40
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 30 Mar 2007, 00:57
Quote:

CF is set
EAX contains 'SMAP'

Interesting, so GIGABYTE reports some kind of "partially supported"?

This is what Ralf Brown says
Quote:
Return:CF clear if successful
EAX = 534D4150h ('SMAP')
ES:DI buffer filled
EBX = next offset from which to copy or 00000000h if all done
ECX = actual length returned in bytes
CF set on error
AH = error code (86h) (see #00496 at INT 15/AH=80h)


Try to use E820 on those motherboards as if were supported and never rely on CF to see if you get something.
Post 30 Mar 2007, 00:57
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 30 Mar 2007, 01:53
error code 41h? Very Happy
Post 30 Mar 2007, 01:53
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 30 Mar 2007, 02:27
Yes, and with the extended error "SMP" telling that you can't use SMP ready CPUs Wink
Post 30 Mar 2007, 02:27
View user's profile Send private message Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden 30 Mar 2007, 10:33
hmm... yea, wear is the error code? maybee gigabyte bios bug? I check this out again tomorrow. I would like to try on some more modern machines but have no more customer computers and i can't just crack open a motherboard and assemble a computer until someone orders somethin nice Smile ( the good ones have now left the shop ). interesting...
Post 30 Mar 2007, 10:33
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 30 Mar 2007, 14:28
Have you tried with ECX = 24? Perhaps the BIOS reports error because it wants to give you more info. Anyway just change the ending condition, scan the map until EBX = 0 instead of checking the very unreliable CF.

BTW, can you try what happens if you install a WindowsXP on those computers? I experimented with E820 some time ago ( http://board.flatassembler.net/topic.php?p=42168#42168 ) and I found that WindowsXP uses E820.
Post 30 Mar 2007, 14:28
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 30 Mar 2007, 14:52
I tested modifying the code on that post to always return CF set. Windows Skipped my map and tryed another method to detect the whole memory. Now we know something, returning CF always set is not standard or it is a very new standard that even a WinXP SP2 can't work with it (and contradicts the old standard aswell...).

[edit]Tryed also simulating E801 as not supported and worked, now reports 64 MB instead of full size. So WinXP first uses E820 and then falls to E801.
Post 30 Mar 2007, 14:52
View user's profile Send private message Reply with quote
Hayden



Joined: 06 Oct 2005
Posts: 132
Hayden 31 Mar 2007, 20:47
The GIGABYTE 'Windows Vista Ready' board has Windows XP Media Ed. installed on it. I Still have'nt had a chance to play with assembler and this machine yet, but I'll do it tomorrow when I go to shop.

[OT] 80% of customers are returng Windows Vista and opting for a Windows XP replacment. So generaly we are not installing Windows Vista
unless someone really wants it.
Post 31 Mar 2007, 20:47
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.