Ram size calculation
Ram size calculation
I have enabled A20 gate, but when i iterate through RAM, I dont get more then the conventional memory size in KB, can any one tell what is the reason. ALso I Would like to know how to remap the int 13H and int 1AH in protected mode. Please mail me to [email protected]
RE:Ram size calculation
you dont get more than the conventional ram size because your still in real mode (i believe, someone correct me).
you cant use those ints, if i understand you the way i think i am then they're real mode interrupts. you cant use real mode ints in pmode, you must define them yourself.
If you using your own bootloader, the only option is probably to use the real mode ints in real mode, grab the mmap, and save it, switch to pmode and then handle the mmap.
Alternatively you could cheat like me and use a multiboot compliant bootloader such as Grub. Grub will land your kernel in pmode and give you a mmap if you want it.
Dangamoose.
you cant use those ints, if i understand you the way i think i am then they're real mode interrupts. you cant use real mode ints in pmode, you must define them yourself.
If you using your own bootloader, the only option is probably to use the real mode ints in real mode, grab the mmap, and save it, switch to pmode and then handle the mmap.
Alternatively you could cheat like me and use a multiboot compliant bootloader such as Grub. Grub will land your kernel in pmode and give you a mmap if you want it.
Dangamoose.
RE:Ram size calculation
Iterating through RAM, if that means writing to memory and then reading it back as a test, doesn't always work very well because sometimes there are holes in memory that you have to work around.
See http://www.uruk.org/orig-grub/mem64mb.html for BIOS routines you can use to test for memory beyond the 1MB limit.
ALSO: The only way I know to "remap" ints 13h and 1Ah in protected mode is to put descriptors in your IDT at positions 13h and 1Ah, descriptors that point to special code to switch the computer to real, VM86, or unreal mode and THEN call the real BIOS service via the real-mode IVT (assuming you preserved this). BIOS services for the most part WILL NOT RUN in protected mode.
See http://www.uruk.org/orig-grub/mem64mb.html for BIOS routines you can use to test for memory beyond the 1MB limit.
ALSO: The only way I know to "remap" ints 13h and 1Ah in protected mode is to put descriptors in your IDT at positions 13h and 1Ah, descriptors that point to special code to switch the computer to real, VM86, or unreal mode and THEN call the real BIOS service via the real-mode IVT (assuming you preserved this). BIOS services for the most part WILL NOT RUN in protected mode.
RE:Ram size calculation
I appritiate your reply, I confirmed that I was running in protected mode. as I was getting the Timer/KBD interrupt that I installed in my IDT. Also I solved my problem of Memory Memory Count, I was using wronge descriptor which was pointing to my realmode _DS:00000000, I should have been pointing to 0000:00000000.
RE:Ram size calculation
Thanks a lot, I will investiage more on VM86. As far as preserving IVT is concerned, I am not touching first 1MB+1KB physical memory, so I think it will be preserved.