Re: How to exec one kernel from inside another ?
Posted: Fri Aug 01, 2008 11:53 am
BTW, There is no paging in these micro kernels. The GDT and IDT setup is same for both the kernels.
The Place to Start for Operating System Developers
http://f.osdev.org/
I forgot to mention that this is a really tiny micro-kernel that wants to get launched. There is NO PAGING in both the kernels. It is not going to need any extra drivers. I'm using only serial port in port-io mode. I could hard-code all the addresses if that would help.JJeronimo wrote:This could include a special entry point for hot boots (or a special boot-time parameter so that the kernel knows it's being executed from inside a running system), that would skip paging and memory initialization. Additional information could also be passed, such as addresses for kernel structures and stuff alike.
.......................
The problem is that some drivers may need to re-initialize it's hardware, and others may not need. Also, the same problem arises if you change e.g. the memory management structure's layout. The trick could be controlling this in a drive-by-drive fashion, and forbidding "hot swaps" if a critical kernel structure was modified.
JJ
Frankly inflater, this is not only extremely off-topic and rude but extremely unhelpful, too. I was merely directing the reader to use linux's source code(which is FOSS) to help him to implement the functionality that he is asking for. This is a perfectly valid answer as linux does have the functionality he is asking for.inflater wrote: Who cares about linux?
Oh. You don't know the answer to his question directly, but you say to him RTFM the Linux source code?... That's sure helpful.I was merely directing the reader to use linux's source code(which is FOSS)
Yes, if he would build his API/environment suitable for the kexec function. I surely wouldn't do that....to help him to implement the functionality that he is asking for.
As stated in the second paragraph. If you don't know the answer to his question, don't post since we are in the OS development section and not General ramblings.This is a perfectly valid answer as linux does have the functionality he is asking for.
Why do you think he needs to build his API/environment suitable for the kexec function to just see how linux has implemented kexec? Do you mean you have to copy code once you've seen it?Yes, if he would build his API/environment suitable for the kexec function.
As a reader of this forum, I fear I prefer posts suggesting what good implementations there exist of kexec then one's manifestoes of his dislikes.As stated in the second paragraph. If you don't know the answer to his question, don't post since we are in the OS development section and not General ramblings.
Well, if he only wants to see how linux has done that, you're right, but what's that good for?to just see how linux has implemented kexec?
Good luck looking into linux's source codeI prefer posts suggesting what good implementations there exist of kexec
I do not want to reboot, but just discard the previous kernel and start the new one. Trying to get some good info on kexec, but all I get is just some vague stuff.Brendan wrote:Hi,
I'm planning something slightly similar............
The kernel would be able to put the computer into this same boot state during shutdown; so that a "full" reboot (where all running software including the kernel can be replaced) can be done without a hardware reset, without BIOS, etc.
Brendan
AFAIK Linux does something similar - it shuts down the existing kernel, prepares the system to start another kernel then starts another kernel; where the new kernel being started doesn't know it wasn't booted by a normal boot loader and reinitializes everything. The only difference here is that my "boot state" is different from Linux's "boot state".sawdust wrote:I do not want to reboot, but just discard the previous kernel and start the new one. Trying to get some good info on kexec, but all I get is just some vague stuff.Brendan wrote:The kernel would be able to put the computer into this same boot state during shutdown; so that a "full" reboot (where all running software including the kernel can be replaced) can be done without a hardware reset, without BIOS, etc.
When you see how a well-reputed os has done something that you want to implement in your os. Seeing the mechanism by which that os has done something is usually a good way to start the implementation of that same mechanism in your own os.inflater wrote: Well, if he only wants to see how linux has done that, you're right, but what's that good for?
This is just a cheap shot at linux.inflater wrote: Good luck looking into linux's source code
No need to get offended so quickly - perhaps he's just referring to complexity of the sources for such a large project. I've had a look at Linux source code before and some of it is a bit of a headache - I don't think that the source for Windows would be any better but have no way of proving thisiammisc wrote:This is just a cheap shot at linux.
Somehow, I have the feeling that inflater would not be so upset if I had directed the OP to look into the source code of Microsoft Windows.
Let's be fair, the linux source code is absolutely horrendous in places. Uncommented chunks of code with cryptic names and spaghetti code all over the shop... Look into the BSD sources for a comparison.AJ wrote:No need to get offended so quickly - perhaps he's just referring to complexity of the sources for such a large project. I've had a look at Linux source code before and some of it is a bit of a headache - I don't think that the source for Windows would be any better but have no way of proving thisiammisc wrote:This is just a cheap shot at linux.
Somehow, I have the feeling that inflater would not be so upset if I had directed the OP to look into the source code of Microsoft Windows.
Cheers,
Adam
Linux's TCP code knocked me down There were comments, but not about what the functions were supposed to doI've had a look at Linux source code before and some of it is a bit of a headache - I don't think that the source for Windows would be any better but have no way of proving this
They're better? Gonna take a look:DLook into the BSD sources for a comparison.
Perhaps use the same state as multiboot compliant bootloaders put the system in (or bootloaders compliant to some other standard)?Brendan wrote:[...]
My approach will be to define a specific boot state, where all boot loaders do what-ever is necessary to put the computer into this boot state. The boot state includes loading a boot image into RAM, gathering data (ACPI/MPS tables, memory/physical address space detection, etc), setting a default video mode, ensuring all CPUs are in the right operating modes, etc.[...]
What about the risk of broken/crashed drivers in the first OS, which do not properly deinitialise the devices?Brendan wrote:[...], but also means that the stability of the OS being booted doesn't depend on previous device drivers or previous device states, or previous kernel data structures.