This commit is contained in:
Able 2022-02-07 06:38:18 -06:00
parent df86c272f3
commit 5a1a84b1c7
4 changed files with 70 additions and 36 deletions

View file

@ -41,7 +41,6 @@ pub fn kernel_main() -> ! {
init::init();
log::set_max_level(BOOT_CONF.log_level());
{
{
let mut scheduler = SCHEDULER.lock();
@ -60,7 +59,7 @@ pub fn kernel_main() -> ! {
use crate::proto_filetable::file::FileLocations;
{
if false {
let mut sock_print_id = SimpleSock::new();
sock_print_id.register_protocol("Screen Printer".to_string());
sock_print_id.write(format!("🐑").into());
@ -73,12 +72,13 @@ pub fn kernel_main() -> ! {
}
mode.copy_to_buffer();
}
}
if false {
// Currently not implemented
let acpi_handler = ACPI_struct {};
let acpi_handler = AcpiStruct {};
let mut table;
unsafe {
let table = AcpiTables::search_for_rsdp_bios(acpi_handler);
table = AcpiTables::search_for_rsdp_bios(acpi_handler);
}
}
@ -95,6 +95,7 @@ pub fn tick() {
crate::kernel_state::KERNEL_STATE.lock().update_state();
// let mut scheduler = SCHEDULER.lock();
// scheduler.bump_exec();
// drop(scheduler);
TICK.store(data, Relaxed)
}
@ -124,9 +125,9 @@ pub fn generate_process_pass() -> u128 {
// TODO: move to a better place
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct ACPI_struct {}
pub struct AcpiStruct {}
impl acpi::AcpiHandler for ACPI_struct {
impl acpi::AcpiHandler for AcpiStruct {
unsafe fn map_physical_region<T>(
&self,
physical_address: usize,

View file

@ -18,13 +18,16 @@ pub extern "C" fn remove_directory(path: Path, force_delete: bool) {
/// # Arguments
/// * `full_path` - The full path of the directory to create
#[no_mangle]
pub extern "C" fn create_directory(path: Path) -> Result<(), FileErrors> {
pub extern "C" fn create_directory(path: Path) -> FSReturns {
unimplemented!();
}
#[repr(C)]
/// Errors that can occur when messing with files
pub enum FileErrors {
/// A return used by the file related system calls
pub enum FSReturns {
/// The system call was successful
Ok,
/// The directory can not be created
DirectoryCouldNotBeCreated,
/// The directory could not be removed

View file

@ -0,0 +1,29 @@
enum FSReturns {
/// The system call was successful
Ok,
/// The directory can not be created
DirectoryCouldNotBeCreated,
/// The directory could not be removed
DirectoryCouldNotBeRemoved,
///
FileCouldNotBeCreated,
///
FileCouldNotBeRemoved,
/// The file could not be opened
FileCouldNotBeOpened,
///
FileCouldNotBeClosed,
};
int create_directory(path) {
return DirectoryCouldNotBeCreated;
}
///
int remove_directory(path) {
return DirectoryCouldNotBeRemoved;
}

1
lib_syscalls/README.md Normal file
View file

@ -0,0 +1 @@
# The libraries here are simplified examples of syscall APi