[boot][kernel] Split programs into sections
To enable setting sections as NX or read-only, the boot program loader now loads programs as lists of sections, and the kernel args are updated accordingly. The kernel's loader now just takes a program pointer to iterate the sections. Also enable NX in IA32_EFER in the bootloader.
This commit is contained in:
@@ -5,6 +5,11 @@
|
||||
#include <stdint.h>
|
||||
#include "objects/thread.h"
|
||||
|
||||
namespace kernel {
|
||||
namespace args {
|
||||
struct program;
|
||||
}}
|
||||
|
||||
class lapic;
|
||||
class process;
|
||||
struct page_table;
|
||||
@@ -41,12 +46,9 @@ public:
|
||||
scheduler(lapic *apic);
|
||||
|
||||
/// Create a new process from a program image in memory.
|
||||
/// \arg phys Physical address of the loaded program image
|
||||
/// \arg virt Virtual address of the loaded program image
|
||||
/// \arg size Size of the program image, in bytes
|
||||
/// \arg entry Virtual address of the program entrypoint
|
||||
/// \returns The main thread of the loaded process
|
||||
thread * load_process(uintptr_t phys, uintptr_t virt, size_t size, uintptr_t entry);
|
||||
/// \arg program The descriptor of the pogram in memory
|
||||
/// \returns The main thread of the loaded process
|
||||
thread * load_process(kernel::args::program &program);
|
||||
|
||||
/// Create a new kernel task
|
||||
/// \arg proc Function to run as a kernel task
|
||||
|
||||
Reference in New Issue
Block a user