-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bc4361
commit 41f2a9a
Showing
8 changed files
with
123 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* @file desktop-manager.c | ||
* @author Pradosh ([email protected]) | ||
* @brief This is the main separate ELF that will contain the desktop/window manager. | ||
* @version 0.1 | ||
* @date 2023-12-31 | ||
* | ||
* @copyright Copyright (c) Pradosh 2023 | ||
* | ||
*/ | ||
|
||
void fdm_main(){ | ||
sys_print("hello for desktop-manager!"); | ||
while(1){ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* @file syscalls.c | ||
* @author Pradosh ([email protected]) | ||
* @brief Contains the system calls for the kernel and desktop manager. | ||
* @version 0.1 | ||
* @date 2023-12-31 | ||
* | ||
* @copyright Copyright (c) Pradosh 2023 | ||
* | ||
*/ | ||
#include <basics.h> | ||
#include <syscalls.h> | ||
|
||
void sys_print(const char* message) { | ||
asm volatile ( | ||
"mov rax, %0\n\t" | ||
"mov rbx, %1\n\t" | ||
"int 0x80" | ||
: | ||
: "r"(sys_print), "r"(message) | ||
: "rax", "rbx" | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* @file syscalls.h | ||
* @author Pradosh ([email protected]) | ||
* @brief | ||
* @version 0.1 | ||
* @date 2023-12-31 | ||
* | ||
* @copyright Copyright (c) Pradosh 2023 | ||
* | ||
*/ | ||
#include <basics.h> | ||
#include <isr.h> | ||
|
||
enum { | ||
sys_print = 0, | ||
}; | ||
|
||
void syscall_handler(InterruptFrame* frame, int syscall_number, ...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @file syscalls.c | ||
* @author Pradosh ([email protected]) | ||
* @brief | ||
* @version 0.1 | ||
* @date 2023-12-31 | ||
* | ||
* @copyright Copyright (c) Pradosh 2023 | ||
* | ||
*/ | ||
#include <syscalls.h> | ||
|
||
void syscall_handler(InterruptFrame* frame, int syscall_number, ...) { | ||
va_list argp; | ||
va_start(argp, syscall_number); | ||
switch (syscall_number) { | ||
case sys_print: | ||
print(va_arg(argp, string)); | ||
break; | ||
} | ||
va_end(argp); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* Tell the linker that we want an x86_64 ELF64 output file */ | ||
OUTPUT_FORMAT(elf64-x86-64) | ||
OUTPUT_ARCH(i386:x86-64) | ||
|
||
/* We want the symbol main to be our entry point */ | ||
ENTRY(fdm_main) | ||
|
||
SECTIONS | ||
{ | ||
. = 0x100000; | ||
|
||
.text : { | ||
*(.text) /* Code */ | ||
*(.rodata) /* Read-only data */ | ||
} | ||
|
||
.data : { | ||
*(.data) /* Data */ | ||
} | ||
|
||
.bss : { | ||
*(.bss) /* Uninitialized data */ | ||
} | ||
|
||
. = ALIGN(4096); /* Align the following section to a page boundary */ | ||
|
||
/* Other sections as needed */ | ||
|
||
/DISCARD/ : { | ||
*(.comment) | ||
*(.eh_frame) | ||
} | ||
} |