Page 1 of 1

First 32-bit PM OS questions!

Posted: Sun Jan 14, 2007 11:54 pm
by XCHG
Okay so I finally made my first 32-bit Kernel which runs in Protected Mode with a simple GDT and no IDT. There are still some unanswered questions in my mind which I’d appreciate if somebody could provide answers to:

1. Where does the interrupt vector table go after switching to protected mode?
2. Where should you normally load your kernel and etc in the physical memory?
3. How should an Operating System be created from scratch? Should you just experiment everything or can you avoid pitfalls that would end in extra effort correcting them later on.
4. How can you determine how much memory is available so that you can organize your Operating System in the memory?
5. How should you go about allowing development of software in your Operating System?

I am still a beginner on this but it’d really help me if somebody could answer these questions. Thanks in advance.

Posted: Mon Jan 15, 2007 12:01 am
by Alboin
I may be able to answer some of these....

1 - It's trashed and is replaced by the Interrupt Descriptor Table.
2 - That depends on your kernel, however many load at the 1 meg mark.
3 - I would suggest you start by creating a general idea of what your going to make (exokernel, microkernel, etc.), and then design the minor details from there.
4 - here
5 - This comes a bit later, once you have a stable enviroment able to run simple programs.

Hope this helps answer your questions! :)

Posted: Mon Jan 15, 2007 11:58 am
by Combuster
1: The IVT is at the beginning of memory, i.e 0x0. Once you switch to protected mode, interrupt handling changes from IVT mode to IDT mode. Since the processor is still aimed at the same address, it'll try to read the IVT as IDT until you give it something else to look at.
In effect, what happens with the IVT depends on what you do with the memory there.

2: That's up to you to decide. Many use the 1MB mark as GRUB forces them to.

3: Whatever YOU prefer to do. If you want to learn everything on yourself, go ahead, if you want to avoid pitfalls, you'll have to read some documentation ahead of time.

4: link already posted

5: I suggest you read the "Is your OS self-hosting" thread

First 32-bit PM OS questions

Posted: Thu Jan 18, 2007 1:54 am
by XCHG
Okay thank you guys for the information. I really need to be reading a lot of OS-Development tutorials and Intel manuals. This is going to be the toughest challenge in development of a software for me so I will probably be asking a lot of questions in the future, too.

Thank you again, I appreciate your help.