Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
artiepoole committed Jul 20, 2024
1 parent fbccad3 commit 0931cfd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,6 @@ void kernel_main(const u32 /*stackPointer*/, const multiboot_header* multiboot_s
configurePit(2000);
log.log("Singletons loaded.");

// long t = time(nullptr);
// auto tbreak = get_time();
// auto outstr = asctime(&tbreak);
// log.log("acstime: ");
// log.log(outstr);


vga.drawSplash();
vga.draw();
Expand All @@ -239,8 +233,8 @@ void kernel_main(const u32 /*stackPointer*/, const multiboot_header* multiboot_s
log.log("LOADED OS.");


FILE* com = fopen("/dev/com1", "w");
auto ret = fprintf(com, "%s\n", "This should print to com0");
// FILE* com = fopen("/dev/com1", "w");
// fprintf(com, "%s\n", "This should print to com0");


// Event handler loop.
Expand Down
3 changes: 2 additions & 1 deletion src/sys/Files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void close_file_handle(int fd)
handles[fd] = NULL;
}

extern "C"
int write(const int fd, const char* buf, const unsigned long count)
{
const FileHandle* h = get_file_handle(fd);
Expand All @@ -67,7 +68,7 @@ int write(const int fd, const char* buf, const unsigned long count)
return h->write(buf, count);
}


extern "C"
int open(const char* filename, unsigned int mode)
{
// TODO this is a stub. We probably want some kind of dispatch to filesystems/mounts so we can mount com0 to
Expand Down
2 changes: 2 additions & 0 deletions src/sys/Files.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ struct FileHandle
FileHandle* get_file_handle(int fd);
int register_file_handle(int fd, const char* path, ReadFunc* read, WriteFunc* write);
void close_file_handle(int fd);
extern "C"
int open(const char* filename, unsigned int mode);
extern "C"
int write(int fd, const char* buf, unsigned long count);


Expand Down

0 comments on commit 0931cfd

Please sign in to comment.