Polish namings and interfaces of linux boot

This commit is contained in:
Zhang Junyang
2023-10-26 11:27:35 +08:00
committed by Tate, Hongliang Tian
parent 33ec7dec02
commit 0a17d90532
6 changed files with 11 additions and 12 deletions

View File

@ -5,7 +5,6 @@ on:
push: push:
branches: branches:
- main - main
- releases/*
jobs: jobs:
test: test:
@ -19,11 +18,11 @@ jobs:
- name: Boot Test (Multiboot) - name: Boot Test (Multiboot)
id: boot_test_mb id: boot_test_mb
run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=dummy ENABLE_KVM=0 BOOT_PROTOCOL=multiboot run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=multiboot
- name: Boot Test (Multiboot2) - name: Boot Test (Multiboot2)
id: boot_test_mb2 id: boot_test_mb2
run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=dummy ENABLE_KVM=0 BOOT_PROTOCOL=multiboot2 run: RUSTFLAGS="-C opt-level=1" make run AUTO_TEST=boot ENABLE_KVM=0 BOOT_PROTOCOL=multiboot2
- name: Syscall Test (Linux Boot Protocol) - name: Syscall Test (Linux Boot Protocol)
id: syscall_test_linux id: syscall_test_linux

2
Cargo.lock generated
View File

@ -650,7 +650,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "jinux-frame-x86-boot-setup" name = "jinux-frame-x86-boot-linux-setup"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"uart_16550", "uart_16550",

View File

@ -1,5 +1,5 @@
# Make arguments and their defaults # Make varaiables and defaults, you should refer to jinux-runner for more details
AUTO_TEST ?= 0 AUTO_TEST ?= none
BOOT_METHOD ?= qemu-grub BOOT_METHOD ?= qemu-grub
BOOT_PROTOCOL ?= multiboot2 BOOT_PROTOCOL ?= multiboot2
BUILD_SYSCALL_TEST ?= 0 BUILD_SYSCALL_TEST ?= 0
@ -9,14 +9,14 @@ GDB_CLIENT ?= 0
GDB_SERVER ?= 0 GDB_SERVER ?= 0
INTEL_TDX ?= 0 INTEL_TDX ?= 0
SKIP_GRUB_MENU ?= 1 SKIP_GRUB_MENU ?= 1
# End of Make arguments # End of setting up Make varaiables
KERNEL_CMDLINE := SHELL="/bin/sh" LOGNAME="root" HOME="/" USER="root" PATH="/bin" init=/usr/bin/busybox -- sh -l KERNEL_CMDLINE := SHELL="/bin/sh" LOGNAME="root" HOME="/" USER="root" PATH="/bin" init=/usr/bin/busybox -- sh -l
ifeq ($(AUTO_TEST), syscall) ifeq ($(AUTO_TEST), syscall)
BUILD_SYSCALL_TEST := 1 BUILD_SYSCALL_TEST := 1
KERNEL_CMDLINE += /opt/syscall_test/run_syscall_test.sh KERNEL_CMDLINE += /opt/syscall_test/run_syscall_test.sh
endif endif
ifeq ($(AUTO_TEST), dummy) ifeq ($(AUTO_TEST), boot)
KERNEL_CMDLINE += -c exit 0 KERNEL_CMDLINE += -c exit 0
endif endif

View File

@ -32,7 +32,7 @@ fn build_linux_setup_header(
let cargo = std::env::var("CARGO").unwrap(); let cargo = std::env::var("CARGO").unwrap();
let mut cmd = std::process::Command::new(cargo); let mut cmd = std::process::Command::new(cargo);
cmd.arg("install").arg("jinux-frame-x86-boot-setup"); cmd.arg("install").arg("jinux-frame-x86-boot-linux-setup");
cmd.arg("--debug"); cmd.arg("--debug");
cmd.arg("--locked"); cmd.arg("--locked");
cmd.arg("--path").arg(setup_crate_dir.to_str().unwrap()); cmd.arg("--path").arg(setup_crate_dir.to_str().unwrap());
@ -51,7 +51,7 @@ fn build_linux_setup_header(
std::io::stdout().write_all(&output.stdout).unwrap(); std::io::stdout().write_all(&output.stdout).unwrap();
std::io::stderr().write_all(&output.stderr).unwrap(); std::io::stderr().write_all(&output.stderr).unwrap();
return Err(format!( return Err(format!(
"Failed to build linux x86 setup header::\n\tcommand `{:?}`\n\treturned {}", "Failed to build linux x86 setup header:\n\tcommand `{:?}`\n\treturned {}",
cmd, output.status cmd, output.status
) )
.into()); .into());

View File

@ -1,5 +1,5 @@
[package] [package]
name = "jinux-frame-x86-boot-setup" name = "jinux-frame-x86-boot-linux-setup"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"

View File

@ -90,7 +90,7 @@ pub fn create_bootdev_image(
let header_path = Path::new(bs_out_dir.into_iter().next().unwrap().unwrap().as_path()) let header_path = Path::new(bs_out_dir.into_iter().next().unwrap().unwrap().as_path())
.join("out") .join("out")
.join("bin") .join("bin")
.join("jinux-frame-x86-boot-setup"); .join("jinux-frame-x86-boot-linux-setup");
// Make the `bzImage`-compatible kernel image and place it in the boot directory. // Make the `bzImage`-compatible kernel image and place it in the boot directory.
let target_path = iso_root.join("boot").join("jinuz"); let target_path = iso_root.join("boot").join("jinuz");
linux_boot::make_bzimage(&target_path, &jinux_path.as_path(), &header_path.as_path()) linux_boot::make_bzimage(&target_path, &jinux_path.as_path(), &header_path.as_path())