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

Unfortunately, with modern hardware a "build an OS" tutorial goes nicely in small steps, until you hit "need a USB stack to get input".

Suddenly you are in the land of voluminous specs and large amounts of code to get anything working.



This is why the fact that Alex Chadwick has written just enough of a USB driver for HIDs is such a useful contribution.


Unrelated to USB, but if would Be great if someone added the recent source release to show 'bare metal' use of the VideoCore services...


I realize this is just one data point, but I implemented a full EHCI (USB 2.0) stack in 3 weekends. Then I implemented a simple mass storage driver in 2 more (that was the hardware I was targeting).

My HID implementation isn't worth talking about but it was helpful to test interrupt transfers.


I'm assuming by the fact that it took you a few weekends, you are beyond the level of learning about OS's as an undergrad, though :) I'm sure it is doable, but the point is probably that it's a non-trivial detour from writing a basic OS.


Yes, of course.

I'm all for teaching as many undergrads as possible about writing an OS - so many valuable lessons that aren't easy to teach in any other context.

Still – there are always a few who really take off. Such might enjoy a tutorial that walked through doing a full USB stack. Maybe... :)

I feel compelled to speak for the over-achievers because they may not even realize they could go so far, so fast, until someone points them in the right direction. It's fun to watch.


That sounds neat. If by chance you ever write a tutorial I'd be all ears! :D


I thought about a tutorial or a step-by-step but EHCI controllers vary widely by platform, and going with the "least common denominator" means doing it for x86... I could never convince myself it was worth a blog post.

Maybe if the RPi becomes a favorite for OS development, I might do it. You could always poke around on http://osdev.org and see if you find some useful stuff there. :)


Some controller better than no controller.

I was allegedly a kernel engineer at one time but never go to do any kind of development work, so this sort of thing intrigues me greatly.

What hardware did you have?


Right, which is FTDI's USB interface chips are so popular. Everyone has used USB-serial but there's also some USB host controllers with MCU-friendly interfaces.


The RPi has a serial port, though it takes a custom cable to hook it up. You can do basic I/O with that, and much more simply than a USB stack.


Yeah, why not just go for a simple UART terminal?




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

Search: