It has been a long time since I started this project, and even though I am making a good progress at the beginning, my progress was getting slower lately. Today I decided to take a day off from work to finish some remaining task: network driver, automatic memory detection, and flash device support.
Pyun YongHyeon have helped me a lot with the network driver. The speed is still not good, but he have helped to make the network driver to more correct (better, more reliable). I will still need to ask him to check for the final version, but I believe I have fixed most errors he pointed out.
My agestar, which also uses CNS11XX devices comes with 32Mb memory, while the Emprex NSD-100 have 64mb of memory. I have added a code to autodetect the memory size. So one binary file should work on both devices.
The flash device in Emprex NSD-100 complies with CFI, and it was very easy to use with the existing CFI driver. I just need to write several lines of code. The next step is to boot freebsd directly from the flash (with the root filesystem on USB). Unlike in Linux, the flash device can not be accessed as partitions (not yet).
First, we need to write the kernel.bin to cfi0, because the first 132 kb is used by boot loader, we need to skip to somewhere > 132kb. To make it easy, i just skip 1 megabyte from beginning of flash.
dd if=kernel.bin seek=1 bs=1m of=/dev/cfi0
be very very very careful with the dd command. Without correct seek and bs, you may overwrite the bootloader. The command will take quite a long time to finish (3 minutes).
Next step is to set the initial boot command. In the boot loader, setup bootcmd to copy the data in ram to 0x1000000 from 0x10100000, then boot the device:
setenv bootcmd cp.l 0x10100000 0x1000000 0x1a0000\;go 0x1000000
Now when we boot the device, we should go directly to freebsd.
I won’t provide binaries, but the latest source code is in: