Add an example user space process
This commit is contained in:
+20
-1
@@ -31,6 +31,14 @@ custom_target(
|
||||
build_by_default: true,
|
||||
)
|
||||
|
||||
custom_target(
|
||||
'hello',
|
||||
input: 'src/app/hello.asm',
|
||||
output: 'hello.bin',
|
||||
command: [nasm, '-f', 'bin', '-l', 'hello.lst', '@INPUT@', '-o', '@OUTPUT@'],
|
||||
build_by_default: true,
|
||||
)
|
||||
|
||||
kernel_entry_o = custom_target(
|
||||
'kernel_entry',
|
||||
input: 'src/kernel_entry.asm',
|
||||
@@ -38,6 +46,12 @@ kernel_entry_o = custom_target(
|
||||
command: [nasm, '-f', 'elf64', '@INPUT@', '-o', '@OUTPUT@'],
|
||||
)
|
||||
|
||||
syscall_o = custom_target('syscall',
|
||||
input: 'src/syscall.asm',
|
||||
output: 'syscall.o',
|
||||
command: [nasm, '-f', 'elf64', '@INPUT@', '-o', '@OUTPUT@'],
|
||||
)
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
kernel_sources = files(
|
||||
@@ -47,6 +61,7 @@ kernel_sources = files(
|
||||
'src/ata.c',
|
||||
'src/fat16.c',
|
||||
'src/fs.c',
|
||||
'src/gdt.c',
|
||||
'src/idt.c',
|
||||
'src/kernel.c',
|
||||
'src/keyboard.c',
|
||||
@@ -54,19 +69,23 @@ kernel_sources = files(
|
||||
'src/panic.c',
|
||||
'src/path.c',
|
||||
'src/pic.c',
|
||||
'src/process.c',
|
||||
'src/string.c',
|
||||
'src/syscall.c',
|
||||
'src/tss.c',
|
||||
'src/vga.c',
|
||||
)
|
||||
|
||||
kernel_elf = executable(
|
||||
'kernel.elf',
|
||||
sources: [kernel_entry_o, kernel_sources],
|
||||
sources: [kernel_entry_o, syscall_o, kernel_sources],
|
||||
c_args: [
|
||||
'-ffreestanding',
|
||||
'-nostdlib',
|
||||
'-nostartfiles',
|
||||
'-mno-red-zone',
|
||||
'-mgeneral-regs-only',
|
||||
'-mcmodel=kernel',
|
||||
'-Wno-unused-command-line-argument',
|
||||
'-Wconversion',
|
||||
'-DVERSION="' + meson.project_version() + '"',
|
||||
|
||||
Reference in New Issue
Block a user