Skip to content

Commit

Permalink
Soo much changes, I don't even know what I did, it was quite long
Browse files Browse the repository at this point in the history
  • Loading branch information
pradosh-arduino committed Apr 29, 2024
1 parent 960abe2 commit c4854e4
Show file tree
Hide file tree
Showing 115 changed files with 33 additions and 35 deletions.
Empty file modified .github/workflows/build.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .gitmodules
100644 → 100755
Empty file.
Empty file modified CONTRIBUTING.md
100644 → 100755
Empty file.
Empty file modified Doxyfile
100644 → 100755
Empty file.
Empty file modified FW.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified FW100.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified Makefile
100644 → 100755
Empty file.
Empty file modified disk.txt
100644 → 100755
Empty file.
Empty file modified doxygen-index.md
100644 → 100755
Empty file.
Empty file modified firmware/uefi/64.bin
100644 → 100755
Empty file.
Empty file modified init_ramdisk.tar
100644 → 100755
Empty file.
Empty file modified keys/public_key.pem
100644 → 100755
Empty file.
Empty file modified readme.md
100644 → 100755
Empty file.
Empty file modified source/Makefile
100644 → 100755
Empty file.
Empty file modified source/boot/Vera.sfn
100644 → 100755
Empty file.
Empty file modified source/boot/folder.tga
100644 → 100755
Empty file.
Empty file modified source/boot/init_ramdisk.tar
100644 → 100755
Empty file.
Empty file modified source/boot/iso.f16
100644 → 100755
Empty file.
Empty file modified source/boot/limine.cfg
100644 → 100755
Empty file.
Empty file modified source/boot/mouse.tga
100644 → 100755
Empty file.
Empty file modified source/boot/wallpaper.tga
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions source/desktop-manager/Makefile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CPPFLAGS = \
-w \
-g \
-std=gnu99 \
-ffreestanding \
-fno-stack-protector \
Expand Down
2 changes: 0 additions & 2 deletions source/desktop-manager/dm_main.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,5 @@ void send_alive_msg(){
int dw_main(kernel_data* data){
send_alive_msg();

data->print("hello from desktop-manager!");

return 0; // status code
}
Empty file modified source/desktop-manager/fonts/ssfn.h
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions source/desktop-manager/tools/signature.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def append_header(file_path, architecture, file_size):
architecture (int): Architecture information (32 or 64 bits).
file_size (int): Size of the file in bytes.
"""
signature = b'FWDE' # stands for Frost Wing Deployed Executable
signature = bytes([0xCD, 0x31]) + b'FWDE' # stands for Frost Wing Deployed Executable
architecture_byte = struct.pack('B', architecture) # 'B' format code packs an unsigned char (1 byte)
size_byte = struct.pack('B', 0x69) # 'B' format code packs an unsigned char (1 byte)
size_byte = struct.pack('h', file_size) # 'i' format code packs an signed integer (4 bytes)

endian = check_endian(file_path) # 0 = error; 1 = little; 2 = big

Expand Down
Empty file modified source/desktop-manager/x86_64-dm-linker.ld
100644 → 100755
Empty file.
Empty file modified source/drivers/audio/pc-speaker.c
100644 → 100755
Empty file.
Empty file modified source/drivers/networking/ethernet/RTL/8139.c
100644 → 100755
Empty file.
Empty file modified source/drivers/serial.c
100644 → 100755
Empty file.
Empty file modified source/includes/C++/vector
100644 → 100755
Empty file.
Empty file modified source/includes/acpi-shutdown.h
100644 → 100755
Empty file.
Empty file modified source/includes/acpi.h
100644 → 100755
Empty file.
Empty file modified source/includes/ahci.h
100644 → 100755
Empty file.
Empty file modified source/includes/algorithms/hashing.h
100644 → 100755
Empty file.
Empty file modified source/includes/archive/tarball.h
100644 → 100755
Empty file.
Empty file modified source/includes/basics.h
100644 → 100755
Empty file.
Empty file modified source/includes/cc-asm.h
100644 → 100755
Empty file.
Empty file modified source/includes/cpuid2.h
100644 → 100755
Empty file.
Empty file modified source/includes/debugger.h
100644 → 100755
Empty file.
Empty file modified source/includes/drivers/pc-speaker.h
100644 → 100755
Empty file.
Empty file modified source/includes/drivers/rtl8139.h
100644 → 100755
Empty file.
Empty file modified source/includes/drivers/serial.h
100644 → 100755
Empty file.
Empty file modified source/includes/executables/elf.h
100644 → 100755
Empty file.
7 changes: 5 additions & 2 deletions source/includes/executables/fwde.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
#include <basics.h>
#include <stdbool.h>
#include <graphics.h>
#include <isr.h>

typedef struct {
char signature[4]; // FWDE
char signature[5]; // 0xCD + 0x31 + FWDE
int8 architecture; // 1 = 64 bits; 2 = 32 bits; 3 = 16 bits; 4 = 8 bits
int8 raw_size; // size of just the executable part and not the header
int16 raw_size; // size of just the executable part and not the header
int8 endian; // 0 = error; 1 = little; 2 = big
} fwde_header;

Expand All @@ -28,5 +29,7 @@ typedef struct
void (*print)(cstring msg);
} kernel_data ;

typedef void(*entry_function)(kernel_data*);

void process_IFL(InterruptFrame* frame);
void execute_fwde(int64* addr, kernel_data* data);
Empty file modified source/includes/fb.h
100644 → 100755
Empty file.
Empty file modified source/includes/flanterm/flanterm.h
100644 → 100755
Empty file.
Empty file modified source/includes/graphics.h
100644 → 100755
Empty file.
Empty file modified source/includes/heap.h
100644 → 100755
Empty file.
Empty file modified source/includes/idt.h
100644 → 100755
Empty file.
Empty file modified source/includes/image/targa.h
100644 → 100755
Empty file.
Empty file modified source/includes/isr.h
100644 → 100755
Empty file.
Empty file modified source/includes/kernel.h
100644 → 100755
Empty file.
Empty file modified source/includes/keyboard.h
100644 → 100755
Empty file.
Empty file modified source/includes/limine.h
100644 → 100755
Empty file.
Empty file modified source/includes/linkedlist.h
100644 → 100755
Empty file.
Empty file modified source/includes/math/fpu.h
100644 → 100755
Empty file.
Empty file modified source/includes/meltdown.h
100644 → 100755
Empty file.
Empty file modified source/includes/memory2.h
100644 → 100755
Empty file.
Empty file modified source/includes/opengl/gl.h
100644 → 100755
Empty file.
Empty file modified source/includes/opengl/glbackend.h
100644 → 100755
Empty file.
Empty file modified source/includes/opengl/glcontext.h
100644 → 100755
Empty file.
Empty file modified source/includes/opengl/glmat.h
100644 → 100755
Empty file.
Empty file modified source/includes/opengl/glvec.h
100644 → 100755
Empty file.
Empty file modified source/includes/paging.h
100644 → 100755
Empty file.
Empty file modified source/includes/pci.h
100644 → 100755
Empty file.
Empty file modified source/includes/pit.h
100644 → 100755
Empty file.
Empty file modified source/includes/ps2-mouse.h
100644 → 100755
Empty file.
Empty file modified source/includes/secure-boot.h
100644 → 100755
Empty file.
Empty file modified source/includes/sse.h
100644 → 100755
Empty file.
Empty file modified source/includes/strings2.h
100644 → 100755
Empty file.
Empty file modified source/includes/syscalls.h
100644 → 100755
Empty file.
Empty file modified source/includes/unifont.h
100644 → 100755
Empty file.
Empty file modified source/includes/versions.h
100644 → 100755
Empty file.
Empty file modified source/kernel/C/acpi-shutdown.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/acpi.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/ahci.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/algorithms/hashing.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/archive/tarball.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/cc-asm.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/cpuid.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/debugger.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/executables/elf.c
100644 → 100755
Empty file.
30 changes: 18 additions & 12 deletions source/kernel/C/executables/fwde.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,24 @@
#include <executables/fwde.h>

bool verify_signature(char* signature){
if(signature[0] == 'F' &&
signature[1] == 'W' &&
signature[2] == 'D' &&
signature[3] == 'E'){
char interrupt_opcode = 0xCD;
if(signature[0] == interrupt_opcode &&
signature[1] == '1' &&
signature[2] == 'F' &&
signature[3] == 'W' &&
signature[4] == 'D' &&
signature[5] == 'E'){
return true;
}
else
return false;
}

void process_IFL(InterruptFrame* frame){ // process Invalid FWDE Loading
meltdown_screen("Frost Wing Deployed executable was not executed the way it should have!", __FILE__, __LINE__, 0xbadf1e, 0x0, 0xFfe);
hcf2();
}

void execute_fwde(int64* addr, kernel_data* data){
info("Verifying the FrostWing deployed executable!", __FILE__);

Expand All @@ -36,24 +44,22 @@ void execute_fwde(int64* addr, kernel_data* data){
return;
}

if(header->endian != 1 && header->endian != 2){
if(*(&(header->endian)+1) != 1 && *(&(header->endian)+1) != 2){
error("Undetermined endian executable! Abort.", __FILE__);
printf("Endian value = 0x%x", header->endian);
return;
}

if(header->architecture == 1){ // 64 bits
local += sizeof(fwde_header);
// if(*(local + header->raw_size) == 0){
// info("Valid executable! and ready for execution!", __FILE__);
// }
info("Starting executing the FrostWing deployed executable...", __FILE__);

typedef void(*EntryFunction)(kernel_data*);
EntryFunction execute_binary = (EntryFunction)local;

info("Function is ready!", __FILE__);
entry_function execute_binary = (entry_function)local;

info("Function is ready! executing it..", __FILE__);
print("=========================================================\n");
execute_binary(data);
print("=========================================================\n");
}else{
error("Unsupported architecture!", __FILE__);
return;
Expand Down
Empty file modified source/kernel/C/fb.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/flanterm/flanterm.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/heap.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/image/targa.c
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions source/kernel/C/interrupts/idt.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <ps2-mouse.h>
#include <pit.h>
#include <syscalls.h>
#include <executables/fwde.h>

extern void* isr_stub_table[];
extern void* irq_stub_table[];
Expand Down Expand Up @@ -66,6 +67,7 @@ void initIdt()
registerInterruptHandler(0x20, process_pit);
registerInterruptHandler(0x2C, process_mouse);
registerInterruptHandler(0x21, process_keyboard);
registerInterruptHandler(0x31, process_IFL);
registerInterruptHandler(0x80, syscalls_handler);

for (uint8_t i = 0; i < 32; i++)
Expand Down
Empty file modified source/kernel/C/interrupts/interrupt-x86_64.asm
100644 → 100755
Empty file.
Empty file modified source/kernel/C/interrupts/isr.c
100644 → 100755
Empty file.
14 changes: 1 addition & 13 deletions source/kernel/C/kernel.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,7 @@ void main(void) {
initIdt();

init_hashing();

// gdt_init();

// ~ Negative numbers test
int test_var = 50;
// test_var = -test_var;
// if(test_var == -50){
// done("Works!", __FILE__);
// }

// printf("%d", test_var);
printf("%X", test_var);


// "OpenGL" context creation/destroying and triangle/line drawing test code (actual opengl-like implementations coming soon(tm))
// glCreateContext();
// glDrawLine((uvec2){0, 0}, (uvec2){10, 30}, 0xffbaddad);
Expand Down
Empty file modified source/kernel/C/linkedlist.c
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions source/kernel/C/logger.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static const char caps_hex_digits[] = "0123456789ABCDEF";
* @param file The file name where the warning occurred.
*/
void warn(cstring message, cstring file) {
cstring warn_message = yellow_color "[Warning] → " reset_color;
cstring warn_message = yellow_color "[***] → " reset_color;
print(warn_message);
print(message);
print(" at " blue_color);
Expand All @@ -46,7 +46,7 @@ void warn(cstring message, cstring file) {
* @param file The file name where the error occurred.
*/
void error(cstring message, cstring file) {
cstring err_message = red_color "[Error] → " reset_color;
cstring err_message = red_color "[***] → " reset_color;
print(err_message);
print(message);
print(" at " blue_color);
Expand All @@ -69,7 +69,7 @@ void error(cstring message, cstring file) {
* @param file The file name where the information is coming from.
*/
void info(cstring message, cstring file) {
cstring info_message = blue_color "[Info] → " reset_color;
cstring info_message = blue_color "[***] → " reset_color;
print(info_message);
print(message);
print(" at " blue_color);
Expand All @@ -92,7 +92,7 @@ void info(cstring message, cstring file) {
* @param file The file name associated with the success.
*/
void done(cstring message, cstring file) {
cstring done_message = green_color "[Success] → " reset_color;
cstring done_message = green_color "[***] → " reset_color;
print(done_message);
print(message);
print(" at " blue_color);
Expand Down
Empty file modified source/kernel/C/math/fpu.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/meltdown.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/memory.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/opengl/glbackend.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/opengl/glcontext.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/opengl/glmat.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/paging.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/pci.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/pit.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/rtc.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/secure-boot.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/sse.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/strings.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/syscalls.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/user-input/keyboard.c
100644 → 100755
Empty file.
Empty file modified source/kernel/C/user-input/ps2-mouse.c
100644 → 100755
Empty file.
Empty file modified source/linker/aarch32.ld
100644 → 100755
Empty file.
Empty file modified source/linker/aarch64.ld
100644 → 100755
Empty file.
Empty file modified source/linker/riscv64.ld
100644 → 100755
Empty file.
Empty file modified source/linker/x86_64.ld
100644 → 100755
Empty file.

0 comments on commit c4854e4

Please sign in to comment.