Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Sean7512

macrumors 6502a
Original poster
Jun 8, 2005
856
41
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

macrumors newbie
Jun 25, 2007
10
0
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

macrumors 65816
Nov 24, 2002
1,081
0
Tampa, FL
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

macrumors 68000
Jun 6, 2003
1,950
0
District of Columbia
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

macrumors 6502a
Original poster
Jun 8, 2005
856
41
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

macrumors 6502
Jun 16, 2004
352
0
Screenshots? :D
Congrats on your progress! I can't finish a project for the life of me...
 

ChrisA

macrumors G5
Jan 5, 2006
12,914
2,164
Redondo Beach, California
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.
 

iSee

macrumors 68040
Oct 25, 2004
3,540
272
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?
 

Sean7512

macrumors 6502a
Original poster
Jun 8, 2005
856
41
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

macrumors 6502
Jun 16, 2004
352
0
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
 

sushi

Moderator emeritus
Jul 19, 2002
15,639
3
キャンプスワ&#
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

macrumors 6502
Mar 2, 2007
456
0
Edge of reason
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

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.