Skip to content

GerfautGE/xv6-mars

Repository files navigation

xv6-mars

An attempt to port xv6-riscv to the MilkV mars SBC. As MilkV mars is based on JH7110, xv6-mars may be runnable on VisionFive2 or Star64 SBCs.

Important

This project is still under development.

Features

Feature MilkV Mars specific
SBI timers No
SBI HSM (start) No
RamDisk No
UART Yes (config differs)
Buddy Allocator No
Multilevel Queue Scheduling No
CPU Temperature Sensor Yes

Run

Configuration

You need to configure the kernel to run on the Mars board. Edit config.mk:

PLATFORM = mars

Build

To get xv6 starting on the board, you need to load manually everything. compile the kernel and ramdisk image

make
make fs.img

Tip

Connect to UART to get output:

Pin   GPIO
GND 6
Tx 8
Rx 10

Load

SD card

Copy kernel and fs.img to the mars SD card and then boot the mars.

Then once U-Boot prompt appears:

load mmc 1 ${loadaddr} kernel
load mmc 1 0x49000000 fs.img
bootelf ${loadaddr}

TFTP server

You can setup a DHCP and TFTP server and connect the Mars in the LAN. Then setup U-Boot:

setenv bootcmd='dhcp; tftpboot ${loadaddr} kernel; tftpboot 0x49000000 fs.img; bootelf ${loadaddr};'
saveenv

Debug

You can debug the kernel with GDB via OpenOCD on a JTAG port I found on the board.

JTAG Port Mars GPIO Pin
TMS 35
TRSTN 36
TCK 37
TDI 38
TDO 40

Tip

Load kernel.sym in GDB to get sources