Compare commits

...

4 Commits

Author SHA1 Message Date
Jeremy Soller
4898684e3c
Increase virt ram and image address 2021-01-19 12:29:55 -07:00
Jeremy Soller
85ce01c949
Decrease filesystem size to 48MB 2021-01-19 12:28:54 -07:00
Jeremy Soller
eb3b95460f
Do not copy bootloader, kernel, or relibc to filesystem 2021-01-19 12:28:46 -07:00
Jeremy Soller
e47ba0615d
Build kernel_live for aarch64 2021-01-19 12:13:02 -07:00
5 changed files with 37 additions and 19 deletions

View File

@ -5,15 +5,16 @@ set -ex
MACHINE=virt
U_BOOT="build/u-boot/${MACHINE}.bin"
IMAGE="build/kernel_live.uimage"
case "${MACHINE}" in
raspi3)
U_BOOT_CONFIG=rpi_3_defconfig
LOAD_ADDR=0x00000000
ENTRY_ADDR=0x00001000
IMAGE_ADDR=0x01000000
IMAGE_ADDR=0x04000000
QEMU_ARGS=(
-M raspi3
-device "loader,file=build/kernel.uimage,addr=${IMAGE_ADDR},force-raw=on"
-device "loader,file=${IMAGE},addr=${IMAGE_ADDR},force-raw=on"
-kernel "${U_BOOT}"
-nographic
-serial null
@ -25,12 +26,13 @@ case "${MACHINE}" in
U_BOOT_CONFIG=qemu_arm64_defconfig
LOAD_ADDR=0x40000000
ENTRY_ADDR=0x40001000
IMAGE_ADDR=0x41000000
IMAGE_ADDR=0x44000000
QEMU_ARGS=(
-M virt
-m 1G
-cpu cortex-a57
-bios "${U_BOOT}"
-device "loader,file=build/kernel.uimage,addr=${IMAGE_ADDR},force-raw=on"
-device "loader,file=${IMAGE},addr=${IMAGE_ADDR},force-raw=on"
-nographic
-serial mon:stdio
-s
@ -67,6 +69,7 @@ touch kernel/src/arch/aarch64/init/pre_kstart/early_init.S
make build/kernel
make build/initfs.tag
make build/filesystem.bin
make build/kernel_live
mkimage \
-A arm64 \
@ -76,8 +79,7 @@ mkimage \
-a "${LOAD_ADDR}" \
-e "${ENTRY_ADDR}" \
-n "Redox kernel (qemu AArch64 ${MACHINE})" \
-d build/kernel \
build/kernel.uimage
-d build/kernel_live \
"${IMAGE}"
qemu-system-aarch64 "${QEMU_ARGS[@]}" "$@"

View File

@ -7,7 +7,7 @@ prompt = false
# Package settings
[packages]
drivers = {}
#drivers = {}
init = {}
nulld = {}
#pciids = {}
@ -21,15 +21,21 @@ path="/etc/init.rc"
data="""
export PATH /bin
export TMPDIR /tmp
stdio debug:
echo Post stdio!
nulld
echo Post nulld!
zerod
echo Post zerod!
randd
vesad T T G
stdio display:1
ps2d us
echo Post randd!
# vesad T T G
# ps2d us
ramfs logging
pcid /etc/pcid/initfs.toml
echo Post ramfs!
# pcid /etc/pcid/initfs.toml
redoxfs disk/live: file
echo Post redoxfs!
cd file:
export PATH file:/bin
run.d /etc/init.d

View File

@ -8,7 +8,7 @@ INSTALLER_FLAGS?=--cookbook=cookbook
## Enabled to use binary prefix (much faster)
PREFIX_BINARY?=1
## Filesystem size in MB (256 is the default)
FILESYSTEM_SIZE?=256
FILESYSTEM_SIZE?=48
# Per host variables
UNAME := $(shell uname)

View File

@ -10,11 +10,11 @@ build/filesystem.bin: filesystem.toml build/bootloader build/kernel prefix
redoxfs/target/release/redoxfs $@.partial build/filesystem/
sleep 2
pgrep redoxfs
cp $< build/filesystem/filesystem.toml
cp build/bootloader build/filesystem/bootloader
cp build/kernel build/filesystem/kernel
cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/include build/filesystem/include
cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib build/filesystem/lib
# TODO aarch64: cp $< build/filesystem/filesystem.toml
# TODO aarch64: cp build/bootloader build/filesystem/bootloader
# TODO aarch64: cp build/kernel build/filesystem/kernel
# TODO aarch64: cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/include build/filesystem/include
# TODO aarch64: cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib build/filesystem/lib
$(INSTALLER) -c $< build/filesystem/
sync
-$(FUMOUNT) build/filesystem/ || true

View File

@ -34,10 +34,20 @@ build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o
$(OBJCOPY) --only-keep-debug $@ $@.sym && \
$(OBJCOPY) --strip-debug $@
#TODO: More general use of $(ARCH)
ifeq ($(ARCH),aarch64)
build/live.o: build/filesystem.bin
export PATH="$(PREFIX_PATH):$$PATH" && \
$(OBJCOPY) -I binary -O elf64-littleaarch64 -B aarch64 $< $@ \
--redefine-sym _binary_build_filesystem_bin_start=__live_start \
--redefine-sym _binary_build_filesystem_bin_end=__live_end \
--redefine-sym _binary_build_filesystem_bin_size=__live_size
endif
ifeq ($(ARCH),x86_64)
build/live.o: build/filesystem.bin
#TODO: More general use of $(ARCH)
export PATH="$(PREFIX_PATH):$$PATH" && \
$(OBJCOPY) -I binary -O elf64-x86-64 -B i386:x86-64 $< $@ \
--redefine-sym _binary_build_filesystem_bin_start=__live_start \
--redefine-sym _binary_build_filesystem_bin_end=__live_end \
--redefine-sym _binary_build_filesystem_bin_size=__live_size
endif