←back to thread

305 points AlexeyBrin | 10 comments | | HN request time: 0.662s | source | bottom
1. boricj ◴[] No.44404734[source]
That reminds me of a three week, three person group project I had back when I was in university. There were a couple of topics we could pick from, including writing a very simple operating system from scratch. I asked the professors if we could instead port MINIX3 to the Raspberry Pi (given that it already had an ARM port to the BeagleBoard) and they accepted.

What was supposed to be a reasonably straightforward project proved to be a huge challenge as we encountered numerous unforeseen technical difficulties. One particularly harrowing one was that the Raspberry Pi 3 booted into hypervisor mode instead of supervisor mode and QEMU's Raspberry Pi emulation accuracy was so abysmal back then to be borderline useless for osdev. I recall it took me an entire week of low-level hardware debugging just to figure that one out.

By the end, we pulled through and delivered a working port with UART, GPIO and framebuffer drivers that could run on the Raspberry Pi 2 and 3. We run our presentation with the port on real hardware, using a shell script that displayed bitmaps from the ramdisk and monitored GPIO pins to move slides forwards or backwards (I used a knife to short-circuit the pins as needed). It was by far the coolest presentation of all the groups just on originality alone and I think I still have the image of that SD card somewhere.

replies(4): >>44405147 #>>44405897 #>>44407703 #>>44411489 #
2. ◴[] No.44405147[source]
3. rustybolt ◴[] No.44405897[source]
Nice.

> I asked the professors if we could instead port MINIX3 to the Raspberry Pi

I think they were expecting you to fail.

> QEMU's Raspberry Pi emulation accuracy was so abysmal

When I did some hobby OS dev my strategy was to make it work on QEMU and then pray it would work on real hardware as well, which worked OK...

How did you handle the debugging the raspberry pi on real hardware?

replies(1): >>44406591 #
4. boricj ◴[] No.44406591[source]
> I think they were expecting you to fail.

Maybe, but I already had a reputation of being the dark wizard back then. If anything, the other students in my group went along with this because they knew I could overcome any problem... regardless of the cost on my sanity.

> How did you handle the debugging the raspberry pi on real hardware?

Painfully through serial output. I didn't have access to a JTAG probe at the time (I'm not even sure the Raspberry Pi could be debugged that way) and documentation was exceedingly poor.

After that experience, I refuse to debug anything hardware-related without at the very least a GDB stub.

replies(2): >>44408365 #>>44410064 #
5. accrual ◴[] No.44407703[source]
> I used a knife to short-circuit the pins as needed

Reminds me of shorting the two power-on pins on an ATX motherboard to start it without a switch installed. Obviously, your setup was far cooler. Nice work.

replies(1): >>44410740 #
6. userbinator ◴[] No.44408365{3}[source]
and documentation was exceedingly poor.

This is Broadcom we're talking about, where that's par for the course. Personally I'd choose a SoC from AllWinner or Rockchip or even Mediatek over them.

7. duskwuff ◴[] No.44410064{3}[source]
> I didn't have access to a JTAG probe at the time (I'm not even sure the Raspberry Pi could be debugged that way)

The BCM2835-based ones can - I don't know about the modern ones - but you have to change the configuration on a couple of GPIOs to make it show up. (Which makes it difficult to debug early startup, unfortunately.)

8. ForOldHack ◴[] No.44410740[source]
That lasted a few months for me, until I found a box of the front panel connectors, and I taped together a power/reset and speaker connector. ( I made two, one to use, and one as a spare... ) after not being used for 6 months, It got tossed... of course, only to be needed a few years later for fixing a intermittent motherboard.
9. fithisux ◴[] No.44411489[source]
I don't understand why Minix3 is not developed any more. I thought with Risc-V it would see a renewed interest.
replies(1): >>44412520 #
10. boricj ◴[] No.44412520[source]
I've ranted previously on that topic [1] [2] [3], but as a former contributor MINIX3 in my opinion is a technological dead-end that ran out of steam.

[1] https://news.ycombinator.com/item?id=41673634

[2] https://news.ycombinator.com/item?id=40762110

[3] https://news.ycombinator.com/item?id=34916261