PDA

View Full Version : Creating an OS




Sean7512
Mar 18, 2007, 11:30 PM
Well, call me crazy but I've been thinking about creating my own operating system :eek: Why you may ask? Because I think I'd enjoy the challenge and would gain experience as well as learning a whole lot. I am not talking about a full, fledged graphical OS, obviously. I think it'd be fun to see what I can do, I would like to create it to be able to handle preemptive multitasking, page faults, hardware interrupts, exception, and the like. I have quite a few books on Operating Systems that I would be able to reference. I have taken all of my C++ courses needed for my CIS major and I also know a great deal of x86 Assembly Language and Macros. What do you think, is it even remotely possible to do? The books claim that knowledge of C++, Assembly, and lots of patience is all thats needed. So, what do you guys think, am I insane or is it possible?



mduser63
Mar 19, 2007, 12:05 AM
Well, Linus Torvalds did it. He wrote a kernel anyway. I guess my advice would be, don't think it's going to be easy. There's a reason there are hundreds and even thousands of people working on OS programming at Apple and Microsoft.

x704
Mar 19, 2007, 12:59 AM
While you are at it could you make a driver for the wireless card in the iMac (C2D) for 64bit Linux? That might be a bit easier ;)

I'd do it myself if I knew more C/C++, maybe this summer if nobody else does it.

MacAodh
Mar 19, 2007, 01:19 AM
Well christ don't you go for broke!!!! from what i know there's nothing stopping you other then the length of the average human life and the prerequisite that we sleep :D. But there's no reason you couldn't make a really basic one. Nothing that will do anything fancy but it may be better to get a few people to help, start a mini project....

It's something i'd love to do, a real achevement but i'm afraid, other then read a few books and make some half arsed atempts to start me knows nada about programing. But future goal is to learn and that would be something that you could look at and be proud!!!:)

Good luck if you do try though, more power to you for even dreaming, as they say, aim for the moon and if you miss at least you'll give some ammature astronomist a shock:eek:

Catfish_Man
Mar 19, 2007, 01:20 AM
There are quite a few people who have written OSs, actually. It's not that difficult. I would suggest picking a well known older system to target, as modern hardware tends to be complex and lacking in documentation.

Aniej
Mar 19, 2007, 01:20 AM
I have absolutely no idea how hard this would be, but imagine quite difficult. Because it will likely be so difficult and you have the ambition to do this thing, I say absolutely go for it! You have nothing to lose, fun and frustration to experience and a great goal that sounds interesting. if you are serious about going ahead, I will subscribe to this thread and try and check in every once in a while and check up on the progress. Go for it.

lazydog
Mar 19, 2007, 05:08 AM
I guess you could develop your OS by running it in a virtual machine, ie use Parallel. That might make the development/test cycle a bit quicker than using a real PC.

I was also wondering what processor/architecture you were thinking of targetting. The thing is, if you were going to put all this effort into a big project then perhaps a little 'gazing into the crystal ball' might let you develop something which could turn into something really big in the future! Multiple cores is the future, so an OS designed from the ground up for 100's of cores might be the way to go. Graphic cards are certainly going this way too. The new NVIDIA cards have something like 256 stream processors which can be programmed in 'C'. How about an OS to run on a gaphics card? I don't know if this could be done but it certainly would be different from yet another OS for PCs.

good luck

b e n



b e n

fimac
Mar 19, 2007, 07:23 AM
Well, call me crazy but I've been thinking about creating my own operating system :eek:

You're not crazy ;) -- The best way to learn is by doing. As others have alluded to, I think the hardest part is actually deciding the scope of your project.

Using a virtual machine is a good idea, since debugging a kernel is a very painful process (you can Google to read about Linus' experiences of this). The virtual machine could even be your own, or something like llvm.

Best of luck to you!

Flynnstone
Mar 19, 2007, 08:11 AM
You may be crazy, I can't comment on that :D
You may want to look at a book by Jean Labrosse. It is how a Real Timer Operating System (RTOS) is designed. His specifically. He can run it under Windows. So this virtualization info would be beneficial. Porting this to run under OS X would be great!
Building an OS to learn is good. Now if you could build something useful and learn, then that is great!

Good Learning.

mags631
Mar 19, 2007, 08:27 AM
Well, call me crazy but I've been thinking about creating my own operating system :eek: Why you may ask? Because I think I'd enjoy the challenge and would gain experience as well as learning a whole lot. I am not talking about a full, fledged graphical OS, obviously. I think it'd be fun to see what I can do, I would like to create it to be able to handle preemptive multitasking, page faults, hardware interrupts, exception, and the like. I have quite a few books on Operating Systems that I would be able to reference. I have taken all of my C++ courses needed for my CIS major and I also know a great deal of x86 Assembly Language and Macros. What do you think, is it even remotely possible to do? The books claim that knowledge of C++, Assembly, and lots of patience is all thats needed. So, what do you guys think, am I insane or is it possible?

Just curious -- on which aspect would you start? Do you have any design goals in mind?

By the way, Stanford's CS240 class provides a list, organized by topic, of various papers (in PDF format) related to OS topics on its web-site: http://www.scs.stanford.edu/06au-cs240/. Might be worth a read.

Please let us know how it progresses!

MrFrankly
Mar 19, 2007, 01:12 PM
Well, call me crazy but I've been thinking about creating my own operating system :eek: Why you may ask? Because I think I'd enjoy the challenge and would gain experience as well as learning a whole lot. I am not talking about a full, fledged graphical OS, obviously. I think it'd be fun to see what I can do, I would like to create it to be able to handle preemptive multitasking, page faults, hardware interrupts, exception, and the like. I have quite a few books on Operating Systems that I would be able to reference. I have taken all of my C++ courses needed for my CIS major and I also know a great deal of x86 Assembly Language and Macros. What do you think, is it even remotely possible to do? The books claim that knowledge of C++, Assembly, and lots of patience is all thats needed. So, what do you guys think, am I insane or is it possible?

I would suggest buying Tanenbaum's book - Operating Systems Design and Implementation. Basically the book describes the basis of operating system design and has a fully fledged implementation of a microkernel operating system with it, in the form of Minix. Best of all, you get the full source code with it.

As some people already suggested try to get a virtualization application to start your development. I'd first try to write the bootblock code, the first block of code your computer starts executing. It's quite satisfying seeing a your message printed on the screen and a good motivation to continue.

slooksterPSV
Mar 19, 2007, 02:41 PM
When I get out of class I will try and find that site where it actually shows you how to program a very small simple OS that you basically can't do anything with, but its a great start.

http://www.groovyweb.uklinux.net/index.php?page_name=how%20to%20write%20your%20own%20os

scan
Mar 19, 2007, 02:50 PM
Well, call me crazy but I've been thinking about creating my own operating system :eek:

I wouldn't call you crazy for that. I'd call you crazy if you think you can complete one by yourself.

psychofreak
Mar 19, 2007, 02:52 PM
I think that the future (partly?) is in web-based computing...maybe try to make a simple web-based OS...

slooksterPSV
Mar 19, 2007, 02:55 PM
http://www.groovyweb.uklinux.net/index.php?page_name=how%20to%20write%20your%20own%20os

psychofreak
Mar 19, 2007, 03:19 PM
http://www.groovyweb.uklinux.net/index.php?page_name=how%20to%20write%20your%20own%20os

A quick explanation of assemblyIs this sarcasm, a joke, or just a plain lie?

Mr. MacBook
Mar 19, 2007, 03:22 PM
Make another one for Mac ;)

ChrisA
Mar 19, 2007, 03:30 PM
...Well, call me crazy but I've been thinking about creating my own operating system....

You'd be better off modifying an existing OS. That's what Linus did. He started with Minux. Doing what you say has been done many times. Typically it requires years of nearly full-time effort. I see only one reason to try this -- that is you think you have some new idea and want to see how well it might work. One new idea might be an OS that could work well on a computer with a very large number of "cores", say like 64 or 128 cores. By the time you are done there may actually be machines like this.

Here are some random ideas....
Perhaps in this new system there is no distinction between "OS" and user level code, only fine gradations of privilege and ownership. Maybe everything is made of filter threads that read some data and write something out and they are designed so if you run 2 copies work goes twice as fast. these threads are considered to be always running (you never start or stop a process in the new OS, they just come to life when input is present) and they scale by demand, a high workload cases them to "clone". Threads find there own free core to run on, no central scheduler. or maybe cores find thread that need to run (kind of like the way RA+1 requests worked in CDC's old OSes.)

Just ideas... my point is if you are going to do this you need a reason and some radcal new OS type that is not just another UNIX clone.

fimac
Mar 19, 2007, 04:08 PM
http://www.groovyweb.uklinux.net/index.php?page_name=how%20to%20write%20your%20own%20os

A small simple OS? IMHO the source examples are simply DOS boot-loaders. But, thank you for the link -- the introduction to assembly language was quite amusing!

Furthermore, that site links to http://www.osdev.org/osfaq2/index.php which looks like a great resource :)

You'd be better off modifying an existing OS. That's what Linus did.

AFAIU that is not true; "Torvalds thus decided to create a new operating system from scratch that was based on both MINIX and UNIX." (Quote from http://www.bellevuelinux.org/linus.html.)

Sean7512
Mar 19, 2007, 05:15 PM
Wow, I am surprised that hardly anyone told me that it is impossible :p Yea, it is obviously going to take a long time to finish, but now that my g/f and I are not together anymore (after 2 and a half years), I should have plenty of free nights to waste away to coding. I grabbed about 5 of my friends from my CS classes that are all willing to get this thing going. There is a lot of planning ahead of us right now, so beginning of coding is a while off. Here is what we all concluded after talking about it for a good 2 hours today...

1. It will (hopefully) be coded specifically for 64 bit, intel processors. All of us have access to computers that are C2D (I'm the only one using a Apple). We also think that the more registers available would be helpful as we probably aren't the most efficient coders around.

2. We want to design it to support multiple CPU's....how many? We are not sure, maybe just 1 core, maybe 100...we are gonna need to look into this in more detail.

3. BASIC TCP/IP as a way to exchange text-based emails, etc.

4. Some form of video card support, none of us are really good at anything graphics wise..but our one teacher gave us a few books after hearing our project.

5. We also hope to be able to utilize, most if not all ports (USB, etc). Not sure how useful this would be as it may be getting a little more advanced for right now.


That is our small list right now. We are all working on researching tonight so we can modify our list....once we all agree on the main details, we will go through the finer facts. Then hopefully we will begin coding. We are learning microprogramming in our OS class right now, and our next topic is machine language...I'm sure that both of these will help us greatly. I will keep you guys posted as more develops.....Probably won't be much to update you guys on until we get a final outline of everything.

Cult Follower
Mar 19, 2007, 09:01 PM
good luck, I don't think I could ever do something like that, I'm not patient enough.

Flynnstone
Mar 19, 2007, 09:28 PM
Creating another Linux would be kind of pointless. You all might lose interest.
Create something new and perhaps useful.
Look at minix, Linux and some RTOS code.
Perhaps build an OS for Objective-C on embedded systems.
Look at multi processor/core ideas.

Especially if you are looking at more than one CPU type - avoid assembler.
Use only when necessary. Keep it separate. Be careful of endianness.
Good Luck

macman2790
Mar 19, 2007, 09:55 PM
well you can create your own linux distro in minutes: http://www.digg.com/linux_unix/Build_your_own_Linux_distro_in_minutes
just kidding, but it does look fun

jhande
Mar 20, 2007, 02:47 AM
Hmm, have you considered going the other way and instead of looking at OS'es, then looking at domain specific languages?

One area I find fascinating is work like Links (http://groups.inf.ed.ac.uk/links/). Now if you could do for that domain what PHP did for (and to) server-side web, *that* would be interesting.

SupadudeX
Mar 20, 2007, 03:48 AM
Go for it dude. Ive always wanted to make one myself. Operating systems really arent that complicated when you cut out all the bloated fat that doesnt belong in the kernel. 85% of the Linux kernel code is drivers. So if you only need to support basic hardware then it is extremely plausible that you could do it. Just make sure you plan the thing out very well before you begin.

Kernow
Mar 20, 2007, 03:58 AM
When I saw the thread title, I couldn't help but think of this legendary thread (http://forums.macrumors.com/showthread.php?t=193893).

Sounds like you are being a bit more realistic though. Good luck with the project :)

twoodcc
Mar 21, 2007, 03:01 PM
i say go for it! and keep us updated on how it goes :)

CaptainZap
Mar 21, 2007, 03:26 PM
When I saw the thread title, I couldn't help but think of this legendary thread (http://forums.macrumors.com/showthread.php?t=193893).

Sounds like you are being a bit more realistic though. Good luck with the project :)

LMAO! That is hilarious.

Oh, and good luck. =]

andy89
Mar 21, 2007, 04:26 PM
When I saw the thread title, I couldn't help but think of this legendary thread (http://forums.macrumors.com/showthread.php?t=193893).

Sounds like you are being a bit more realistic though. Good luck with the project :)

ROFL.

That remind me of one of my freinds. He says hes working as a hacker for a company. He doesn't even know what am IP address is!

Anyway, good luck. I always wanted to write my own OS. My C++ sucks too bad though. (And don't get me started on assembly, that looks freaking evil).

If only you could write an OS in PHP :rolleyes:

*Hint-hint.* (web based OS)

slooksterPSV
Mar 21, 2007, 08:23 PM
I have an idea that you could play around with. What about building an OS but base it off of SDL, basically you make the OS but use SDL and make it in a Mac OS X window and it would even be portable to Windows and Linux. So for the window you set the image for the window, create apps that only the SDL app can run (or make it another piece of the program or that). Hmm... so to do a command prompt you'd just make the window, and on an interval make the cursor blink (interchanging 2 images), when the user presses a key, see which app the user is in and if its a command prompt/terminal like one, send all the key events to the terminal, when you press a letter, the letter shows up and adds itself to a string in the terminal or you could do it like an input like cin or that and move the image, then check to see if its in the bounds, if not move it down a row and start it at the other end, if it extends below the screen, ... you get the point. Since SDL handles mouse events too, this would be an interesting project. Imagine, you could load the SDL_Image Library and have transparencies.

Main point, start with something simple then expand, create this SDL based OS (that works in Mac OS X, Windows, etc.) then move it out, make it to where it runs in fullscreen, then make it an option to load it or the other OS, then make it its own OS.

Teh Don Ditty
Mar 21, 2007, 09:32 PM
I give you (and your friends) a lot of credit for attempting to create an OS. I wish I could do that (Work + Master's In Progress = Barely any free time).

Best of luck to you and your friends! Please keep us in the loop (pun)!

Sean7512
Mar 23, 2007, 04:39 PM
UPDATE:

We have exchanged lots of ideas and had quite a few long discussions. While creating a list for what we hope to include, we stumbled upon a potentially GREAT idea. The idea is how the boot loader is implemented...

The boot loader has been pretty much straight forward since the DOS days with no radical changes to it. Well, we have come up with a new idea that if it works correctly, it could easily cut start-up times in half and if combined with flash memory, could even be "instant-on." We have talked to our teachers about our idea and they all agree that it is a great idea and that it is definitely possible.

Once we get a final list together, we are going to begin with a boot loader and then go from there. We are expecting the boot loader to take a good bit of time to complete. We have set a deadline so that if we can't implement it, we will go about it the traditional way. Once there is anything worth mentioning, I will post it here.

Happy Spring (yeah, a few days late)

wmmk
Mar 23, 2007, 05:07 PM
haha, this brings back wonderful memories of a while back when I attempted to make an OS by typing random C++ codes I found in 'The Idiot's Guide to C++' into the BSD source then making a flash animation that was the GUI. I never got BSD to load the .swf. or boot. or compile. lol. anyways, I got flamed quite a bit, but I totally deserved it. you obviously know what you are doing and have reasonable expectations (my OS was going to be better than windoze and OS X and I was going to save all the starving children in Africa with my billions).

Good luck!

EDIT: must have missed this:
When I saw the thread title, I couldn't help but think of this legendary thread (http://forums.macrumors.com/showthread.php?t=193893).

Sounds like you are being a bit more realistic though. Good luck with the project :)
glad to be legendary!

Sean7512
Mar 28, 2007, 11:57 AM
Coding of the boot loader has begun today. Not much else to update you guys on, stay tuned.....

Teh Don Ditty
Mar 28, 2007, 11:58 AM
Coding of the boot loader has begun today. Not much else to update you guys on, stay tuned.....

Cool. Best of Luck to you.

PS: Your Sig should read - Crosby + Malkin + Staal... Imagine the Possibilities.

Sean7512
Mar 29, 2007, 12:16 PM
Cool. Best of Luck to you.

PS: Your Sig should read - Crosby + Malkin + Staal... Imagine the Possibilities.

Thanks! We've already learned some things that we previously did not know :p

PS, my sig should probably read Staal...I haven't updated it since Malkin fled Russia and at that time everyone thought Staal would stay in junior hockey...I'll add Fleury too

Sean7512
Apr 10, 2007, 07:51 PM
UPDATE:

Well, we finished coding a simple boot loader and it actually works too :D For something soo simple and small, we are extremely happy. From here, we are going to attempt to implement our ideas for a next generation boot loader that has never been implemented before. I'll keep you guys updated as we progress. Hope all is well

twoodcc
Apr 10, 2007, 08:24 PM
UPDATE:

Well, we finished coding a simple boot loader and it actually works too :D For something soo simple and small, we are extremely happy. From here, we are going to attempt to implement our ideas for a next generation boot loader that has never been implemented before. I'll keep you guys updated as we progress. Hope all is well

sounds good! keep up the good work! and keep us updated! :)

Teh Don Ditty
Apr 10, 2007, 08:29 PM
UPDATE:

Well, we finished coding a simple boot loader and it actually works too :D For something soo simple and small, we are extremely happy. From here, we are going to attempt to implement our ideas for a next generation boot loader that has never been implemented before. I'll keep you guys updated as we progress. Hope all is well

Awesome!! Keep up the good work! Good Luck in the playoffs against Ottawa!

GeeYouEye
Apr 10, 2007, 10:09 PM
So what is it that makes your bootloader different from LILO, GRUB, or NTLDR?

SC68Cal
Apr 10, 2007, 11:06 PM
I would recommend joining the Linux Kernel mailing list, if you're looking to get your hands dirty in coding an operating system

EDIT: If you want to stay in Apple territory, join the BSD kernel mailing list or the Darwin list.

aLoC
Apr 11, 2007, 03:37 AM
I implemented most of the modules of an OS as part of my undergrad degree. It's not as difficult as you might assume. Go for it!

The real value that companies like Apple add is not in the core OS functions (task management etc.) but in the graphics libraries that contain a lot of specialized knowledge that would take years to get good at. This is probably why they leveraged BSD for core OS stuff instead of redoing it themselves.

notjustjay
Apr 11, 2007, 11:19 AM
haha, this brings back wonderful memories of a while back when I attempted to make an OS ... [snippety snip] ... glad to be legendary!

Glad to see you're taking it all in stride :) I read your thread, thanks for the link. Take heart in that even if misguided, I see evidence of impressive technical knowledge.

Truth be told, a lot of us were like that when we were younger. The problem is so much has already been done, it's hard to know where a newbie is to start. Today's computers have so many abstraction layers that you can't even really hack around much. And any dream you have of redoing any of the existing software or layers is inevitably met with what you got.

When I was in grades 5-8, I did all kinds of stuff on my Apple ][. Back then, there simply wasn't all that much to know, so even something coming from a 12-year-old had reasonable credibility.

I never wrote an OS, but I did write a (very crude) graphics drawing and presentation program. I needed something to display voltage-time curves for my grade 7 science project (the venerable "Which battery lasts longest?" - Duracell won, by the way). Today, you would simply plot the curves in Excel and use a laptop with PowerPoint sitting beside your display board. Back then, none of that stuff existed (or I certainly didn't have access to it). So I wrote it myself.

I also made headways into a database program (I was going to call it the Personal Filing System, not realizing that name was already in use) and some Star Trek games, because, hey, I was a geek.

In grade 8 I needed to show an animation of how antihistamines work, so again I brought out the Apple ][, started typing

NEW
10 HOME
20 REM HERE WE GO...

And created what I needed. Nowadays, you just fire up Flash.

I remember getting my first C++ compiler (for DOS), and what kind of power that opened you up to. I was the classic cheap student / geek -- if I couldn't afford to buy a piece of software I needed, I tried to figure out if I could build it myself. I had a fairly reasonable clone of Telix going (if a bit slow at anything faster than 9600 baud) for my BBS'ing needs!

I wrote a text-based window manager (like those old DOS programs), just for fun, and I even wrote a presentation/page renderer using a simple markup language I came up with. Nowadays people would just laugh at you because every OS has a window manager and we have all manner of Flash, HTML, XML, etc.

Nowadays I still have trouble setting up a Visual C++ program to do a "Hello World" Windows app.

And then in grade 9, after reading a computer architecture book, I sketched a schematic for a very simple Z80-based computer, which I still intend to build one day. It was so tedious drawing all those address and data lines! :)

All the good stuff has been done! We were born 10 years too late ;)

xUKHCx
Apr 11, 2007, 11:31 AM
I have been subscribed to this thread for ages, really interested to see how this works out. Maybe we can install it in Parallels when done.

Sean7512
Jun 1, 2007, 07:05 PM
UPDATE:

It has been quite some time since I have updated any of you on our project. As I said, we have a functioning boot-loader and now we have a BASIC, but stable kernel. When booted up, the OS is just a plain black screen that says

"<centered> Welcome to O.S Project! </>

Press 1 and <Enter> to open a basic text editor"

That is all so far. The text editor does work and allows you to type up some stuff. Unfortunately saving or opening existing .txt files does not work yet. It is a LONG and TEDIOUS project, but we are moving forward. I can get a screenshot of it running, but it is wayyyy to boring to bother, just black background with white text, haha.

More updates to follow.....

Teh Don Ditty
Jun 1, 2007, 07:08 PM
That's gnarly Sean. I admire you and your team's dedication to the project. Hope all goes well!

Catfish_Man
Jun 2, 2007, 03:37 AM
That's pretty impressive, actually. Nice work :)

x704
Jun 23, 2007, 03:28 PM
What are you going to call it (If you have not already)? I would like to suggest calling it "whatever"... I believe whateveros.com/net/org is open.

"What operating system do you use?"
"Oh, I use whatever."

I could then make a program for whatever called what... or maybe call the programming tools/libs what.

you could put on your résumé that for a large programming project you (and a few others) made whatever.

Hahah, that would be too funny.

/* *** */

What language are you doing it in? C? Objective-C? C++? Assembly?

CoreWeb
Jun 23, 2007, 03:59 PM
Go for it dude. Ive always wanted to make one myself. Operating systems really arent that complicated when you cut out all the bloated fat that doesnt belong in the kernel. 85% of the Linux kernel code is drivers. So if you only need to support basic hardware then it is extremely plausible that you could do it. Just make sure you plan the thing out very well before you begin.

No, operating systems are still pretty complicated (at least, from my perspective). It depends what you mean by an OS, though, I suppose. I tried to write one once. Complicated and tedious.

When I saw the thread title, I couldn't help but think of this legendary thread (http://forums.macrumors.com/showthread.php?t=193893).

Sounds like you are being a bit more realistic though. Good luck with the project :)

I was like that once. Though, I did manage to get somewhere.

haha, this brings back wonderful memories of a while back when I attempted to make an OS by typing random C++ codes I found in 'The Idiot's Guide to C++' into the BSD source then making a flash animation that was the GUI. I never got BSD to load the .swf. or boot. or compile. lol. anyways, I got flamed quite a bit, but I totally deserved it. you obviously know what you are doing and have reasonable expectations (my OS was going to be better than windoze and OS X and I was going to save all the starving children in Africa with my billions).

Good luck!

EDIT: must have missed this:

glad to be legendary!

I glanced at your thread, and it reminded me of myself a few years ago, when I was around 14-16. I wanted to build an operating system. And, I did get somewhere. I managed to use a bootloader (not mine), create a FAT12 driver which would get the first 512 bytes of any file (but I couldn't figure the bugh which made it go to the wrong place for the next 512 bytes out). I tried to make a memory manager, but I wasn't quite able to. I made command-line and GUI variants (256-color, ultra-low resolution GUI, nothing fancy - you could move the mouse and do mouse clicks, and drag around a box on the screen).

I got pretty far, I suppose. I spent probably a total of a month or two on the project, a couple of hours a day.

However, despite the fact that I failed in my creation of the operating system, I am quite proud of this time: I now know a ton more about computers, and have a much better understanding of how programs work. It made me a MUCH better programmer.

I wrote mostly in C. I didn't write much assembly, as I hardly understood it at the time.

GothicChess.Com
Jun 23, 2007, 05:57 PM
The problem with "starting" on building an OS is what I call "painted-yourself-into-a-corner-itis." :) It's easy to get yourself down a path with no forward way out. Then you start "changing" stuff to get yourself out of the corner. Then you're still in the corner, just facing a different way. Then, your're finally out of the corner, until you paint yourself into another corner, and the cycle repeates till you hit more corners than you thought were in the room.

And what you are left with... is Windows! :)

I speak from experience, I worked with a small team to try and build an OS, then the BE OS came out (1993) and shattered our dreams.

I would say, do this:

1. Build an APPLICATION first that has the look and feel of an OS without being the OS.

2. Have it MIRROR your existing hard drive to verify it works. You should be able to open/close windows, select files and apps and get info on them etc.

3. When you are satisfied with what it looks like, start investigating the "hard stuff", and port the functionality of your application into the OS.

And good luck!

Sean7512
Jul 15, 2007, 12:04 AM
Progress Update, AND some questions...

UPDATES:

* Have our OWN file system up and running, it is called VANGO (i think we had too much caffeine that night, as we have no idea why we called it that)
- Vango is EXTREMELY simple
- A sample entry for it would be as follows:
filename.ext 5 2
- This is translated as, the filename starts at block 5 of the disk, and has a run of 2 total blocks
- That is it, very simple...but it works for our purposes, and it works really well (so far)

* Our original notes app that I told you guys about was scratched and remade into a real app....Before, it was part of the O.S. and now an "actual, separate app."
- With VANGO, we now can open and save the files that are made, which really got us excited



IN PROGRESS:

* With a file system, it will need some maintenance apps, such as a defragmenter.....this should be fairly easy since all files stay in one long "run" and are not scattered.

* We are working on a calculator app, but wouldn't it be nice to have both notes AND calculator open at the same time? (since we have no GUI, it would have to be a combination key press to swap apps for now) Therefore, we are going to attempt to add multi-tasking


QUESTIONS:

* Dealing with CPU deadlock....We know what it is, and we also know that we will NEVER have an incident with it...BUT, it would be nice to implement just because it would be nice to say that it has it :p The problem is that, we are unsure how to have the system check for deadlock, and THEN how to deal with it. I'm not asking for computer code, just a simple algorithm to maybe get us in the right direction....

* GUI, this is all text based (think DOS), We really have no idea how to add a GUI...what would be involved with that?


As for some answers to questions above....

1. We are using assembly language for the most part, some of the latter stuff has been C++

2. We have no name for the OS, Whatever would definitely be FUNNY :p


Last thing, the iPhone REALLY slows down development :D

linuxftw
Jul 15, 2007, 12:24 PM
I personally have built my own OS, a simple one ofc.

A common misconception is that OSes take thousands of people to make. They don't.

Before you start. Make sure you know X86 assembly inside out, and I mean inside out. Also make sure you know how to use C inside out, because C is what most kernels are written in.

I also recommend you read the Wikipedia articles on processor modes (Real mode, Unreal mode, Protected mode, and Long mode). As well as the program operating Rings. Other important concepts to know are things like: Global descriptor tables, Interrupt vector tables, Interrupt service routines, Local descriptor tables, etc etc. But im sure you will know all of this if you know enough about assembly.

For the GUI, if you plan to make one. Using an inb and outb type function, note the best way to create these is to use inline assembly with C, you can set your VGA adapter to different modes, and with the way memory mapping is, you can output pixels in the correct places. From what I gather youre VGA adapter is in 80X60 Text mode, right?

Anyway, good luck!

NavyIntel007
Jul 15, 2007, 02:49 PM
God bless, go forward on your endeavor to make an OS. Honestly, I think it be a little waste of time to reinvent the wheel though. There are tons of projects out there that need some good coders (OpenSolaris comes to mind).

Good luck to you but hopefully when you get frustrated with it because of the complexity you'll come help the rest of the world with the wheel they are creating.

savar
Jul 16, 2007, 08:56 AM
QUESTIONS:

* Dealing with CPU deadlock....We know what it is, and we also know that we will NEVER have an incident with it...BUT, it would be nice to implement just because it would be nice to say that it has it :p The problem is that, we are unsure how to have the system check for deadlock, and THEN how to deal with it. I'm not asking for computer code, just a simple algorithm to maybe get us in the right direction....

* GUI, this is all text based (think DOS), We really have no idea how to add a GUI...what would be involved with that?

Deadlock?? That's an unsolved problem. If you figure out a solution you would be a rich person, indeed. Of course I wonder...if you found two threads in a deadlock condition, how would you resolve it anyway?

Microsoft has been working on some AI for quite some time now which can inspect compiled binaries for common flaws like buffer overruns, but I think they are still far away from being able to detect multi-threaded issues.

Sean7512
Jan 1, 2008, 08:05 PM
Its been quite a long time since this thread has seen an update. Development slowed a lot once the semester started. It was hard as I had to worry about my new internship, school, AND hockey (which consumes just about every second away from school). Well, how'd we do? Heres an update:

We took what we had (a text based OS with 2 apps - notes and calc - and the ability to run both at the same time...we also had our own file system so you could save/open .txt files) and we changed it into the same thing, but with a basic GUI :) It looks kind of like ughh, a souped up version of Windows 1.0 :p Work continues slowly, we have looked BACK into a custom boot loader that we originally had planned, so that will probably be next.

The last update, I brought up the issue of Deadlock, and we have wrote an algorithm that will detect deadlock but we are unsure of what to do next. We were thinking of prompting the user that for the system to continue to operate, one process MUST be killed and then give the user the choice of which one. Although, its EXTREMELY unlikely that this would happen in our, simple OS but we're nerds and have fun with it lol

Edit: When I mean deadlock, I mean simple scenarios of deadlock. Such as 2 programs need access to the same file/service in order to finish, but neither can get it because a different program has control of it. Nothing with huge multi-threaded processes that was suggested above

Happy New Years, All!

sord
Jan 1, 2008, 10:01 PM
Screenshots? :D
Congrats on your progress! I can't finish a project for the life of me...

SC68Cal
Jan 1, 2008, 10:21 PM
Post the source somewhere for us to see.

ChrisA
Jan 1, 2008, 10:39 PM
Deadlock?? That's an unsolved problem. If you figure out a solution you would be a rich person, indeed. Of course I wonder...if you found two threads in a deadlock condition, how would you resolve it anyway?


No, not "unsolvered" Lots is known about it. Or at least lots was known about it in the 1970's when I was a CS major.

The best place to handle this is to implement a "lock manager" and force all processes to make requests of the manager.

If a process asks only once for everything it will ever need it can never deadlock. you can detect deadlocks too When a request is made that can not be filled you check for the circular wait condition. When you find this you have to kill a process or tell the requester he has to give back everything he has and start over and in effect make a "first" request.

twoodcc
Jan 2, 2008, 12:55 AM
yeah i would also like to see what you've done. good luck with the rest of it as well :)

iSee
Jan 2, 2008, 10:51 AM
Congrats on your progress!

While I wasn't a nay-sayer on this, I have to admit I was a nay-thinker when you started. It's nice to be proven wrong in a postive way!

Anyway, you definitely need to post code, screen shots or, better yet, a little "distro."

Also a question I'm curious about: Do you use emulators or virtual machines much in development and testing? Or do you load it on to a phyical machine?

Consultant
Jan 2, 2008, 01:38 PM
Screenshots? :D
Congrats on your progress! I can't finish a project for the life of me...

I think they have not made the screenshot app yet.... =p

Sean7512
Jan 2, 2008, 03:48 PM
I think they have not made the screenshot app yet.... =p

HAHA, no we have no way of capturing the screen. I am experimenting now with something to do this. I tried using a digital camera, but its really hard to make out. I'll figure something out relatively soon and will post it here for you guys.

As far as posing source code or something of a little release.....sorry, not yet. As I said before, it is incredibly simple and still isn't very stable. We've never tested this out on a different computer either, so it may not even run on different hardware :eek:

We'll get there, little by little...but look here for screenshots soon, if I have too I can make a mockup in photoshop.

Edit:
iSee: we are running this on a physical machine, no emulators or virtual machines. It sucks because every build we do, we have to re-copy/install it over to the other machine.

sord
Jan 2, 2008, 06:11 PM
Best way to get a picture of a computer is with a camera, tripod, and an LCD (no CRT)

Or - boot your OS in a VM

Masquerade
Jan 3, 2008, 09:05 AM
omg this is a lot of ****! kongratz! beware the interrupts!

sushi
Jan 3, 2008, 09:42 AM
Its been quite a long time since this thread has seen an update.
Kudos for your efforts. It sounds like you are having fun with your project.

IMHO, this is a fantastic way of learning about computers and Operating Systems. Nothing like learning from the ground floor up.

Best to your and your team in 2008! :)

CoreWeb
Jan 3, 2008, 11:03 PM
It sounds like you've done wonderfully! I tried to write an operating system a few years ago. I was about 14-15 years old, but while I didn't manage to get very far, I did manage quite a bit for my situation; I started out with no knowledge of C, C++, or assembler (just VB knowledge). I learned so much...

My so-called OS simply booted up, and then showed VGA graphics on the screen (640x480, 256 color or something like that), and had keyboard and mouse input. The mouse would move a square around on the screen, and it could be used to drag another square around.

I tried to write a FAT12 reader to read the floppy I was using; I put a picture of an exclamation mark as a file on the floppy - it was quite a simple picture, just encoded in bits, I think, with 0s for empty areas and 1s for opaque areas (though I might have used whole bytes...) My FAT12 driver only managed to read the first something (my memory is a little fuzzy, I think it was a sector, 512 bytes) off the disk, before it got jumbled up.

I tried to make a memory manager, but that didn't work out well at all. I think my mind just couldn't think through it properly, so it was constantly getting jumbled.

I think that if I were to try to make an OS again now, I'd fair better; I'm much more experienced, and understand all of the components much better than before.

Anyway, it looks like you've done great, and I'm really happy for you! I'm very impressed.

yeroen
Jan 4, 2008, 12:40 AM
Well, too late now for the OP, but for anyone else considering writing their own OS from scratch, they may want to implement it atop a microkernel like Mach.

The Mac OS X kernel, XNU, itself has a Mach core, although there it isn't a microkernel, rather it's melded with BSD and the IOKit to form a traditional monolithic kernel.

And of course before you begin, don't forget the manner in which the gods repay hubris.

weg
Jan 4, 2008, 07:44 AM
So, what do you guys think, am I insane or is it possible?

I think that barking dogs don't bite. Linus only announced his OS only after he already had a first running version of it.