Improve installation process
`meson.build` rewritten with DRY principle. `deploy.sh` added, which deploys the image on a installation USB stick borrowed from another project. Image name aligned with the installer's expectations.
This commit is contained in:
@@ -18,19 +18,19 @@ meson compile -v -C build
|
|||||||
sector_size=512
|
sector_size=512
|
||||||
partition_offset=2048
|
partition_offset=2048
|
||||||
|
|
||||||
dd if=/dev/zero of=build/os.img bs="${sector_size}" count="$((partition_offset + 20480))"
|
dd if=/dev/zero of=build/os.raw bs="${sector_size}" count="$((partition_offset + 20480))"
|
||||||
dd if=build/mbr.bin of=build/os.img bs="${sector_size}" count=1 conv=notrunc
|
dd if=build/mbr.bin of=build/os.raw bs="${sector_size}" count=1 conv=notrunc
|
||||||
dd if=build/bootloader.bin of=build/os.img bs="${sector_size}" seek=1 count="$((partition_offset - 1))" conv=notrunc
|
dd if=build/bootloader.bin of=build/os.raw bs="${sector_size}" seek=1 count="$((partition_offset - 1))" conv=notrunc
|
||||||
mkfs.fat -F 16 --offset "${partition_offset}" build/os.img
|
mkfs.fat -F 16 --offset "${partition_offset}" build/os.raw
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" -s src ::src
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" -s src ::src
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" build/kernel.bin ::kernel.bin
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" build/kernel.bin ::kernel.bin
|
||||||
mmd -i build/os.img@@"$((partition_offset * sector_size))" ::bin
|
mmd -i build/os.raw@@"$((partition_offset * sector_size))" ::bin
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" build/terminal ::bin/terminal
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" build/terminal ::bin/terminal
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" build/shell ::bin/shell
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" build/shell ::bin/shell
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" build/echo ::bin/echo
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" build/echo ::bin/echo
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" build/ls ::bin/ls
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" build/ls ::bin/ls
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" build/cat ::bin/cat
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" build/cat ::bin/cat
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" build/cp ::bin/cp
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" build/cp ::bin/cp
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" build/mkdir ::bin/mkdir
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" build/mkdir ::bin/mkdir
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" build/rm ::bin/rm
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" build/rm ::bin/rm
|
||||||
mcopy -i build/os.img@@"$((partition_offset * sector_size))" build/wc ::bin/wc
|
mcopy -i build/os.raw@@"$((partition_offset * sector_size))" build/wc ::bin/wc
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
device=${1:-}
|
||||||
|
if [[ ! -b ${device} ]]; then
|
||||||
|
echo "ERROR: \"${device}\" is not a block device" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f build/os.raw ]]; then
|
||||||
|
echo "ERROR: \"build/os.raw\" does not appear to be built, run \"build.sh\"" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 'Copying the image...' >&2
|
||||||
|
mnt=$(mktemp --directory)
|
||||||
|
mount "${device}2" "${mnt}"
|
||||||
|
cp --update "build/os.raw" "${mnt}"
|
||||||
|
umount "${mnt}"
|
||||||
|
rm -rf "${mnt}"
|
||||||
|
echo 'Done.' >&2
|
||||||
+52
-352
@@ -92,20 +92,25 @@ kernel_sources = files([
|
|||||||
'src/kernel/xhci.c',
|
'src/kernel/xhci.c',
|
||||||
])
|
])
|
||||||
|
|
||||||
|
c_args = [
|
||||||
|
'-ffreestanding',
|
||||||
|
'-nostdlib',
|
||||||
|
'-nostartfiles',
|
||||||
|
'-mno-red-zone',
|
||||||
|
'-mgeneral-regs-only',
|
||||||
|
'-fno-stack-protector',
|
||||||
|
'-DVERSION="' + meson.project_version() + '"',
|
||||||
|
]
|
||||||
|
|
||||||
kernel_elf = executable(
|
kernel_elf = executable(
|
||||||
'kernel.elf',
|
'kernel.elf',
|
||||||
sources: [kernel_entry_o, timer_o, process_o, syscall_o, lib_sources, kernel_sources],
|
sources: [kernel_entry_o, timer_o, process_o, syscall_o, lib_sources, kernel_sources],
|
||||||
c_args: [
|
c_args: [
|
||||||
'-ffreestanding',
|
c_args,
|
||||||
'-nostdlib',
|
|
||||||
'-nostartfiles',
|
|
||||||
'-mno-red-zone',
|
|
||||||
'-mgeneral-regs-only',
|
|
||||||
'-mcmodel=kernel',
|
'-mcmodel=kernel',
|
||||||
'-Wno-unused-command-line-argument',
|
'-Wno-unused-command-line-argument',
|
||||||
'-Wconversion',
|
'-Wconversion',
|
||||||
'-DKERNEL="yes"',
|
'-DKERNEL="yes"',
|
||||||
'-DVERSION="' + meson.project_version() + '"',
|
|
||||||
],
|
],
|
||||||
link_args: [
|
link_args: [
|
||||||
'-T', meson.project_source_root() / 'src/kernel/linker.ld',
|
'-T', meson.project_source_root() / 'src/kernel/linker.ld',
|
||||||
@@ -122,353 +127,48 @@ custom_target(
|
|||||||
build_by_default: true,
|
build_by_default: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
terminal_start = custom_target(
|
foreach app : ['terminal', 'shell', 'echo', 'ls', 'cat', 'cp', 'mkdir', 'rm', 'wc']
|
||||||
'terminal_start',
|
start = custom_target(
|
||||||
input: 'src/user/start.asm',
|
f'@app@_start',
|
||||||
output: 'terminal_start.o',
|
input: 'src/user/start.asm',
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
output: f'@app@_start.o',
|
||||||
)
|
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
||||||
|
)
|
||||||
|
|
||||||
terminal_syscall = custom_target(
|
syscall = custom_target(
|
||||||
'terminal_syscall',
|
f'@app@_syscall',
|
||||||
input: 'src/user/syscall.asm',
|
input: 'src/user/syscall.asm',
|
||||||
output: 'terminal_syscall.o',
|
output: f'@app@_syscall.o',
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
||||||
)
|
)
|
||||||
|
|
||||||
terminal_elf = executable(
|
elf = executable(
|
||||||
'terminal.elf',
|
f'@app@.elf',
|
||||||
sources: [terminal_start, terminal_syscall, lib_sources, 'src/user/app/terminal/terminal.c'],
|
sources: [start, syscall, lib_sources, f'src/user/app/@app@/@app@.c'],
|
||||||
c_args: [
|
c_args: [
|
||||||
'-ffreestanding',
|
c_args,
|
||||||
'-nostdlib',
|
'-mcmodel=large',
|
||||||
'-fno-stack-protector',
|
],
|
||||||
'-mcmodel=large',
|
link_args: [
|
||||||
'-DVERSION="' + meson.project_version() + '"',
|
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
||||||
],
|
'-nostdlib',
|
||||||
link_args: [
|
],
|
||||||
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
link_depends: 'src/user/linker.ld',
|
||||||
'-nostdlib',
|
)
|
||||||
],
|
|
||||||
link_depends: 'src/user/linker.ld',
|
|
||||||
)
|
|
||||||
|
|
||||||
custom_target(
|
elf_data = custom_target(
|
||||||
'terminal',
|
f'@app@_data.elf',
|
||||||
input: terminal_elf,
|
input: elf,
|
||||||
output: 'terminal',
|
output: f'@app@_data.elf',
|
||||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
command: ['objcopy', '--set-section-flags', '.data=alloc,load,contents', '@INPUT@', '@OUTPUT@'],
|
||||||
build_by_default: true,
|
build_by_default: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
shell_start = custom_target(
|
custom_target(
|
||||||
'shell_start',
|
app,
|
||||||
input: 'src/user/start.asm',
|
input: elf_data,
|
||||||
output: 'shell_start.o',
|
output: app,
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
||||||
)
|
build_by_default: true,
|
||||||
|
)
|
||||||
shell_syscall = custom_target(
|
endforeach
|
||||||
'shell_syscall',
|
|
||||||
input: 'src/user/syscall.asm',
|
|
||||||
output: 'shell_syscall.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
shell_elf = executable(
|
|
||||||
'shell.elf',
|
|
||||||
sources: [shell_start, shell_syscall, lib_sources, 'src/user/app/shell/shell.c'],
|
|
||||||
c_args: [
|
|
||||||
'-ffreestanding',
|
|
||||||
'-nostdlib',
|
|
||||||
'-fno-stack-protector',
|
|
||||||
'-mcmodel=large',
|
|
||||||
'-DVERSION="' + meson.project_version() + '"',
|
|
||||||
],
|
|
||||||
link_args: [
|
|
||||||
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
|
||||||
'-nostdlib',
|
|
||||||
],
|
|
||||||
link_depends: 'src/user/linker.ld',
|
|
||||||
)
|
|
||||||
|
|
||||||
custom_target(
|
|
||||||
'shell',
|
|
||||||
input: shell_elf,
|
|
||||||
output: 'shell',
|
|
||||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
|
||||||
build_by_default: true,
|
|
||||||
)
|
|
||||||
|
|
||||||
echo_start = custom_target(
|
|
||||||
'echo_start',
|
|
||||||
input: 'src/user/start.asm',
|
|
||||||
output: 'echo_start.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
echo_syscall = custom_target(
|
|
||||||
'echo_syscall',
|
|
||||||
input: 'src/user/syscall.asm',
|
|
||||||
output: 'echo_syscall.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
echo_elf = executable(
|
|
||||||
'echo.elf',
|
|
||||||
sources: [echo_start, echo_syscall, lib_sources, 'src/user/app/echo/echo.c'],
|
|
||||||
c_args: [
|
|
||||||
'-ffreestanding',
|
|
||||||
'-nostdlib',
|
|
||||||
'-fno-stack-protector',
|
|
||||||
'-mcmodel=large',
|
|
||||||
'-DVERSION="' + meson.project_version() + '"',
|
|
||||||
],
|
|
||||||
link_args: [
|
|
||||||
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
|
||||||
'-nostdlib',
|
|
||||||
],
|
|
||||||
link_depends: 'src/user/linker.ld',
|
|
||||||
)
|
|
||||||
|
|
||||||
custom_target(
|
|
||||||
'echo',
|
|
||||||
input: echo_elf,
|
|
||||||
output: 'echo',
|
|
||||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
|
||||||
build_by_default: true,
|
|
||||||
)
|
|
||||||
|
|
||||||
ls_start = custom_target(
|
|
||||||
'ls_start',
|
|
||||||
input: 'src/user/start.asm',
|
|
||||||
output: 'ls_start.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
ls_syscall = custom_target(
|
|
||||||
'ls_syscall',
|
|
||||||
input: 'src/user/syscall.asm',
|
|
||||||
output: 'ls_syscall.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
ls_elf = executable(
|
|
||||||
'ls.elf',
|
|
||||||
sources: [ls_start, ls_syscall, lib_sources, 'src/user/app/ls/ls.c'],
|
|
||||||
c_args: [
|
|
||||||
'-ffreestanding',
|
|
||||||
'-nostdlib',
|
|
||||||
'-fno-stack-protector',
|
|
||||||
'-mcmodel=large',
|
|
||||||
'-DVERSION="' + meson.project_version() + '"',
|
|
||||||
],
|
|
||||||
link_args: [
|
|
||||||
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
|
||||||
'-nostdlib',
|
|
||||||
],
|
|
||||||
link_depends: 'src/user/linker.ld',
|
|
||||||
)
|
|
||||||
|
|
||||||
custom_target(
|
|
||||||
'ls',
|
|
||||||
input: ls_elf,
|
|
||||||
output: 'ls',
|
|
||||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
|
||||||
build_by_default: true,
|
|
||||||
)
|
|
||||||
|
|
||||||
cat_start = custom_target(
|
|
||||||
'cat_start',
|
|
||||||
input: 'src/user/start.asm',
|
|
||||||
output: 'cat_start.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
cat_syscall = custom_target(
|
|
||||||
'cat_syscall',
|
|
||||||
input: 'src/user/syscall.asm',
|
|
||||||
output: 'cat_syscall.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
cat_elf = executable(
|
|
||||||
'cat.elf',
|
|
||||||
sources: [cat_start, cat_syscall, lib_sources, 'src/user/app/cat/cat.c'],
|
|
||||||
c_args: [
|
|
||||||
'-ffreestanding',
|
|
||||||
'-nostdlib',
|
|
||||||
'-fno-stack-protector',
|
|
||||||
'-mcmodel=large',
|
|
||||||
'-DVERSION="' + meson.project_version() + '"',
|
|
||||||
],
|
|
||||||
link_args: [
|
|
||||||
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
|
||||||
'-nostdlib',
|
|
||||||
],
|
|
||||||
link_depends: 'src/user/linker.ld',
|
|
||||||
)
|
|
||||||
|
|
||||||
custom_target(
|
|
||||||
'cat',
|
|
||||||
input: cat_elf,
|
|
||||||
output: 'cat',
|
|
||||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
|
||||||
build_by_default: true,
|
|
||||||
)
|
|
||||||
|
|
||||||
cp_start = custom_target(
|
|
||||||
'cp_start',
|
|
||||||
input: 'src/user/start.asm',
|
|
||||||
output: 'cp_start.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
cp_syscall = custom_target(
|
|
||||||
'cp_syscall',
|
|
||||||
input: 'src/user/syscall.asm',
|
|
||||||
output: 'cp_syscall.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
cp_elf = executable(
|
|
||||||
'cp.elf',
|
|
||||||
sources: [cp_start, cp_syscall, lib_sources, 'src/user/app/cp/cp.c'],
|
|
||||||
c_args: [
|
|
||||||
'-ffreestanding',
|
|
||||||
'-nostdlib',
|
|
||||||
'-fno-stack-protector',
|
|
||||||
'-mcmodel=large',
|
|
||||||
'-DVERSION="' + meson.project_version() + '"',
|
|
||||||
],
|
|
||||||
link_args: [
|
|
||||||
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
|
||||||
'-nostdlib',
|
|
||||||
],
|
|
||||||
link_depends: 'src/user/linker.ld',
|
|
||||||
)
|
|
||||||
|
|
||||||
custom_target(
|
|
||||||
'cp',
|
|
||||||
input: cp_elf,
|
|
||||||
output: 'cp',
|
|
||||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
|
||||||
build_by_default: true,
|
|
||||||
)
|
|
||||||
|
|
||||||
mkdir_start = custom_target(
|
|
||||||
'mkdir_start',
|
|
||||||
input: 'src/user/start.asm',
|
|
||||||
output: 'mkdir_start.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
mkdir_syscall = custom_target(
|
|
||||||
'mkdir_syscall',
|
|
||||||
input: 'src/user/syscall.asm',
|
|
||||||
output: 'mkdir_syscall.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
mkdir_elf = executable(
|
|
||||||
'mkdir.elf',
|
|
||||||
sources: [mkdir_start, mkdir_syscall, lib_sources, 'src/user/app/mkdir/mkdir.c'],
|
|
||||||
c_args: [
|
|
||||||
'-ffreestanding',
|
|
||||||
'-nostdlib',
|
|
||||||
'-fno-stack-protector',
|
|
||||||
'-mcmodel=large',
|
|
||||||
'-DVERSION="' + meson.project_version() + '"',
|
|
||||||
],
|
|
||||||
link_args: [
|
|
||||||
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
|
||||||
'-nostdlib',
|
|
||||||
],
|
|
||||||
link_depends: 'src/user/linker.ld',
|
|
||||||
)
|
|
||||||
|
|
||||||
custom_target(
|
|
||||||
'mkdir',
|
|
||||||
input: mkdir_elf,
|
|
||||||
output: 'mkdir',
|
|
||||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
|
||||||
build_by_default: true,
|
|
||||||
)
|
|
||||||
|
|
||||||
rm_start = custom_target(
|
|
||||||
'rm_start',
|
|
||||||
input: 'src/user/start.asm',
|
|
||||||
output: 'rm_start.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
rm_syscall = custom_target(
|
|
||||||
'rm_syscall',
|
|
||||||
input: 'src/user/syscall.asm',
|
|
||||||
output: 'rm_syscall.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
rm_elf = executable(
|
|
||||||
'rm.elf',
|
|
||||||
sources: [rm_start, rm_syscall, lib_sources, 'src/user/app/rm/rm.c'],
|
|
||||||
c_args: [
|
|
||||||
'-ffreestanding',
|
|
||||||
'-nostdlib',
|
|
||||||
'-fno-stack-protector',
|
|
||||||
'-mcmodel=large',
|
|
||||||
'-DVERSION="' + meson.project_version() + '"',
|
|
||||||
],
|
|
||||||
link_args: [
|
|
||||||
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
|
||||||
'-nostdlib',
|
|
||||||
],
|
|
||||||
link_depends: 'src/user/linker.ld',
|
|
||||||
)
|
|
||||||
|
|
||||||
custom_target(
|
|
||||||
'rm',
|
|
||||||
input: rm_elf,
|
|
||||||
output: 'rm',
|
|
||||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
|
||||||
build_by_default: true,
|
|
||||||
)
|
|
||||||
|
|
||||||
wc_start = custom_target(
|
|
||||||
'wc_start',
|
|
||||||
input: 'src/user/start.asm',
|
|
||||||
output: 'wc_start.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
wc_syscall = custom_target(
|
|
||||||
'wc_syscall',
|
|
||||||
input: 'src/user/syscall.asm',
|
|
||||||
output: 'wc_syscall.o',
|
|
||||||
command: [nasm, '-f', 'elf64', '-o', '@OUTPUT@', '@INPUT@'],
|
|
||||||
)
|
|
||||||
|
|
||||||
wc_elf = executable(
|
|
||||||
'wc.elf',
|
|
||||||
sources: [wc_start, wc_syscall, lib_sources, 'src/user/app/wc/wc.c'],
|
|
||||||
c_args: [
|
|
||||||
'-ffreestanding',
|
|
||||||
'-nostdlib',
|
|
||||||
'-fno-stack-protector',
|
|
||||||
'-mcmodel=large',
|
|
||||||
'-DVERSION="' + meson.project_version() + '"',
|
|
||||||
],
|
|
||||||
link_args: [
|
|
||||||
'-T', meson.project_source_root() / 'src/user/linker.ld',
|
|
||||||
'-nostdlib',
|
|
||||||
],
|
|
||||||
link_depends: 'src/user/linker.ld',
|
|
||||||
)
|
|
||||||
|
|
||||||
custom_target(
|
|
||||||
'wc',
|
|
||||||
input: wc_elf,
|
|
||||||
output: 'wc',
|
|
||||||
command: ['objcopy', '-O', 'binary', '@INPUT@', '@OUTPUT@'],
|
|
||||||
build_by_default: true,
|
|
||||||
)
|
|
||||||
|
|||||||
+3
-4
@@ -3,8 +3,7 @@ ENTRY(_start)
|
|||||||
SECTIONS {
|
SECTIONS {
|
||||||
. = 0x0000000000400000;
|
. = 0x0000000000400000;
|
||||||
|
|
||||||
.text : { *(.text) }
|
.text : { *(.text*) }
|
||||||
.rodata : { *(.rodata) }
|
.rodata : { *(.rodata*) *(.lrodata*) }
|
||||||
.data : { *(.data) }
|
.data : { *(.data*) *(.ldata*) *(.bss*) *(.lbss*) }
|
||||||
.bss : { *(.bss) }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ fi
|
|||||||
qemu-system-x86_64 \
|
qemu-system-x86_64 \
|
||||||
"${debug_flags[@]}" \
|
"${debug_flags[@]}" \
|
||||||
-monitor stdio \
|
-monitor stdio \
|
||||||
-drive file=build/os.img,format=raw,if=none,id=nvme0 \
|
-drive file=build/os.raw,format=raw,if=none,id=nvme0 \
|
||||||
-device nvme,drive=nvme0,serial=foo \
|
-device nvme,drive=nvme0,serial=foo \
|
||||||
-device qemu-xhci,id=xhci,msi=off,msix=off \
|
-device qemu-xhci,id=xhci,msi=off,msix=off \
|
||||||
-device usb-kbd,bus=xhci.0 \
|
-device usb-kbd,bus=xhci.0 \
|
||||||
|
|||||||
Reference in New Issue
Block a user