Files
jsix_import/src/kernel/kernel.module
Justin C. Miller ed95574c24 [kernel] Add (wip) futex syscalls
Add the syscalls j6_futex_wait and j6_futex_wake. Currently marking this
as WIP as they need more testing.

Added to support futexes:
- vm_area and vm_space support for looking up physical address for a
  virtual address
- libj6 mutex implementation using futex system calls
2023-03-16 19:56:14 -07:00

90 lines
2.3 KiB
Python

# vim: ft=python
kernel = module("kernel",
kind = "exe",
default = True,
output = "jsix.elf",
targets = [ "kernel" ],
description = "jsix kernel",
deps = [ "util", "cpu", "bootproto", "j6" ],
ld_script = "kernel.ld",
sources = [
"apic.cpp",
"assert.cpp",
"boot.s",
"capabilities.cpp",
"clock.cpp",
"cpprt.cpp",
"cpu.cpp",
"cpu.s",
"device_manager.cpp",
"frame_allocator.cpp",
"gdt.cpp",
"gdtidt.s",
"heap_allocator.cpp",
"hpet.cpp",
"idt.cpp",
"interrupts.cpp",
"interrupts.s",
"io.cpp",
"kernel_main.cpp",
"logger.cpp",
"memory.cpp",
"memory.h.cog",
"memory_bootstrap.cpp",
"msr.cpp",
"objects/channel.cpp",
"objects/event.cpp",
"objects/kobject.cpp",
"objects/mailbox.cpp",
"objects/thread.cpp",
"objects/process.cpp",
"objects/system.cpp",
"objects/vm_area.cpp",
"page_table.cpp",
"page_tree.cpp",
"scheduler.cpp",
"smp.cpp",
"smp.s",
"syscall.cpp.cog",
"syscall.h.cog",
"syscall.s",
"syscall_verify.cpp.cog",
"syscalls.inc.cog",
"syscalls/channel.cpp",
"syscalls/event.cpp",
"syscalls/handle.cpp",
"syscalls/mailbox.cpp",
"syscalls/object.cpp",
"syscalls/process.cpp",
"syscalls/futex.cpp",
"syscalls/system.cpp",
"syscalls/thread.cpp",
"syscalls/vm_area.cpp",
"sysconf.cpp",
"sysconf.h.cog",
"task.s",
"tss.cpp",
"vm_space.cpp",
"wait_queue.cpp",
])
if config == "debug":
kernel.add_input("debugcon.cpp")
from glob import glob
from os.path import join
layout = join(source_root, "definitions/memory_layout.yaml")
sysconf = join(source_root, "definitions/sysconf.yaml")
definitions = glob(join(source_root, 'definitions/**/*.def'), recursive=True)
kernel.add_depends(["memory.h.cog"], [layout])
kernel.add_depends(["sysconf.h.cog"], [sysconf])
kernel.add_depends([
"syscall.cpp.cog",
"syscall.h.cog",
"syscalls.inc.cog",
"syscall_verify.cpp.cog",
], definitions)