"Smart" Boot Loader VS "Complicated" Kernel
Posted: Sat Oct 24, 2015 12:50 pm
Hello again (thought you got rid of me didn't you )
Let me start by explaining (one of) the goals for my OS:
Since the start, I have wanted to develop a "cloud computing" system - many systems linked via Eth and/or RS232. But to have full support for each computer (CPU) I need both protected mode and long mode functionality (at once)
My test setup will be the following systems:
AMD K6 - 64MB
Intel P4 HT (no lm) - 4GB
Intel Core2 Quad - 8GB
AMD Phenom II x6 - 6GB
Intel Atom (ht, no lm) - 2GB
Which will give me 3x 32-bit processors, 2x HT (may avoid these cores all together), and 10x 64-bit processors - and a total of 20.06GB System Memory
So assuming I know how to communicate between the systems... (which as of yet I do not, but soon)
I have thought of two ways to make this work:
1) Have to osloader use CPUID to detect the presence of LM and insert the folder "x86_64/" or "x86/" to the file path respectfully and design two kernels (one for PM and one for LM)
2) Design my kernel to detect CPU functions and have both schedulers, IDTs, GDTs, etc in the same file
Now the issue with both ideas:
1) I will be forced to write two kernels one for x86 and one for x86_64
2) Unless I am mistaken, I will have to use Binary format to mix 32 and 64-bit code instead of the ELF format I am currently using (not to big of a deal) - but I may have to drop C all together as I'm unsure how LD and GCC will react with mixed code - though again no big deal, I'm moving all my C piece by piece to ASM already (and my skill in ASM is improving quickly).
So while method one seems the easiest, method two seems more efficient and interesting (IMO)
What are your thoughts? I'm torn between the two option listed, but have not considered any other (as I cannot see them)
Post Thought:
The kernel only handles Scheduling, Physical Memory Management, Paging, and IPC - plus the CPU (IDT, GDT, TSS, Etc.) all other hardware is controlled in Ring3 by "applications / drivers"
Let me start by explaining (one of) the goals for my OS:
Since the start, I have wanted to develop a "cloud computing" system - many systems linked via Eth and/or RS232. But to have full support for each computer (CPU) I need both protected mode and long mode functionality (at once)
My test setup will be the following systems:
AMD K6 - 64MB
Intel P4 HT (no lm) - 4GB
Intel Core2 Quad - 8GB
AMD Phenom II x6 - 6GB
Intel Atom (ht, no lm) - 2GB
Which will give me 3x 32-bit processors, 2x HT (may avoid these cores all together), and 10x 64-bit processors - and a total of 20.06GB System Memory
So assuming I know how to communicate between the systems... (which as of yet I do not, but soon)
I have thought of two ways to make this work:
1) Have to osloader use CPUID to detect the presence of LM and insert the folder "x86_64/" or "x86/" to the file path respectfully and design two kernels (one for PM and one for LM)
2) Design my kernel to detect CPU functions and have both schedulers, IDTs, GDTs, etc in the same file
Now the issue with both ideas:
1) I will be forced to write two kernels one for x86 and one for x86_64
2) Unless I am mistaken, I will have to use Binary format to mix 32 and 64-bit code instead of the ELF format I am currently using (not to big of a deal) - but I may have to drop C all together as I'm unsure how LD and GCC will react with mixed code - though again no big deal, I'm moving all my C piece by piece to ASM already (and my skill in ASM is improving quickly).
So while method one seems the easiest, method two seems more efficient and interesting (IMO)
What are your thoughts? I'm torn between the two option listed, but have not considered any other (as I cannot see them)
Post Thought:
The kernel only handles Scheduling, Physical Memory Management, Paging, and IPC - plus the CPU (IDT, GDT, TSS, Etc.) all other hardware is controlled in Ring3 by "applications / drivers"