feature (drivers): setup a small driver to test stuff

This commit is contained in:
antifallobst 2023-05-30 22:26:20 +02:00
parent 0732a19f8a
commit 7e53ab9e7c
4 changed files with 22 additions and 5 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ build
cmake-build-debug
noxos.log
ramdisk/shell.elf
ramdisk/*.nxkm

View File

@ -43,13 +43,21 @@ kernel_build() {
}
libnx_build() {
cd ../libnx
cd ../libraries/libnx
bash build.sh
cd ../kernel
cd ../../kernel
}
libnxdrv_build() {
cd ../libraries/libnxdrv
bash build.sh
cd ../../kernel
}
shell_build() {
gcc shell.c -o ramdisk/shell.elf -nostdlib -nolibc -fno-stack-protector -I../libnx/inc ../libnx/build/cmake/libnx.so
echo " --> Building shell"
# gcc shell.c -o ramdisk/shell.elf -nostdlib -nolibc -fno-stack-protector -I../libraries/libnx/inc/public ../libraries/libnx/build/cmake/libnx.so
gcc test_driver.c -o ramdisk/test_driver.nxkm -nostdlib -nolibc -I../libraries/libnxdrv/inc -L../libraries/libnxdrv/build -lnxdrv
}
@ -109,6 +117,7 @@ case $1 in
kernel_build
[ ! -d "build/limine" ] && limine_install
libnx_build
libnxdrv_build
shell_build
generate_initial_ramdisk
generate_image

View File

@ -1,6 +1,6 @@
{
"PS2_ACPI_VALIDATION": true,
"LOG_GRAPHICAL": false,
"LOG_GRAPHICAL": true,
"modules": {
"FAT32": "/initrd/modules/fat32.nxkm"

7
test_driver.c Normal file
View File

@ -0,0 +1,7 @@
#include "libnxdrv.h"
int main() {
nx_drv_init();
return 0;
}