Page 1 of 1

Detecting Memory

Posted: Sat Jan 31, 2004 2:47 am
by Therx
I'm trying to implement the Intel 36bit extensions but how do I detect up to 64gb. The only way I can think of (unless a capable BIOS function exists) is to setup up paging and map a page to a higher and higher address. But this will take all day to get up to 64GB. Unless I can assume that memory sizes will be on of:-
4mb
8mb
16mb
32mb
64mb
...
512mb
1gb
2gb
4gb

But I know that my old 486 has 12mb (4 + 8) and it would be possible to have 1.5 GB etc..

Pete

Re:Detecting Memory

Posted: Sat Jan 31, 2004 5:06 am
by Perica
..

Re:Detecting Memory

Posted: Sat Jan 31, 2004 7:15 am
by Curufir
486 is unlikely to have e820.

What will definitely be there is int 15h, 88h (Plenty of info about int 15 on the web) which will give the size of extended memory. Alternatively read the CMOS data directly.

Re:Detecting Memory

Posted: Sat Jan 31, 2004 7:53 am
by Perica
..

Re:Detecting Memory

Posted: Sat Jan 31, 2004 7:55 am
by Therx
No my OS isn't aimed at 486's I was just using that as an example of why I might not be able to rely on the 2^n memory sizes

Pete

Re:Detecting Memory

Posted: Sat Jan 31, 2004 8:50 am
by Therx
Will the information passed by GRUB be accurate. I know that the memory size variable formultiboot is only 32bit but what about the memory map. Could that go up to 36bit. Does anyone else use PAE/PSE in their OS. I'm starting to think that its not worth it because I'll probally have to write my own bootsector and also I don't think their are any motherboards with support it.

Pete

Re:Detecting Memory

Posted: Sat Jan 31, 2004 11:18 pm
by Perica
..

Re:Detecting Memory

Posted: Mon Feb 02, 2004 9:55 am
by Candy
Pete wrote: Does anyone else use PAE/PSE in their OS. I'm starting to think that its not worth it because I'll probally have to write my own bootsector and also I don't think their are any motherboards with support it.
Well, all processors from PPro+ support 36-bits and up, and from A64 they support 40-bits or more (even in 32-bit mode). Using it only allows for using the NX bit (and only on Itaniums and AMD64s) and that only in special modes. In other words, if you don't aim for the top, it's not worth it. As an aside, Bochs does NOT support PAE as it should. It crashes when setting the registers with the correct values, even when compiling WITH support for AMD64 (which requires PAE). However, I tested my code on multiple physical computers (all AMDs), where the PAE code worked flawlessly. I therefore support it but not on bochs.

Look at my 0.0.2 code for some code that works, it's been prepared to support 64-bit PAE-ish translation so you can probably skip 1/4 of each function.