3 ms·
Only when you want to run it on real hardware. Most qemu targets can boot straight from a binary blob or an ELF image (the emulator initializes the emulated har
by reginaldo 14y ago
Only when you want to run it on real hardware. Most qemu targets can boot straight from a binary blob or an ELF image (the emulator initializes the emulated hardware and then sets the PC to the address where the blob is loaded). Those that can't are easily modifiable to do so.
Also, U-Boot can boot a lot of things this days.
So if I were to build an OS for ARM or MIPS I would:
1) Build it on an emulator that can boot from ELF or a binary blob.
2) When it's time to run on real hardware, try to use U-Boot.
3) If that fails, write my own boot loader.
The moral of the story is: bootloaders are not my kind of fun, so I'll avoid writing them at all costs.
- gaius 14y agoRight, but you've presumably already done it once and thus extracted all pedagogical value from it.
- reginaldo 14y agoYes, you're right. For my OS class when I was in school, instead of doing the proposed homework, I convinced the professor to let me do a x86 OS. We were a group of 3. I started doing everything in C with as little as assembly as possible, but the other two decidet to do an all-assembly little monster. At the end of the course, we had only the boot loader and a little command interpreter, aside from FAT-12 support. Then, much later, I messed with OS by playing with the code from the Minix Book [1]. Last year I wrote a little emulator for a virtually unknown architecture that can run uClinux on a modern browser (i.e., Chrome)[2]. [1] Operating System Design and Implemenation: http://www.amazon.com/Operating-Systems-Design-Implementation-3rd/dp/0131429388/ref=sr_1_1?s=books&ie=UTF8&qid=1342719082&sr=1-1&keywords=minix http://www.amazon.com/Operating-Systems-Design-Implementatio... [2] https://github.com/ubercomp/jslm32/ https://github.com/ubercomp/jslm32/