Questions on Design of sections
Posted: Sun Mar 22, 2009 5:56 pm
Hey,
I'm trying to make a scalable os, and while going into protected mode, it seems I need to decide beforehand atleast the basic structure of the way things are stored in memory. Right now, what I could come up with is (starting from memory 0x0): GDT, LDT, IDT, Kernel Code related to booting, ISR's, Hardware Routines, etc. I had the following questions:
1. Do we need to load all the ISR's beforehand itself when entering protected mode? Is it ok if I make entries only for most important/common interrupts before hand and change IDT later?
2. I don't know the size of the various modules of code. For eg, I don't know the size of booting related kernel code. Then how should I know where the ISR's should be loaded to? Do I simply pick an arbitrary location and pray my kernel code "fits" before that?
3. I'm trying to build an OS, whose main purpose, is to act as a base for Virtual machine softwares. In that case, is flat memory model the best way to go? Or is it better to carefully segment memory?
4. Consider there is a module of code related to memory management, and one, related to processes. Should the code for memory management use services of the process manager (or vice versa) (as in should the memory manager be considered as a process, or should the memory management of the process manager be handled by the memory management? ). Or should I just make them completely independent?
5. This is more of a coding question: Consider I make ISR's completely in 1 assembly file. Could I get the locations where all the functions will be loaded into, so I can arrange them in the IDT.
I'm trying to make a scalable os, and while going into protected mode, it seems I need to decide beforehand atleast the basic structure of the way things are stored in memory. Right now, what I could come up with is (starting from memory 0x0): GDT, LDT, IDT, Kernel Code related to booting, ISR's, Hardware Routines, etc. I had the following questions:
1. Do we need to load all the ISR's beforehand itself when entering protected mode? Is it ok if I make entries only for most important/common interrupts before hand and change IDT later?
2. I don't know the size of the various modules of code. For eg, I don't know the size of booting related kernel code. Then how should I know where the ISR's should be loaded to? Do I simply pick an arbitrary location and pray my kernel code "fits" before that?
3. I'm trying to build an OS, whose main purpose, is to act as a base for Virtual machine softwares. In that case, is flat memory model the best way to go? Or is it better to carefully segment memory?
4. Consider there is a module of code related to memory management, and one, related to processes. Should the code for memory management use services of the process manager (or vice versa) (as in should the memory manager be considered as a process, or should the memory management of the process manager be handled by the memory management? ). Or should I just make them completely independent?
5. This is more of a coding question: Consider I make ISR's completely in 1 assembly file. Could I get the locations where all the functions will be loaded into, so I can arrange them in the IDT.