Loading meh kernel above 0x10000
- ChazZeromus
- Member
- Posts: 61
- Joined: Sun Jun 22, 2008 4:09 pm
Loading meh kernel above 0x10000
Right now, I found a way to load my kernel above 0x10000 without using grub, even though grub supports booting up from various mediums, I like doing everything my own way. So I'm just wondering, what if I loaded my kernel above the address 0x10000 by constantly switching back and forth between real address mode and protected mode. And I wonder if switching back to real mode would not harm the bios routines. I just want to know if this would work. I'm going to try it anyways
- 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: Loading meh kernel above 0x10000
As long as you don't change anything the bios needs (e.g. IDT, (E)BDA), then you can go in and out of protected mode without causing serious problems.
You may want to consider Unreal Mode though...
You may want to consider Unreal Mode though...
- ChazZeromus
- Member
- Posts: 61
- Joined: Sun Jun 22, 2008 4:09 pm
Re: Loading meh kernel above 0x10000
What? You're joking right?
Re: Loading meh kernel above 0x10000
Just something off topic that I've noticed:
Why does everybody who asks these kind of addressing questions (I'm not singling out the OP) make the mistake of saying 0x10000 (64 kB) when they almost always mean 0x100000 (1 MB)? It's just a random thing that bugs me...
Why does everybody who asks these kind of addressing questions (I'm not singling out the OP) make the mistake of saying 0x10000 (64 kB) when they almost always mean 0x100000 (1 MB)? It's just a random thing that bugs me...
"Sufficiently advanced stupidity is indistinguishable from malice."
Re: Loading meh kernel above 0x10000
because they like to be cool but forget a leading 0?
or maybe he did mean to load his kernel at 64kb point?
or maybe he did mean to load his kernel at 64kb point?
Re: Loading meh kernel above 0x10000
<problem>
If I am not correct, when you switch back to real mode you don't get back the BIOS interrupts. (If you want them back, you will find them at 0x0-0x3FF).
</problem>
P.S. Do NOT try getting back the BIOS interrupts in pmode. It wont work (I was actually dumb enough to try this...)
If I am not correct, when you switch back to real mode you don't get back the BIOS interrupts. (If you want them back, you will find them at 0x0-0x3FF).
</problem>
P.S. Do NOT try getting back the BIOS interrupts in pmode. It wont work (I was actually dumb enough to try this...)
OS-LUX V0.0
Working on...
Memory management: the Pool
Working on...
Memory management: the Pool
- ChazZeromus
- Member
- Posts: 61
- Joined: Sun Jun 22, 2008 4:09 pm
Re: Loading meh kernel above 0x10000
Oh why didnt you just say 16-bit mode with > 64KB access. I knew that can be achieved but I never knew it had a name.
mod edit: wiki discussion moved
- 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: Loading meh kernel above 0x10000
I used the de-facto term for it since you can google on that
Re: Loading meh kernel above 0x10000
In fact, you do seem very insistent that you really do mean that you think you have a 64K addressing limitation. There is no such limitation, which suggests that you do not understand the function of the segment registers when you are in Real mode. The segment registers contain one extra nibble of an address, when the CPU is in Real mode. (To be more precise, an "address" in Real mode is made from a segment register shifted up 4 bits, plus a specified 16 bit offset register.
This allows you to address 1MB, while you are in Real mode. However, you should only count on the first half of that memory to actually exist.
This allows you to address 1MB, while you are in Real mode. However, you should only count on the first half of that memory to actually exist.
- ChazZeromus
- Member
- Posts: 61
- Joined: Sun Jun 22, 2008 4:09 pm
Re: Loading meh kernel above 0x10000
You know, I'm not stupid. I know that, but when I use bios routines to read my kernel into memory, I can only specify a location that I can write to by segment, so the highest I can go is 0xFFFF0. I just wanted move data above that address.
Re: Loading meh kernel above 0x10000
When you switch from p-mode to real-mode, you retain all your bios interrupts as long as you have not over-written your IVT and you remember to set your IDT back to the correct information. I also recommend unreal mode however, to keep from switching back and forth, although I did do my kernel both ways at one point and there wasn't a very big difference in booting time (disk i/o is my major slow down).cr2 wrote:<problem>
If I am not correct, when you switch back to real mode you don't get back the BIOS interrupts. (If you want them back, you will find them at 0x0-0x3FF).
</problem>
P.S. Do NOT try getting back the BIOS interrupts in pmode. It wont work (I was actually dumb enough to try this...)
- ChazZeromus
- Member
- Posts: 61
- Joined: Sun Jun 22, 2008 4:09 pm
Re: Loading meh kernel above 0x10000
Yeah, I already knew that. You also can't overwrite the Extended Bios Area or you'll lose your interrupt procedures.Ready4Dis wrote:When you switch from p-mode to real-mode, you retain all your bios interrupts as long as you have not over-written your IVT and you remember to set your IDT back to the correct information. I also recommend unreal mode however, to keep from switching back and forth, although I did do my kernel both ways at one point and there wasn't a very big difference in booting time (disk i/o is my major slow down).cr2 wrote:<problem>
If I am not correct, when you switch back to real mode you don't get back the BIOS interrupts. (If you want them back, you will find them at 0x0-0x3FF).
</problem>
P.S. Do NOT try getting back the BIOS interrupts in pmode. It wont work (I was actually dumb enough to try this...)
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Loading meh kernel above 0x10000
The interrupt handlers aren't in the EBDA. In fact, some (especially older) BIOSes don't even have an EBDA, only a BDA that holds some information about the state of the machine (for instance the state of the num lock key or what's on a COM/LPT port). The IVT tells you more about where the interrupt handlers are.Yeah, I already knew that. You also can't overwrite the Extended Bios Area or you'll lose your interrupt procedures.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
- ChazZeromus
- Member
- Posts: 61
- Joined: Sun Jun 22, 2008 4:09 pm
Re: Loading meh kernel above 0x10000
Okay fine, is isn't extended. Okay, well maybe I'm wrong it's not like you weren't ever. Okay, if the IVT's point to where the handlers are, then where exactly are they? Go write a program or something. EDBA can also describe the interrupts too. Geez, I'm know alot but theres alot i don't know, and I'm not like 23 years old or anything.
By the way, happy terrorist day.
By the way, happy terrorist day.