Hi,
I've got a 80486 like this too. I use the following BIOS functions:
int 0x15, eax = 0xE820
int 0x15, ax = 0xE881
int 0x15, ax = 0xE801
int 0x15, ah = 0xC7
int 0x15, ah = 0x88
None of them are supported.
zloba wrote:I only get the *size* of the extended memory. (from CMOS or multiboot)
If GRUB failed to make a map, I doubt I can do better.
- Should I just assume that all of that is usable RAM?
I'm not sure where GRUB gets it's information.
For the values from CMOS, I wouldn't assume it's all usable RAM. The problem here is that some ISA devices map their own memory into the physical address space (for e.g. a video card's linear frame buffer). The ISA bus is limited to 16 MB and nothing on it can access memory above 16 MB, so the ISA device will use the area from 15 MB to 16 MB, overwriting the RAM that was there.
Despite this, you can probably get away with using this RAM, because most ISA devices don't map their own memory into the physical address space, but it will depend on which ISA devices are plugged in.
For my OS, the memory detection code that uses the CMOS and manual probing ignores the area from 15 MB to 16 MB. I figure it's better to be safe than sorry, and most computers that don't support any of the BIOS functions are probably too old to have more than 8 MB anyway.
zloba wrote:- Should I probe it?
If the code you use to probe takes into account problems like bus float and caching, and if all of the BIOS functions aren't supported, then probing can work reliably. When I wrote my memory detection routines I worked from oldest to newest (starting from probing and working my way up to int 0x15, eax = 0xE820). After each one I tested it, and can say that my memory probing code works on all 6 of the computers I tested it on (ranging from 80486 to Pentium 4).
My manual probing code can be found at:
http://bcos.hopto.org/latest/sys/i386/k ... probe.html
zloba wrote:- Can this happen with a Pentium? (which has APIC, at least)
I haven't found a Pentium that doesn't support at least one of the BIOS functions (but that doesn't mean it's impossible).
zloba wrote:I'd like to keep supporting 386/486, if possible.
IMHO the problem with 80386 is that half of them used "expanded memory", which uses a bank switching thing (where 64 KB chunks of RAM are swapped in and out of memory below 1 MB). The other problem is they don't support the INVLPG instruction or native FPU exceptions (the NE bit of CR0). Now, it's difficult to find someone who kept an 80486 (the number of people with an 80386 would be very small). You may want to compare the difficulty in supporting them properly, and how much you'll gain if you do....
zloba wrote:2. (out of curiosity)
Why did I mention 64mb of memory? Because the CMOS can only hold values up to 99mb.
Where does that "99" number come from? I see that CMOS has 2 bytes for "extended memory", that's 64M=64K*1K...
You're right - I'm not sure where the "99" came from either (perhaps someone thought it was BCD?) - consider it a typo.
Cheers,
Brendan