mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[srv.init] Create init server and read init args
Create a new usermode program, srv.init, and have it read the initial module_page args sent to it by the bootloader. Doesn't yet do anything useful but sets up the way for loading the rest of the programs from srv.init. Other (mostly) related changes: - bootloader: The allocator now has a function for allocating init modules out of a modules_page slab. Also changed how the allocator is initialized and passes the allocation register and modules_page list to efi_main(). - bootloader: Expose the simple wstrlen() to the rest of the program - bootloader: Move check_cpu_supported() to hardware.cpp - bootloader: Moved program_desc to loader.h and made the loader functions take it as an argument instead of paths. - kernel: Rename the system_map_mmio syscall to system_map_phys, and stop having it default those VMAs to having the vm_flags::mmio flag. Added a new flag mask, vm_flags::driver_mask, so that drivers can be allowed to ask for the MMIO flag. - kernel: Rename load_simple_process() to load_init_server() and got rid of all the stack setup routines in memory_bootstrap.cpp and task.s - Fixed formatting in config/debug.toml, undefined __linux and other linux-specific defines, and got rid of _LIBCPP_HAS_THREAD_API_EXTERNAL because that's just not true.
This commit is contained in:
20
src/user/srv.init/main.cpp
Normal file
20
src/user/srv.init/main.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "j6/syscalls.h"
|
||||
#include "modules.h"
|
||||
|
||||
extern "C" {
|
||||
int main(int, const char **);
|
||||
}
|
||||
|
||||
uintptr_t _arg_modules_phys; // This gets filled in in _start
|
||||
|
||||
j6_handle_t handle_self = 1; // Self program handle is always 1
|
||||
j6_handle_t handle_system = 2; // boot protocol is that init gets the system as handle 2
|
||||
|
||||
int
|
||||
main(int argc, const char **argv)
|
||||
{
|
||||
j6_system_log("srv.init starting");
|
||||
modules::load_all(_arg_modules_phys);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user