How to write a simple OS?

thenew3

Golden Member
Apr 20, 2001
1,206
1
81
Does anyone have a link to any information showing how to write a simple OS for a X86 based machine?

My prof has assigned us a project to write a small OS (under 100k) for a PC. with basic features.
He wants us to try to find code on the web to reuse.

Thanks

 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Heh... you're going to have to be much more specific on what exact features you need. Real/Protected mode? Filesystems? At my school, we have a full course on OS design where you make a simple OS for an instruction set similar to x86 (but not real x86). They write a kernel, fs driver, shell, etc. It's a LOT of work.
 

EeyoreX

Platinum Member
Oct 27, 2002
2,864
0
0
I don't know much about programming anything. I don't know much about Linux. But, I do know there are Linux distros that can can run off a 1.44MB floppy. I also know that Linux sourcecode is free to modify. Seems to me there are several options in the Linux arena alone. If I'm mistaken, I welcome (and am sure I will get) corrections to my statement.

\Dan
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Stuff like that use to be more common to do. Back in the day electronic students would build their own computer starting from a 8086 chip and a bunch ram and rom chips and soldier it all together. Then they would write a OS for it.

So I bet their would be a few websites that would explain stuff like that since so many people are into vintage computers.

Looks like a lot of C programming and a bit of assembly thrown in...

You could check out the Freedos project. Parts of it are GPl'd so you can grab some of what you need there probably.

I did a search on google for: write your own OS
And it came up with a whole bunch of stuff.
 

mikeford

Diamond Member
Jan 27, 2001
5,671
160
106
A really simple OS could be little more than a loop with a few utilities and hardware drivers.

The most basic I have done are nothing more than some entry point for the reset etc., a bit of setup code, like zero memory and reset hardware devices, then a call or jump to whereever the application code is and loops, with a couple drivers like simple character output to a display or printer.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
That's what I thought. You type, something pops up on the screen. You start a program, write a couple words to a file in plain text, and then save it. No editting baclspaces or anything fancy like that.
 

thenew3

Golden Member
Apr 20, 2001
1,206
1
81
Well we have been given very little info from the prof as to what he wants.

Basically for hardware, he said he wants to be able to put the floppy into his PC which is P2-P4 based machine. and be able to boot from it.
He wants to be able to look at files on his HD (FAT16 partition on a IDE interface drive) and have plain text displayed on screen and be able to type in commands via keyboard.

The whole thing should be under 100k.

I'm not sure what he is going to do to test it other then boot it up. He says we can use as much code as we can find on the web or in books.

Thanks!
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
So, are you supposed to write it or not? If you can use "as much code as you can," then why not just toss dos or linux on a floppy?
 

Buddha Bart

Diamond Member
Oct 11, 1999
3,064
0
0
Originally posted by: thenew3
Well we have been given very little info from the prof as to what he wants.

Basically for hardware, he said he wants to be able to put the floppy into his PC which is P2-P4 based machine. and be able to boot from it.
He wants to be able to look at files on his HD (FAT16 partition on a IDE interface drive) and have plain text displayed on screen and be able to type in commands via keyboard.
Easy, linux boot floppy, you're done.
The whole thing should be under 100k.
Impossible. You're never gonna access IDE devices and read a FAT16 filesystem on 100K worth of code.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: Buddha Bart
Originally posted by: thenew3
Well we have been given very little info from the prof as to what he wants.

Basically for hardware, he said he wants to be able to put the floppy into his PC which is P2-P4 based machine. and be able to boot from it.
He wants to be able to look at files on his HD (FAT16 partition on a IDE interface drive) and have plain text displayed on screen and be able to type in commands via keyboard.
Easy, linux boot floppy, you're done.
The whole thing should be under 100k.
Impossible. You're never gonna access IDE devices and read a FAT16 filesystem on 100K worth of code.


I don't know. They had computers that ran on less then a 100k. And he didn't say anything about IDE devices.

I am thinking of a 8086 chip with some sims, a simplistic 2 color display device with a floppy disk. If even that.

Something on the level of what we would call "calculator" nowadays.

Probably end up running it on a virtual computer anyways,

I bet that 100k limit is just to keep people from trying to be fancy... I wonder, would you considure the boot loader to be part of the OS? Or can it BE the OS?
 

thenew3

Golden Member
Apr 20, 2001
1,206
1
81
Well it will be tested on a system with a P2 or P3 or P4 based processor. It has to support a IDE HD with FAT16 (bonus points if it supports unix inode file system).

It does not have to support color display, just B&W text is fine. and a simple shell that will accept a few simple commands (i.e. dir, copy, move etc)

He said we can use as much source code from other places as we want, but we can not just simply copy another OS. I.E. linux. and we do not need a full function OS like linux. it has to be 100k or less.

 

AlexWade

Member
Sep 27, 2003
89
0
0
http://www.cs.ecu.edu/~hochberg/fall2003/4630HW1.html

We had to analyze this OS. First, it is written for a Hitachi chip, not x86. But you can modify the assembly language part for x86 instructions. It might be a little too complicated for what you need, but it can give you a good idea of how to start. This is a priority based OS, not very complicated. Round-robin style.

Anytime you see "lcd" that means liquid crystal display, for output.
__asm__ is assembly language code. I hope you know some.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |