Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Operating System Programming: Boot + Kernel??? Only EXPERTS

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hello you all,

I know this is a hard question, and some of you don't
know this, but I need some help to do my own operating
system:p :)

Do you have some code of a boot sector that loads a kernel
to memory?
I can do the boot sector, but It's strange to me
loading kernel to memory.
I also need help to DPMI. I know that I can allocate memory
up to 4GB of memory and load my kernel to it.

Where can I find good information about operating system
development???

Thanks:)
 
DPMI or DOS Protected Mode Interface is a standard which is defined by the Operating System. If you still haven't loaded the OS, (which you haven't because you're still loading the kernel) then there is no DPMI who will allocate anything for you. Unless you intend to integrate it into your most basic kernel, and have a separate kernel which you intend to load using the DPMI, you should generally act as if your program 'owns' the machine, which it does because it's the OS for speaking out loud! That's a rather inefficient way of doing things, by the way, so might as well load the kernel into low memory, then switch to PM, and load anything that doesn't fit into your basic kernel using your own routines. Implementing DPMI while you're STILL developing the most basic parts of your OS is a bad idea in any case.

Anyway: the bootstrap simply loads a series of sectors, which for some reason contains the kernel (usually because the OS programmer put them there). It's in real mode because the BIOS, which just called it, is real mode. So: use BIOS interrupts to load the kernel from disk to memory.

"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
It is a hard thing to do!
I'm also don't know how to jump to kernel!
 
Don't you know WHERE you loaded your kernel????


And by the way the kernel I am talking about is the most BASIC kernel. It's still in REAL MODE.

So switch to PROTECTED MODE first AFTER you load your kernel. It probably won't fit in the bootstrap so you need to put your mode switch into your basic kernel. "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Do I need to switch to protected mode, before jump to kernel?
It isn't possible to jump in real mode to kernel after reading it?

Some of you could give me a boot code that reads a sector
example (sector 2) and jump to it.

An evidence:
When things seems to be impossible, it's clear, easy and
of course possible;)
 
I understand that you want to jump to a code after your boot code. You can very well do this in real mode. You load the code from floppy using BIOS interrupts and then jump to the code. You can get a sample code at Regards
Ekanth Treat the daily build of a project as the heartbeat of the project. If there's no heartbeat the project is dead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top