LiteBSD Brings 4.4BSD To PIC32

A few years ago [Serge Vakulenko] started the RetroBSD project–a 16-bit port of the old 2.11BSD operating system to the Microchip PIC32 microcontroller. This was impressive, but version 2 of BSD is, to most people, old news and somewhat difficult to use compared to modern BSD and Linux operating systems.

[Serge] has been at it again, however, and now has a port of 4.4BSD–LiteBSD–running on the PIC32MZ. According to [Alexandru Voica] there is about 200K of user space memory in the basic build, and by removing some OS features, you could double or triple that figure.

If you aren’t familiar with BSD, it is the Berkeley Unix derivative. Unlike Linux (which was a rewrite of Unix functionality), BSD forked the original Unix source and added features. Version 4 of BSD adds several key features including TCP/IP networking, and LiteBSD includes an IPV4 stack and an Ethernet driver (a WiFi driver is in the works). You can view a talk about the history of BSD from [Kirk McKusick] (one of the prime people behind BSD) below.

We’ve seen RetroBSD on micros before, but with the 2.11BSD heritage, RetroBSD doesn’t have the potential that LiteBSD does. It is interesting, though, that the driver structure is compatible so that both projects can easily share driver source code. Maybe [Jaromir] will upgrade his laptop.

Thanks [Alexandru Voica] for the tip. PIC32 diagram courtesy Microchip.

13 thoughts on “LiteBSD Brings 4.4BSD To PIC32

    1. ​Please keep us posted. I really like your first version and especially the keyboard. Wish I had one of those for my project. I’m currently trying to use one from a HP Jornada.

  1. This line “there is about 200K of user space memory in the basic build, and by removing some OS features, you could double or triple that figure” is a little bit misleading when compared to the actual statement “Currently about 200 KB of memory is available for the user space, and due to TLB [translation lookaside buffer] and paging support this amount can be doubled or even tripled.”
    The PIC32MZ2048 range of products only has a maximum of 512KiB of RAM and 2MB of flash as shown in the image above. RAM is a lot faster than trashing swap space. If your swap is on flash and you are trashing it heavily, it will not last long.
    https://www.microchip.com/pagehandler/en-us/family/32bit/architecture-pic32mzfamily.html

    It is an impressive project.

      1. Speed is not the issue, it is wear – https://en.wikipedia.org/wiki/Flash_memory#Memory_wear a 2MB MLC with 100K writes for each of 7814 256 byte sized blocks may sound like a lot, but that is one block with a write limit (before failure of) 781 million writes. So if there was an error and you were swap thrashing and writing 100 blocks every second (25KiB/sec), that would be an expected average lifetime of 3 months. 100 blocks per second is a lowball estimate, the reality could be worse.

  2. There are SPI/QSPI SRAM, FRAM, and MRAMs available in capacities up to 4 Mbit. The interface speed is much slower then on-die SRAM. But they would be a good solution for swap.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.