Hello,
For physical memory management I'd like to know if mostly physical pages are reserved to prevent it for data erasing.
I know the pages of my kernel and I can protect it to allocate this
pages.
Regards
Physical memory management.
Hello cacao,
If you want to know which memory areas mustn't be overwritten you should ask the BIOS for a memory map. In case that you're using GRUB this can also be done by interpreting the multiboot structures.
I'm not quite sure if I got you correctly. Just ask again if there are still question..
regards,
gaf
If you want to know which memory areas mustn't be overwritten you should ask the BIOS for a memory map. In case that you're using GRUB this can also be done by interpreting the multiboot structures.
I'm not quite sure if I got you correctly. Just ask again if there are still question..
regards,
gaf
I read the GRUB specification and I saw :
That's it !!! But what is the functionnality of reserved page ? (BIOS, Hardware mapping, ...)
Code: Select all
[...]
`type' is the variety of address range represented, where a value of 1 indicates available ram, and all other values currently indicated a reserved area.
As far as I know GRUB tries to use Int15/0xE820 to get the memory map. For this function the BIOS specifies a few more types to describe in more detail why an area is reserved. To avoid problems your memory manager should only use blocks defined as type1 for allocation:
gaf
cheers,1 - memory, available to OS
2 - reserved, not available (e.g. system ROM, memory-mapped device)
3 - ACPI Reclaim Memory (usable by OS after reading ACPI tables)
4 - ACPI NVS Memory (OS is required to save this memory between NVS sessions)
other: not defined yet -- treat as reserved
gaf
I think I can give you the exact BIOS memory map:
If this is the answer to the question....
Code: Select all
0x0000:0x0000 -> 0x0000:0x03FF = IVT (Interrupt Vector Table)
0x0000:0x0400 -> 0x0000:0x04FF = BDA (BIOS Data Area)
0x0000:0x0500 -> 0x0000:0x7BFF = Free Useable Memory!
0x0000:0x7C00 -> 0x0000:0x7DFF = Operating System BootSector - This is where the BIOS
Loads your Operating System's BootSector at Boot Time (You can use this Memory, as long as
your BootSector isn't executing and you don't need your BootSector anymore!)
0x0000:0x7E00 -> 0x9000:0xFFFF = Free Useable Memory!
0xA000:0x0000 -> 0xB000:0xFFFF = VGA Video RAM
0xC000:0x0000 -> 0xF000:0xFFFF = BIOS ROM Memory Area
0xFFFF:0x0010 -> 0xFFFF:0xFFFF = Free Useable Memory (If the A20 Gate is Enabled) - This
Memory is Above the 1mb Mark, 0xFFFF:0x0010 = 0x00100000(1mb)
I think, I have problems with Bochs. The biggest one: Bochs hates me!
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
I'm missing the EBDA in there... the area just below A000:0000 might be in use by the bios as well.I think I can give you the exact BIOS memory map:
Also, its officially incorrect to assume 640k of conventional memory... (although everybody seems to do it)
Pretty much everything past 9000:0000 is chipset-dependent (With the exception of video memory)
So, you're telling we should load at least at the 1 MB mark and I think you're right, because...different BIOS, different memory map
But I've loaded my second boot loader (it is 200 bytes for now) at the 0100:0000 and it doesn't do a problem. May be if I try on another computer it would do a problem?
But I've loaded my second boot loader (it is 200 bytes for now) at the 0100:0000 and it doesn't do a problem. May be if I try on another computer it would do a problem?
I think, I have problems with Bochs. The biggest one: Bochs hates me!
Hi,
It's also possible to tell users that your OS requires N MB of RAM at 0x00100000, which shouldn't be a problem if N is less than 14 MB and is chosen to suit the rest of the OS's requirements. If it is a problem, then the user has a computer that isn't supported by the OS.
For an example, if the OS requires an 80486 or later CPU, then saying it requires 3 MB of RAM at 0x00100000 shouldn't cause any problem because almost all 80486 or later computers have 8 MB or more (an 80486 or later computer that doesn't meet this requirement would be extremely rare).
@smbogan: People should write code that uses the BIOS services (or GRUB's memory map), but the code to use BIOS services (or GRUB's memory map) needs to be stored in memory somewhere before it's executed...
Cheers,
Brendan
Before you know which areas are what, the area from 0x00000000 to 0x00008000 *should* be entirely safe for all 80286 or later computers (except for the area below 0x00000500 while you're in real mode).INF1n1t wrote:So, you're telling we should load at least at the 1 MB mark and I think you're right, because...different BIOS, different memory map
But I've loaded my second boot loader (it is 200 bytes for now) at the 0100:0000 and it doesn't do a problem. May be if I try on another computer it would do a problem?
It's also possible to tell users that your OS requires N MB of RAM at 0x00100000, which shouldn't be a problem if N is less than 14 MB and is chosen to suit the rest of the OS's requirements. If it is a problem, then the user has a computer that isn't supported by the OS.
For an example, if the OS requires an 80486 or later CPU, then saying it requires 3 MB of RAM at 0x00100000 shouldn't cause any problem because almost all 80486 or later computers have 8 MB or more (an 80486 or later computer that doesn't meet this requirement would be extremely rare).
@smbogan: People should write code that uses the BIOS services (or GRUB's memory map), but the code to use BIOS services (or GRUB's memory map) needs to be stored in memory somewhere before it's executed...
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.