[kernel] Expose a sysconf page to userspace

A structure, system_config, which is dynamically defined by the
definitions/sysconf.yaml config, is now mapped into every user address
space. The kernel fills this with information about itself and the
running machine.

User programs access this through the new j6_sysconf fake syscall in
libj6.

See: Github bug #242
See: [frobozz blog post](https://jsix.dev/posts/frobozz/)

Tags:
This commit is contained in:
Justin C. Miller
2022-01-13 22:08:35 -08:00
parent 939022bb5e
commit b3aaddadc8
11 changed files with 250 additions and 0 deletions

View File

@@ -27,6 +27,7 @@
#include "scheduler.h"
#include "serial.h"
#include "syscall.h"
#include "sysconf.h"
#include "tss.h"
#include "vm_space.h"
@@ -151,6 +152,7 @@ kernel_main(bootproto::args *args)
const auto &apic_ids = devices.get_apic_ids();
g_num_cpus = start_aps(*apic, apic_ids, args->pml4);
sysconf_create();
interrupts_enable();
g_com1.handle_interrupt();