Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
HOST_OS = $(shell uname -s)

# Mount point and boot partition
FLASH_DEFAULT_TARGET = chainloader
FLASH_DEFAULT_TARGET = seed
MNT = $(MNT_$(HOST_OS))
MNT_Linux = mnt
MNT_Darwin = /Volumes/boot
Expand Down Expand Up @@ -33,25 +33,25 @@ all: clean buildall
# Remove kernel and build directory
clean:
rm -rf $(BUILD) *.img
$(MAKE) -C chainloader clean
$(MAKE) -C seed clean
$(MAKE) -C thorn clean

# Build the different OSes
build: build-$(BUILD_DEFAULT_TARGET)

buildall: build-chainloader build-thorn
buildall: build-seed build-thorn

build-chainloader:
$(MAKE) -C chainloader build
build-seed:
$(MAKE) -C seed build

build-thorn:
$(MAKE) -C thorn build

# Mount boot partition of SD card onto set mount point to copy image onto it
flash: flash-$(FLASH_DEFAULT_TARGET)

flash-chainloader:
$(MAKE) -C chainloader flash
flash-seed:
$(MAKE) -C seed flash

flash-thorn:
$(MAKE) -C thorn flash
Expand All @@ -64,15 +64,22 @@ setup-serial-Darwin:
cat -v $(SERIAL_PORT) &
stty -f $(SERIAL_PORT) $(BAUD_RATE) raw cs8 -ixoff -cstopb -parenb

resend: reboot build
# reboot and send corresponding image over serial connection
resend: resend-$(SEND_DEFAULT_TARGET)

resend-seed: setup-serial-$(HOST_OS) reboot
sleep 8
$(MAKE) -C seed send

resend-thorn: setup-serial-$(HOST_OS) reboot
sleep 8
$(MAKE) send
$(MAKE) -C thorn send

# send corresponding image over serial connection
send: send-$(SEND_DEFAULT_TARGET)

send-chainloader: setup-serial-$(HOST_OS)
$(MAKE) -C chainloader send
send-seed: setup-serial-$(HOST_OS)
$(MAKE) -C seed send

send-thorn: setup-serial-$(HOST_OS)
$(MAKE) -C thorn send
Expand All @@ -93,8 +100,8 @@ blank:
# Emulate the corresponding kernel on qemu
emulate: emulate-$(EMULATE_DEFAULT_TARGET)

emulate-chainloader:
$(MAKE) -C chainloader emulate
emulate-seed:
$(MAKE) -C seed emulate

emulate-thorn:
$(MAKE) -C thorn emulate
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion chainloader/src/kernel/load.c → seed/src/kernel/load.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ void receive_kernel (void) {
toggle_led (POWER_LED);

for (int i = sizeof (int); i > 0;) {// 4 is size of int
kernel_size_address[--i] = uart_recv ();
unsigned char c = uart_recv();
if (i == sizeof (int) && c == 18) continue; // Ignore first char if reboot signal
kernel_size_address[--i] = c;
}
int length = *(int *) kernel_size_address;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.