Do I need to use the second dwords in int 15h in 32bit?
Do I need to use the second dwords in int 15h in 32bit?
I'm trying to use int 15h ax = 0xE820, but I see everything is in qwords, so do I need to use the second word in base address and length?
Because from what I understand it was done to support 64bit aswell, but I am not going to use 64bit.
Thanks.
Because from what I understand it was done to support 64bit aswell, but I am not going to use 64bit.
Thanks.
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Do I need to use the second dwords in int 15h in 32bit?
...If you don't know it, how are you going to discard records for memory above the 4GB barrier?
(And you're assuming you never support PAE)
(And you're assuming you never support PAE)
Re: Do I need to use the second dwords in int 15h in 32bit?
But on an 32bit architecture I can't even address locations higher than 4Gb(without using segmentation I think), so why would I need to even care about those?
Thanks.
Thanks.
- 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:
Re: Do I need to use the second dwords in int 15h in 32bit?
Because you don't want to use ram from 0G to 4G when its actually from 4G to 8G?
Re: Do I need to use the second dwords in int 15h in 32bit?
Hi,
80x86 has supported 36-bit physical addresses since the original Pentium CPUs were released in 1993.
Cheers,
Brendan
"32-bit architecture" mostly just means the general purpose registers are 32-bit (although different people use different terminology, depending on what mood they're in and what they're trying to sell). It doesn't mean that physical addresses can't be something completely different.shedokan wrote:But on an 32bit architecture I can't even address locations higher than 4Gb(without using segmentation I think), so why would I need to even care about those?
80x86 has supported 36-bit physical addresses since the original Pentium CPUs were released in 1993.
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.
Re: Do I need to use the second dwords in int 15h in 32bit?
So what is the maximum values a 32bit bios will give me?
Because it's impossible to manage all the memory as if it was 64bit on a 32bit processor(or is it?).
Thanks.
PS: by 32bit and 64bit I mean the values I can pass to the processor as addresses, so a 32bit processor with GDT and paging will have a limit of addressable memory of the max value a 32bit register can hold.
Because it's impossible to manage all the memory as if it was 64bit on a 32bit processor(or is it?).
Thanks.
PS: by 32bit and 64bit I mean the values I can pass to the processor as addresses, so a 32bit processor with GDT and paging will have a limit of addressable memory of the max value a 32bit register can hold.
- 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:
Re: Do I need to use the second dwords in int 15h in 32bit?
If there's memory above 4G, you won't access it with legacy paging or without paging at all - it will just be wasted. You still have to check the full 64 bits to see if they actually fall within your "inferior" scheme, and discard what you can't use.
Re: Do I need to use the second dwords in int 15h in 32bit?
But is it possible for a computer with only 32bit instructions to have more than 4gb memory? And if so what is the max this kind of computer could have?
And I am fine with my OS not being supported on processors that support 64bit instructions, I don't have that kind of computer so there's no real way for me to test it without bochs and that would also be too much work wasted(for now).
Thanks.
And I am fine with my OS not being supported on processors that support 64bit instructions, I don't have that kind of computer so there's no real way for me to test it without bochs and that would also be too much work wasted(for now).
Thanks.
- 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:
Re: Do I need to use the second dwords in int 15h in 32bit?
shedokan wrote:So no matter what I do the computer can still have more memory than I would support?
It's not a matter of what you do, it's a matter of what you refuse to do. No paging gives 32 bits of physical addresses. Legacy paging gives 32 bits. PAE gives 36. PSE36 gives 36. Long mode gives the full width of the address bus. You just make your choice. You have all the keywords to get the necessary information from the manuals.shedokan wrote:I am not going to use 64bit.
Drivers (or modules in general) are your code. Your actions put them somewhere, whether directly or by your choice of bootloader.If for instance I have a coumputer with 8gb ram is there a possibility that drivers will be put in the area after 4gb?
Re: Do I need to use the second dwords in int 15h in 32bit?
Thanks all, I think I get everything about memory spport, it's up to what I support because 64bit processors have backwards compability right?(I take it from Long mode which has to be enabled for 64bit support and before it is enabled it's in 32bit or real mode)
So what is right here?
Thanks
What you say contradicts this from Memory_Map(x86):Drivers (or modules in general) are your code. Your actions put them somewhere, whether directly or by your choice of bootloader.
and:start: C000000 (sometimes)
end: FFFFFFF
size: 4000000
region/exception: various (unusable except by drivers)
description: PnP NVRAM?, LAPIC, BIOS, ...
From these two examples it looks to me as if the drivers or something else but me put them there.There are likely to be regions of it that contain memory mapped hardware, that nothing but a device driver should ever access
So what is right here?
Thanks
Re: Do I need to use the second dwords in int 15h in 32bit?
Hi,
What the table is trying to say is that the area from <somewhere> (e.g. maybe 0xC0000000, but it depends on motherboard, devices present, etc) to 0xFFFFFFFF is reserved for memory mapped PCI devices (e.g. the video card's display memory) and the motherboard/chipset's use (e.g. HPET, IO APIC, local APICs, firmware/ROM, etc); and therefore this area shouldn't be touched (except by the device drivers for the devices that happen to be mapped into this area).
The device drivers themselves need to be in RAM, not in the area reserved for memory mapped devices, even though they (may) access the devices via. the the area reserved for memory mapped devices.
Note to others: I'm about to mess with that table, and the comments above probably refer to the old wiki page and not the (future) new page - use the "history" tab to see what it was beforehand.
Cheers,
Brendan
That table has so many errors it's not funny - consider the differences between "C000000", "0x0C000000" and "0xC0000000" for a start.shedokan wrote:What you say contradicts this from Memory_Map(x86):and:start: C000000 (sometimes)
end: FFFFFFF
size: 4000000
region/exception: various (unusable except by drivers)
description: PnP NVRAM?, LAPIC, BIOS, ...From these two examples it looks to me as if the drivers or something else but me put them there.There are likely to be regions of it that contain memory mapped hardware, that nothing but a device driver should ever access
So what is right here?
What the table is trying to say is that the area from <somewhere> (e.g. maybe 0xC0000000, but it depends on motherboard, devices present, etc) to 0xFFFFFFFF is reserved for memory mapped PCI devices (e.g. the video card's display memory) and the motherboard/chipset's use (e.g. HPET, IO APIC, local APICs, firmware/ROM, etc); and therefore this area shouldn't be touched (except by the device drivers for the devices that happen to be mapped into this area).
The device drivers themselves need to be in RAM, not in the area reserved for memory mapped devices, even though they (may) access the devices via. the the area reserved for memory mapped devices.
Note to others: I'm about to mess with that table, and the comments above probably refer to the old wiki page and not the (future) new page - use the "history" tab to see what it was beforehand.
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.
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Do I need to use the second dwords in int 15h in 32bit?
PAE also gives you the full width of the address bus (Remember that long mode paging is PAE paging, 'just more')Combuster wrote:shedokan wrote:So no matter what I do the computer can still have more memory than I would support?It's not a matter of what you do, it's a matter of what you refuse to do. No paging gives 32 bits of physical addresses. Legacy paging gives 32 bits. PAE gives 36. PSE36 gives 36. Long mode gives the full width of the address bus. You just make your choice. You have all the keywords to get the necessary information from the manuals.shedokan wrote:I am not going to use 64bit.
PSE36 gives you more address bits to play with as well these days (Though not the full architecturally defined 52-bits)
AMD64 CPUs start in real mode, just like legacy IA-32 ones.shedokan wrote:Thanks all, I think I get everything about memory spport, it's up to what I support because 64bit processors have backwards compability right?(I take it from Long mode which has to be enabled for 64bit support and before it is enabled it's in 32bit or real mode)
You are confusing drivers and devices. Drivers are pieces of code that you (or somebody else) writes for your operating system (or some multi-operating system standard). Devices are pieces of hardware which will be put (initially, at least) wherever the BIOS wants to put them.shedokan wrote:What you say contradicts this from Memory_Map(x86):Drivers (or modules in general) are your code. Your actions put them somewhere, whether directly or by your choice of bootloader.and:start: C000000 (sometimes)
end: FFFFFFF
size: 4000000
region/exception: various (unusable except by drivers)
description: PnP NVRAM?, LAPIC, BIOS, ...From these two examples it looks to me as if the drivers or something else but me put them there.There are likely to be regions of it that contain memory mapped hardware, that nothing but a device driver should ever access
So what is right here?
Thanks
There are some conventions as to where devices go (Generally, unless they fall into one of the <1MB legacy holes, just below the 4GB barrier). You can relocate them if the BIOS screws up their placement... but in general, BIOSes these days put them in reasonable places. Even if you use long mode or PAE to access more than 32-bits of addressing, you probably should not move them above 4GB (Because not all devices support >32-bit addressing, even if the device you're moving does, it prevents another device from performing DMA directly into its onboard memory if said other device does not support >32-bit addressing {Direct device to device DMA is rarely used but is not non-existant. A relatively common use of it is transferring images directly from a TV card's decoder to the GPU's texture RAM})
Re: Do I need to use the second dwords in int 15h in 32bit?
+1Brendan wrote:I'm about to mess with that table
JAL
Re: Do I need to use the second dwords in int 15h in 32bit?
So it is possible to relocate the device's memory if the BIOS puts it somewhere I don't like, great that's what I wanted to know aswell.
Wer'e going a bit offtopic but I wanted to ask this one last question, how can I know where the BIOS put the devices(will it show up on one of the methods of "Detecting Memory (x86)"?
Thanks, you all helped me understand a lot more than I even asked(about processor states and all).
PS: I know what drivers and devices are, but it still showed my point.
Wer'e going a bit offtopic but I wanted to ask this one last question, how can I know where the BIOS put the devices(will it show up on one of the methods of "Detecting Memory (x86)"?
Thanks, you all helped me understand a lot more than I even asked(about processor states and all).
PS: I know what drivers and devices are, but it still showed my point.