OPerating System Design using C
OPerating System Design using C
How to start designing my own operating system using the C Language.Please help
Re:OPerating System Design using C
first get your C kernel loaded...
using assembly - mbr (like me) or a bootloader (grub)
you can also try to write a bootblock (which reads the partition table and starts your kernel) and let lilo (or another bootblockloader (:)) start it...
Then start writing your kernel...
That's a basic kernel which hangs...
Then start thinking about a filesystem so you can start a user program (which allows the user to start other programs -- shell)
kernel modules etc.
using assembly - mbr (like me) or a bootloader (grub)
you can also try to write a bootblock (which reads the partition table and starts your kernel) and let lilo (or another bootblockloader (:)) start it...
Then start writing your kernel...
Code: Select all
asm("jmp main");
int main()
{
while (1)
{
}
}
Then start thinking about a filesystem so you can start a user program (which allows the user to start other programs -- shell)
kernel modules etc.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:OPerating System Design using C
First try to figure out what services are needed. OS design starts with a pen and a lot of paper, not with a programming language.
It will be more interresting for every buddy if we don't start with a buggy boot sector but have some stuffs that other needs to step forward
- Are you going to support multiprogramming, if you do, how will context switching be handled ? what will be the architecture of your scheduler ? what kind of parameters will it need ? how will it be called ?
- Are you going to provide pluggable modules ? if yes what kind of info do they need ? and how will The System remember infos about them ?
- Are you going to provide virtual memory ? ...
It will be more interresting for every buddy if we don't start with a buggy boot sector but have some stuffs that other needs to step forward
Re:OPerating System Design using C
If you want to just program the OS just in C, that's imposible, you need some assembly.
On a floppy drive, to make your OS, this needs to happen: Assembly Bootsector->Protected Mode->GDTR->C kernel made with GCC.
Making your own Assembly bootsector is REALLY hard. It took me 3 months :-[ because I had to learn alot. Making your own OS is alot different than programming with VC++ or VB.
If your wondering what Protected Mode ( PMode ) is, it's a processor ( CPU ) mode that interrupts are disabled ( well, there's alot more to PMode ).
Oh yea, there IS this link that shows you how to make a bootsector in C, using GCC, with real-mode CGG code ;D.
I haven't tested it, because I'm already past this step.
http://www.developerpit.com/compiler_options.html
Mabe with that link...you might be able to make your own bootsector in C ( I suggest not to ).
I have my own OS in C, and you can use it's code.
it's called FritzOS ( no, not chips , Fritz is my name ), here is the link www.sourceforge.net/projects/fritzos
I hope that helps you,
On a floppy drive, to make your OS, this needs to happen: Assembly Bootsector->Protected Mode->GDTR->C kernel made with GCC.
Making your own Assembly bootsector is REALLY hard. It took me 3 months :-[ because I had to learn alot. Making your own OS is alot different than programming with VC++ or VB.
If your wondering what Protected Mode ( PMode ) is, it's a processor ( CPU ) mode that interrupts are disabled ( well, there's alot more to PMode ).
Oh yea, there IS this link that shows you how to make a bootsector in C, using GCC, with real-mode CGG code ;D.
I haven't tested it, because I'm already past this step.
http://www.developerpit.com/compiler_options.html
Mabe with that link...you might be able to make your own bootsector in C ( I suggest not to ).
I have my own OS in C, and you can use it's code.
it's called FritzOS ( no, not chips , Fritz is my name ), here is the link www.sourceforge.net/projects/fritzos
I hope that helps you,
Re:OPerating System Design using C
well, you could use 2 compielrs, 1 16bit and 1 32 bitPosted on: Today at 06:52:30am If you want to just program the OS just in C, that's imposible, you need some assembly.
but uhm, I suggest you use assembly for your bootsector and then use gcc (like me)
some people told me "use grub" all the time, which really pissed me off
so I just started coding, didn't give up and now I have it...
(a bootsector at the mbr)
nothing is hard if you know how to do it
it took me 2 weeks or something...Making your own Assembly bootsector is REALLY hard. It took me 3 months because I had to learn alot. Making your own OS is alot different than programming with VC++ or VB.
before that I didn't know about pmode and so, so I tried to implent my filesystem in the bootsector :-[
(I'm not counting that in with my programming time )
(32bit) pmode allows you to use max 4 gigabyte of memory.If your wondering what Protected Mode ( PMode ) is, it's a processor ( CPU ) mode that interrupts are disabled ( well, there's alot more to PMode ).