Files
jsix/src/kernel/kernel.module
Justin C. Miller bb0d30610e [util] Add util::format replacement for snprintf
The printf library I have been using, while useful, has way more than I
need in it, and had comparably huge stack space requirements. This
change adds a new util::format() which is a replacement for snprintf,
but with only the features used by kernel logging.

The logger has been changed to use it, as well as the few instances of
snprintf in the interrupt handling code before calling kassert.

Also part of this change: the logger's (now vestigial) immediate output
handling code is removed, as well as the "sequence" field on log
message headers.
2022-03-13 17:59:56 -07:00

87 lines
2.2 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" ],
sources = [
"apic.cpp",
"assert.cpp",
"boot.s",
"clock.cpp",
"cpprt.cpp",
"cpu.cpp",
"debug.s",
"device_manager.cpp",
"frame_allocator.cpp",
"gdt.cpp",
"gdtidt.s",
"heap_allocator.cpp",
"hpet.cpp",
"idt.cpp",
"interrupts.cpp",
"interrupts.s",
"io.cpp",
"logger.cpp",
"main.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",
"pci.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/system.cpp",
"syscalls/thread.cpp",
"syscalls/vm_area.cpp",
"sysconf.cpp",
"sysconf.h.cog",
"task.s",
"tss.cpp",
"vm_space.cpp",
"wait_queue.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)
kernel.variables['ldflags'] = ["${ldflags}", "-T", "${source_root}/src/kernel/kernel.ld"]