First thing I'll be doing with the RaspberryPi is attempting this tutorial http://www.jamesmolloy.co.uk/t.....index.html, porting to accommodate the ARM chip as I go along...
I thought I'd leave this here for anyone interested in the same :)
How to build an OS
13 posts
- Posts: 125
- Joined: Fri Aug 19, 2011 2:02 pm
Good luck, an OS is one of the most complicated piece of software you can write.
- Moderator
- Posts: 663
- Joined: Fri Jul 29, 2011 5:36 pm
- Location: The unfashionable end of the western spiral arm of the Galaxy
Indeed, that and game engines I believe...?
- Posts: 125
- Joined: Fri Aug 19, 2011 2:02 pm
After an Operating System, building compilers is the next hardest thing you can do, followed by designing a language. So I suggest someone attempt to design a new language, with a new compiler on a custom operating system if they want a real challenge :P
Also slightly more on topic, there is quite a lot you would have to change from that tutorial to make it work for arm. The entire interrupt architecture just for starters.
You might find the osdev wiki ARM category slightly helpful, although it is far from comprehensive
http://wiki.osdev.org/ARM_Overview
Also slightly more on topic, there is quite a lot you would have to change from that tutorial to make it work for arm. The entire interrupt architecture just for starters.
You might find the osdev wiki ARM category slightly helpful, although it is far from comprehensive
http://wiki.osdev.org/ARM_Overview
- Posts: 6
- Joined: Thu Sep 08, 2011 11:35 am
Quote from NimbyDagda on September 15, 2011, 15:16
After an Operating System, building compilers is the next hardest thing you can do, followed by designing a language. So I suggest someone attempt to design a new language, with a new compiler on a custom operating system if they want a real challenge :P
Also slightly more on topic, there is quite a lot you would have to change from that tutorial to make it work for arm. The entire interrupt architecture just for starters.
You might find the osdev wiki ARM category slightly helpful, although it is far from comprehensive
http://wiki.osdev.org/ARM_Overview
I'd say writing a compiler was more complicated than an OS...for the life of me I cannot see how you write an optimising compiler, but I do get most parts of OS design.
- Moderator
- Posts: 6900
- Joined: Sat Jul 30, 2011 7:41 pm
Quote from jamesh on September 15, 2011, 16:09Quote from NimbyDagda on September 15, 2011, 15:16
After an Operating System, building compilers is the next hardest thing you can do, followed by designing a language. So I suggest someone attempt to design a new language, with a new compiler on a custom operating system if they want a real challenge :P
Also slightly more on topic, there is quite a lot you would have to change from that tutorial to make it work for arm. The entire interrupt architecture just for starters.
You might find the osdev wiki ARM category slightly helpful, although it is far from comprehensive
http://wiki.osdev.org/ARM_Overview
I'd say writing a compiler was more complicated than an OS...for the life of me I cannot see how you write an optimising compiler, but I do get most parts of OS design.
Go ask Eben - optimising compilers was what his PhD was about. I don't understand a word of the damn thing.
Hi Nimby, I've taken a read through the osdev stuff and it's great - Pulling off an OS is going to depend on studying the source of the working Linux for RaspberryPi and studying the code that handle the important parts as listed on the OSDev wiki. I only got as far as understanding the architecture of the Spectrum +2A before my schooling was over and guitars/drinking etc took over! I'd like to get back into a position like that again with ARM architecture...
@Eben: GOD! 8-)
@Eben: GOD! 8-)
- Posts: 125
- Joined: Fri Aug 19, 2011 2:02 pm
If you're interested in learning about writing operating systems, you might want to look at Pintos. It's a bare-bones OS that is designed for teaching, so there are several projects that involve adding various features to it, along with test suites to verify they are working correctly (http://www.scs.stanford.edu/10.....intos.html).
It's for x86 systems so it won't run unmodified on Raspberry Pi, but it is a good way to learn about some of the functions an OS provides before attempting to write your own.
It's for x86 systems so it won't run unmodified on Raspberry Pi, but it is a good way to learn about some of the functions an OS provides before attempting to write your own.
- Posts: 6
- Joined: Fri Aug 26, 2011 2:02 pm
Thanks for the link :D
- Posts: 125
- Joined: Fri Aug 19, 2011 2:02 pm
You may want to take a look at RetroBSD 2.11 http://retrobsd.org . It would require work but not as much as starting from the bottom up.
- Posts: 29
- Joined: Sat Sep 17, 2011 3:58 pm
There is a chapter on developing a basic operating system for ARM in:
Sloss, A. et al.
2004 ARM system developer's guide: designing and optimizing system software
San Francisco: Morgan Kaufmann Publishers
See:
http://books.google.com/books/.....KUkDQE17QC
The code for the OS is at http://www.elsevierdirect.com/.....1558608740
Should be a good place to start.
Sloss, A. et al.
2004 ARM system developer's guide: designing and optimizing system software
San Francisco: Morgan Kaufmann Publishers
See:
http://books.google.com/books/.....KUkDQE17QC
The code for the OS is at http://www.elsevierdirect.com/.....1558608740
Should be a good place to start.
- Posts: 5
- Joined: Mon Aug 29, 2011 3:42 pm
I think it depends on what your OS needs to do. In the old days every programmer wanted to build at least once a multitasking tiny OS. There must be thousands of them. Many years ago I wrote mine: tiny program which could just run concurrent tasks and had basic I/O over a serial port. Underlying structure was queues, messages queues, timer queues etc. (I even had calls to hook into queues) Everything was in C except the final task switch code (store-multiple, load multiple) Was that an OS? Maybe, maybe not. But it was fun.
Quote from jamesh on September 15, 2011, 16:09I'd say writing a compiler was more complicated than an OS...for the life of me I cannot see how you write an optimising compiler
A good start is reading Christian Queinnec's "LiSP In Small Pieces" (this covers compiling Lisp to C, which is a good start), followed by Gerald Sussmann's "Structure and Interpretation of Computer Programs" (which covers compiling Scheme to an abstract register machine. Once you've digested that, you might want to get into Appel's "Compiling with Continuations" which starts getting into optimisations. Guy Steele's "lambda papers" are worth a look, too, particularly the stuff on RABBIT.
You're right, though. It's pretty hairy stuff.
- Posts: 1214
- Joined: Sun Sep 11, 2011 2:32 pm