Simple learning-propose OS.

Programming, for all ages and all languages.
Post Reply
mghis
Posts: 17
Joined: Wed Jun 22, 2011 1:52 pm

Simple learning-propose OS.

Post by mghis »

Hi,
I'm looking for a simple operating system. I tried to understand some projects I found in this wiki page (http://wiki.osdev.org/Projects) but I think the OSes listed here are really complex and wide.
I also looked at the sources of ancient UNIX (Sixth and Seventh edition) and the Lions' Commentary to V6. I found them really useful, but they did not satisfied me: since they are for PDP-11 I could not mess on the code or modify it, or even see it running outside of an vm.

Instead of complete and featureful kernels, I'd like to see and understand a simple, basic OS for learning proposes.
I'd like to learn something with:
- Simplest multitasking.
- Example I/O functions: buffered stdio, file I/O (which implies: FS, hd/fd drivers)
- Simple exec() syscall that runs static executables on hdd.
- Shell

Can anyone point me to some code that may enlighten me about the given points?

--mghis

PS: Sorry for my poor English...
User avatar
Thomas
Member
Member
Posts: 281
Joined: Thu Jun 04, 2009 11:12 pm

Re: Simple learning-propose OS.

Post by Thomas »

You might find xv6 interesting and course materials at OCW . See : http://pdos.csail.mit.edu/6.828/xv6/

--Thomas
mghis
Posts: 17
Joined: Wed Jun 22, 2011 1:52 pm

Re: Simple learning-propose OS.

Post by mghis »

Thomas wrote:You might find xv6 interesting and course materials at OCW . See : http://pdos.csail.mit.edu/6.828/xv6/
A Sixth Edition x86 port? Fascinating! Thanks a lot, I'll read that.

I compiled it. It panic()s. I don't understand why...
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Re: Simple learning-propose OS.

Post by piranha »

Works fine for me. Are you cross compiling it? Are you sure you're not compiling 64bit versions of the files?

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
mghis
Posts: 17
Joined: Wed Jun 22, 2011 1:52 pm

Re: Simple learning-propose OS.

Post by mghis »

piranha wrote:Works fine for me. Are you cross compiling it? Are you sure you're not compiling 64bit versions of the files?

-JL
I compiled it with the standard Makefile and gcc 4.6.1. I'm on a 32bit linux system and I'm not cross compiling the kernel.
mghis
Posts: 17
Joined: Wed Jun 22, 2011 1:52 pm

Re: Simple learning-propose OS.

Post by mghis »

I tried the version on the GIT repository, that works fine (after tweaking the makefile to get -Werror out from CFLAGS). It seems very interesting. Although there are a lot of differences between Sixth Edition and xv6 sources, it is really promising!

Faithfully awaiting for further suggestions...
bonch
Member
Member
Posts: 52
Joined: Thu Aug 18, 2011 11:19 pm

Re: Simple learning-propose OS.

Post by bonch »

I'm in the same position as you. Xv6 looks like a fantastic resource. Wish I could take the course.

I'm thinking about biting the bullet and shelling out $130 for Operating Systems: Design and Implementation by Andrew Tanenbaum.
User avatar
Thomas
Member
Member
Posts: 281
Joined: Thu Jun 04, 2009 11:12 pm

Re: Simple learning-propose OS.

Post by Thomas »

Hi mghis and bonch ,

Sorry for late response, has been busy lately. I would you guys to read the minix source code , or even XINU ( http://www.cs.purdue.edu/homes/dec/xsoft.html ) - You can keep your 130$ with yourself. Reading the source code is a good to have skill -- I am a maintenance software engineer my profession. It requires patience , but with perseverance you will understand it finally.I do read plenty of source code daily .

--Thomas
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Simple learning-propose OS.

Post by bluemoon »

You want a simple, basic OS, at the same time you want:
- Simplest multitasking.
- Example I/O functions: buffered stdio, file I/O (which implies: FS, hd/fd drivers)
- Simple exec() syscall that runs static executables on hdd.
- Shell

Hell no, the above four items implies a lot of features behind the scene, and thus not simple for learning.

- Minimal Multitasking requires memory management(either shared space or virtual space), and you'll soon find it boring without IPC.
- I/O function requires you have some sort of VFS, driver interface, and drivers
- syscall on its own is a non-trival design to separate kernel and user-land, and it is not easy to understand "the why" just by staring at code.
- exec() requires mature task/address space/resource management and probably some sort of libc.
- then, what you expect with shell? it can be as simple as a silly chat-bot or as complex as being able to cross-compile bash...

My recommendation is to read all the items listed on the osdev wiki, I read every single page too and think it is too valuable.
Just don't jump into code directly. It doesn't help learning by just modifying some sample code.
bitshifter
Member
Member
Posts: 50
Joined: Sun Sep 20, 2009 4:03 pm

Re: Simple learning-propose OS.

Post by bitshifter »

My 512 byte OS demo almost does all that :)
http://forum.osdev.org/viewtopic.php?f=2&t=23696
Of course it is meant as coding example and is extremely slow
because of IPC server routing and no yielding etc...
Post Reply