Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am a graduate student, currently working on building a x86_64 unix like preemptive kernel from scratch, as part of a course. Most of the OS dev guides and books focus on 32 bit arch and I haven't found a single guide so far that is based on 64 bit arch. Since this this guide seems to be in its inception, I hope someone (hopefully me) will send a pull request for a 64 bit tutorial.

Building an OS has been in my bucket list for long and it has been one heck of an experience so far.

Here are some good step-by-step OS-from-scratch programming guides

http://jamesmolloy.co.uk/tutorial_html/index.html

http://www.osdever.net/bkerndev/Docs/title.htm

http://www.ijack.org.uk/

http://www.brokenthorn.com/Resources/OSDevIndex.html

http://viralpatel.net/taj/operating-system-tutorial.php

and here's a good wiki for reference

http://wiki.osdev.org/Expanded_Main_Page



I think that AMD Developer Guides & Manuals [1] are very good resources for x86_64 System Programming (better than Intel Manuals). They are better explained and focus on x86_64 arch.

[1]: http://developer.amd.com/resources/documentation-articles/de...


I still have a soft spot for the intel manuals.. probably because I managed to get print copies right before they stopped giving them out :)


There's absolutely a void when it comes to a full amd64 assembly (and associated low level) code. It's a shame, because amd64 is actually rather plesant (as opposed to x86) -- and now rather ubiqutous.

I haven't really looked at the code, but I guess the following at least contains a bit of example code:

http://www.returninfinity.com/baremetal.html

Menuetos also looks rather interesting, unfortunately, as I recall the license for the 64bit version puts the code in a bit of a limbo as far how it's actually useful. There's a fork, but not for amd64 afaik..

http://menuetos.net/

http://kolibrios.org/en/


My hobby OS is x86_64 only, straight C. It's GPLv3. I wrote it with the intention of writing a tutorial, partly because of this void, but still have not written the tutorial :)

https://github.com/nwg/nanos

x86_64 bootup / structures

https://github.com/nwg/nanos/blob/master/src/boot.asm

https://github.com/nwg/nanos/blob/master/src/kernel_init.asm


Building OS' is fun. I wish I could spend all day doing it but I've been pushed so far up the stack that I spend most of the time arguing with analysts and preparing documentation...

I've built two so far which were (and I think still were until recently) used in production equipment. One Forth system (all 8k of it) that ran a PLC system and a tiny (16k) kernel for an M68k system that was a router for a modbus-like protocol over RS485.

Nothing x86_64 but nevertheless the most fun I've ever had with a computer.


I've been a web developer my entire professional career, and for some ungodly reason I have this need to go work in the embedded sector instead. Am I nuts? ;)


Not at all!


Could you provide some pointers? I'm kinda in the same situation.


You really need an EE or CompSci degree these days. That's the first point of call.

I don't have either but it was a little different when I started. I managed to build a reputation up on the side and go from there. Eventually people stop asking about qualifications.

EE is probably more important than a comp sci education for embedded work. Its a fairly complicated field which deals with things far below the abstraction of a machine.

If anyone mentions the word Arduino though, stop listening there and find someone else. They're assumed to be like the real world but are faaaar from it.


I think that was pretty bad advice. If someone wants to start doing embedded you tell them to go get a CompSci degree (i.e. studying algorithms and logic).

And disrespecting Arduino like that does not seem good either. Doing Arduino will actually teach you about both microcontrollers and electronics and there's a lot of nice modules available. Of course it is not like writing your own OS but it's a start, and you can always use the hardware and ignore the Arduino software.

The best way to get started in embedded is to begin on a project where you actually build something that you want to build. That will help you with requirements on the platform you choose, be it Arduino, Raspberry Pi, FPGA or whatever.


I disagree. CompSci is mainly userland.

Most EE courses these days have the majority of a comp sci course built in. MIT actually blur the line between both. Pure comp sci will not help you understand why your RS485 bus drops have noise, why your serial wont sync and how to get stuff off an SPI bus by bit banging. It's all analogue at the bottom of the stack as well which is why embedded systems people still have scopes on their benches.

Comp sci only people shit a brick when you lug the scope onto the bench and crack out the probes.

The Arduino teaches you to do so many things wrong that its almost dangerous and requires a lot of unlearning. Build an AVR programmer and use gcc fine but lose all the arduino crap over the top and gain JTAG debugging, single step, more memory (!), full IRQ control, timers etc that aren't under a layer of crud. Oh an ISR that runs in under an hour as well, CMT. I could go on for a week.

For ref, you won't find a job writing software for or using an Arduino or a Pi either. FPGA yes, ARM SoC yes, AVR maybe, PIC maybe, x86/PC104 yes.


You misunderstood me completely. I was not saying one should study CompSci, that was you (even though you said EE was preferable).

I was merely saying that for someone wanting to _start_ doing embedded work saying "go get a ___ degree" is certainly not a very helpful answer.

I'm an EE doing both embedded HW (FPGA/ASIC) and SW for a living. I still have no problem saying to a beginner that they can play around with Arduino to get a feel for things.


There's some stuff about 64 bit over at http://xomb.org




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: