Page 1 of 1

Simple learning-propose OS.

Posted: Sun Sep 25, 2011 12:19 pm
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...

Re: Simple learning-propose OS.

Posted: Sun Sep 25, 2011 12:46 pm
by Thomas
You might find xv6 interesting and course materials at OCW . See : http://pdos.csail.mit.edu/6.828/xv6/

--Thomas

Re: Simple learning-propose OS.

Posted: Sun Sep 25, 2011 12:57 pm
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...

Re: Simple learning-propose OS.

Posted: Sun Sep 25, 2011 4:57 pm
by piranha
Works fine for me. Are you cross compiling it? Are you sure you're not compiling 64bit versions of the files?

-JL

Re: Simple learning-propose OS.

Posted: Mon Sep 26, 2011 7:14 am
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.

Re: Simple learning-propose OS.

Posted: Fri Sep 30, 2011 12:53 pm
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...

Re: Simple learning-propose OS.

Posted: Wed Oct 05, 2011 2:59 am
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.

Re: Simple learning-propose OS.

Posted: Wed Oct 26, 2011 8:37 am
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

Re: Simple learning-propose OS.

Posted: Wed Oct 26, 2011 9:37 am
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.

Re: Simple learning-propose OS.

Posted: Thu Nov 10, 2011 1:52 am
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...