How to create a basic operating system?
How to create a basic operating system?
I got a project to create a basic operating system which will just boot up and can run a calculator in it. I have 28 days to complete the project. I have absolute no idea about how to do it? What I know is basic C programming. Can anybody give me any idea to start with? Any sample piece of code or anything which can help me. Please don't advise me t read a thousand page book. Neither I have money to purchase a book nor I have time to read 1000 page ebook. I want to know
1) What is required to boot up a system? How much code I have to do?
2)Is it possible to run a calculator on a very basic operating system? If possible, how?
3)Can I run his type of OS in vmware? If no, what Extra I have to do to run it in vmware?
4)Is it really possible to do it in 28 days?
The hardware I am going to use is typical pc hardware we use for windows or linux machine.
1) What is required to boot up a system? How much code I have to do?
2)Is it possible to run a calculator on a very basic operating system? If possible, how?
3)Can I run his type of OS in vmware? If no, what Extra I have to do to run it in vmware?
4)Is it really possible to do it in 28 days?
The hardware I am going to use is typical pc hardware we use for windows or linux machine.
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: How to create a basic operating system?
May I point you to the wiki.
1. See the barebones tutorials on the wiki.
2. Yes, I'll leave the implementation up to you.
3. Yes, VMWare is exceptionally similar to a real PC (the higher level video interface is a little different to actual hardware, but basic OSs generally don't care about that)
4. It's doable, but it may be tight. It depends on how well you understand things.
1. See the barebones tutorials on the wiki.
2. Yes, I'll leave the implementation up to you.
3. Yes, VMWare is exceptionally similar to a real PC (the higher level video interface is a little different to actual hardware, but basic OSs generally don't care about that)
4. It's doable, but it may be tight. It depends on how well you understand things.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Re: How to create a basic operating system?
@thepowersgang : Thanks. I will read the wiki. Let's see how much I can understand.
Re: How to create a basic operating system?
Can somebody explain the overall procedure for me once? Like to boot up an operating system, I have to code for grub and kernel and what else? If I don't have to code for grub then what I have to do?
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: How to create a basic operating system?
Grub boots kernel.
Kernel initializes itself, loading GDT, IDT, interrupt systems, etc.
Kernel starts a keyboard driver.
Kernel runs a calculator program, which you can implement directly in the kernel.
Program yourself a basic kernel that says hello world (see the barebones on the wiki).
Program yourself the GDT and the IDT and etc interrupt stuff (see the wiki [interrupts, gdt, idt, isrs, keyboard]).
Get the keyboard input working (see wiki [keyboard]).
And then write a calculator.
Its doable in 28 days, providing that you are motivated enough to try. If you cannot find the information in the wiki that details the process, you don't have much hope of doing this in 28 days. However, it is doable, but since we don't know the extent of your programming skills we can't give a good estimate on how feasible it is.
Good luck,
-JL
Kernel initializes itself, loading GDT, IDT, interrupt systems, etc.
Kernel starts a keyboard driver.
Kernel runs a calculator program, which you can implement directly in the kernel.
Program yourself a basic kernel that says hello world (see the barebones on the wiki).
Program yourself the GDT and the IDT and etc interrupt stuff (see the wiki [interrupts, gdt, idt, isrs, keyboard]).
Get the keyboard input working (see wiki [keyboard]).
And then write a calculator.
Its doable in 28 days, providing that you are motivated enough to try. If you cannot find the information in the wiki that details the process, you don't have much hope of doing this in 28 days. However, it is doable, but since we don't know the extent of your programming skills we can't give a good estimate on how feasible it is.
Good luck,
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: How to create a basic operating system?
Hi,
Remember that if this is an assignment, be VERY careful not to plagarise works found on the internet. I don't really mind if you take my code verbatim, as long as the copyright is maintained, but I'm sure your lecturers will take a rather less bright view of you not doing your own work!
Read the tutorials by all means, but I wouldn't submit a carbon-copy of the resulting code.
James
Here's a bit of a shameless plug: http://www.jamesmolloy.co.uk/tutorial_html. I wrote some tutorials several years back that should talk you through much of what you want to do. You shouldn't need paging or anything like that for a simple calculator - just a C program writing to the screen, taking interrupts will do. See up to section 5.rsmahanti wrote:I got a project to create a basic operating system which will just boot up and can run a calculator in it. I have 28 days to complete the project. I have absolute no idea about how to do it? What I know is basic C programming. Can anybody give me any idea to start with? Any sample piece of code or anything which can help me. Please don't advise me t read a thousand page book. Neither I have money to purchase a book nor I have time to read 1000 page ebook. I want to know
1) What is required to boot up a system? How much code I have to do?
2)Is it possible to run a calculator on a very basic operating system? If possible, how?
3)Can I run his type of OS in vmware? If no, what Extra I have to do to run it in vmware?
4)Is it really possible to do it in 28 days?
The hardware I am going to use is typical pc hardware we use for windows or linux machine.
Remember that if this is an assignment, be VERY careful not to plagarise works found on the internet. I don't really mind if you take my code verbatim, as long as the copyright is maintained, but I'm sure your lecturers will take a rather less bright view of you not doing your own work!
Read the tutorials by all means, but I wouldn't submit a carbon-copy of the resulting code.
James
Re: How to create a basic operating system?
There is also the BrokenThorn Operating System Development Series.
Re: How to create a basic operating system?
I have very little to add, just echoing what others have said, really; if you can get a very simple kernel written, use GRUB to load it and start it and then a simple calculator application (your course may expect its implementation to be separate from your kernel, read it to be sure), you'll be done, by the sounds of it.
The code for a calculator is not especially challenging, GRUB is pretty well documented, so the real challenge is writing a basic kernel; in this regard James's excellent tutorial should help you well along the way, in concert with the Wiki to get the theoretical understanding. As James said, though, be careful you don't simply copy-paste other people's code as every university worth its salt is going to notice and call plagiarism on it.
We're not really here to do your homework for you, basically, but most of us will be more than happy to help you gain understanding of the concepts and a working implementation. :¬)
The code for a calculator is not especially challenging, GRUB is pretty well documented, so the real challenge is writing a basic kernel; in this regard James's excellent tutorial should help you well along the way, in concert with the Wiki to get the theoretical understanding. As James said, though, be careful you don't simply copy-paste other people's code as every university worth its salt is going to notice and call plagiarism on it.
We're not really here to do your homework for you, basically, but most of us will be more than happy to help you gain understanding of the concepts and a working implementation. :¬)
Re: How to create a basic operating system?
It sounds as if the calculator might be your kernel. You don't say how sophisticated the calculator will need to be, but it will probably be enough if you can grab input from the keyboard and write output to the screen. If you stay in real mode you could use the BIOS services for that.
Your main challenge would be to write some assembly language routines to replace standard C functions like getch(), or putc(), which won't be available unless you write them yourself.
The other thing you would need to do is write a boot sector which can san through a FAT16 directory, find you calculator program, and load it. Of course, unlike a normal calculator program, this one won't terminate until your turn off the computer. It will just go round an infinite loop, getting input, doing a calculation, displaying the output, and then waiting for some more input.
If you have only got 28 days to do it, I doubt if your instructor is looking for anything much more sophisticated than that.
Your main challenge would be to write some assembly language routines to replace standard C functions like getch(), or putc(), which won't be available unless you write them yourself.
The other thing you would need to do is write a boot sector which can san through a FAT16 directory, find you calculator program, and load it. Of course, unlike a normal calculator program, this one won't terminate until your turn off the computer. It will just go round an infinite loop, getting input, doing a calculation, displaying the output, and then waiting for some more input.
If you have only got 28 days to do it, I doubt if your instructor is looking for anything much more sophisticated than that.
Re: How to create a basic operating system?
Thanks everybody for help. I will create the os in next ten 10 days and submit the code here. except bootloader, I am not going to use single piece of code written by someone else. Thanks again for everything.
Re: How to create a basic operating system?
Why submit the code here?rsmahanti wrote:Thanks everybody for help. I will create the os in next ten 10 days and submit the code here. except bootloader, I am not going to use single piece of code written by someone else. Thanks again for everything.
-
- Posts: 8
- Joined: Thu Oct 21, 2010 6:29 pm
Re: How to create a basic operating system?
I would recommend sams teach yourself c++ in ten minutes (i believe that is the title) for the calculator and if its just a bet/never will ever be published under your name anywhere as your original work. then do some basic dev tutorials that give boot sector/kernel and then have it load up the program
Its not that easy and im not a expert on Os dev yet so if your just looking for a crap haha look what i can do moment then thats what i would recommend but you will feel more accomplished if you learn how to do it and then do your own code
Its not that easy and im not a expert on Os dev yet so if your just looking for a crap haha look what i can do moment then thats what i would recommend but you will feel more accomplished if you learn how to do it and then do your own code
- gravaera
- Member
- Posts: 737
- Joined: Tue Jun 02, 2009 4:35 pm
- Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.
Re: How to create a basic operating system?
I would never recommend any book on C++ whose title followed the form: "Teach yourself C++ in X days". Talk less of one that advertises the same, but in minutes...
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.
Re: How to create a basic operating system?
Actually, C++ in 21 days by Sams is excellent. It's the book from which I learned.gravaera wrote:I would never recommend any book on C++ whose title followed the form: "Teach yourself C++ in X days". Talk less of one that advertises the same, but in minutes...
- gravaera
- Member
- Posts: 737
- Joined: Tue Jun 02, 2009 4:35 pm
- Location: Supporting the cause: Use \tabs to indent code. NOT \x20 spaces.
Re: How to create a basic operating system?
^ I guess that thing I said above would be just me then? Old fashioned me with my Stroustrup, and large books with lots of small text
17:56 < sortie> Paging is called paging because you need to draw it on pages in your notebook to succeed at it.