aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrun307
-rw-r--r--src/bootloader/cd.asm2
-rw-r--r--src/bootloader/hdd2.asm2
-rw-r--r--src/kernel/acpi/acpi.c2
-rw-r--r--src/kernel/acpi/acpi.h2
-rw-r--r--src/kernel/boot.asm2
-rw-r--r--src/kernel/cmos/rtc.c2
-rw-r--r--src/kernel/cmos/rtc.h2
-rw-r--r--src/kernel/fs/ata_pio.c2
-rw-r--r--src/kernel/fs/ata_pio.h2
-rw-r--r--src/kernel/fs/atapi_pio.h2
-rw-r--r--src/kernel/fs/elf.h2
-rw-r--r--src/kernel/fs/elfloader.c2
-rw-r--r--src/kernel/fs/install.c2
-rw-r--r--src/kernel/fs/install.h2
-rw-r--r--src/kernel/fs/iso9660/iso9660.h2
-rw-r--r--src/kernel/fs/load.c2
-rw-r--r--src/kernel/fs/load.h2
-rw-r--r--src/kernel/fs/marfs/directory.c2
-rw-r--r--src/kernel/fs/marfs/disklevel.c2
-rw-r--r--src/kernel/fs/marfs/marfs.h2
-rw-r--r--src/kernel/fs/vfs.c2
-rw-r--r--src/kernel/fs/vfs.h2
-rw-r--r--src/kernel/gdt/gdt.h2
-rw-r--r--src/kernel/graphics/vesa.c2
-rw-r--r--src/kernel/graphics/vesa.h2
-rw-r--r--src/kernel/input/input.h2
-rw-r--r--src/kernel/input/ps2/keyboard.c2
-rw-r--r--src/kernel/interact.asm2
-rw-r--r--src/kernel/io/io.c2
-rw-r--r--src/kernel/io/io.h2
-rw-r--r--src/kernel/kernel.c2
-rw-r--r--src/kernel/lib/lib.h2
-rw-r--r--src/kernel/lib/math.h2
-rw-r--r--src/kernel/lib/memory.c2
-rw-r--r--src/kernel/lib/stdio.h2
-rw-r--r--src/kernel/lib/stdlib.h2
-rw-r--r--src/kernel/lib/string.h2
-rw-r--r--src/kernel/linker.ld2
-rw-r--r--src/kernel/memory/alloc.c2
-rw-r--r--src/kernel/net/network.h2
-rw-r--r--src/kernel/pci/pci.h2
-rw-r--r--src/kernel/smbios/smbios.c2
-rw-r--r--src/kernel/smbios/smbios.h2
-rw-r--r--src/kernel/sound/sound.h2
-rw-r--r--src/kernel/system.c2
-rw-r--r--src/kernel/system.h2
-rw-r--r--src/kernel/tasks/task.c2
-rw-r--r--src/kernel/tasks/task.h2
-rw-r--r--src/kernel/timer/timer.h2
-rwxr-xr-xsrc/resources/conv.sh4
-rw-r--r--src/userspace/main.c2
-rw-r--r--src/userspace/mlibc/math.h2
-rw-r--r--src/userspace/mlibc/stdio.h2
-rw-r--r--src/userspace/mlibc/stdlib.h2
-rw-r--r--src/userspace/mlibc/stdlib/liballoc.c2
-rw-r--r--src/userspace/mlibc/stdlib/liballoc.h2
-rw-r--r--src/userspace/mlibc/string.h2
-rw-r--r--src/userspace/syscall.c2
59 files changed, 217 insertions, 208 deletions
diff --git a/run b/run
index 23ce208..d3bca1d 100755
--- a/run
+++ b/run
@@ -4,192 +4,201 @@ mode="${1}"
network="rtl8139"
qemu_with_flags() {
- if [ "${mode}" = "image" ] || [ "${mode}" = "image_debug" ]; then
- # TODO: Find out why kvm install is incredibly slow
- SDL_VIDEO_X11_DGAMOUSE=0 qemu-system-i386 -no-reboot -vga std -smp "$(nproc)" -serial mon:stdio -rtc base=localtime -m 256M -net nic,model=${network},macaddr=42:42:42:42:42:42 -net user "$@"
- else
- SDL_VIDEO_X11_DGAMOUSE=0 qemu-system-i386 -enable-kvm -cpu host -no-reboot -vga std -smp "$(nproc)" -serial stdio -rtc base=localtime -m 256M -net nic,model=${network},macaddr=42:42:42:42:42:42 -net user "$@"
- fi
+ if [ "${mode}" = "image" ] || [ "${mode}" = "image_debug" ]; then
+ # TODO: Find out why kvm install is incredibly slow
+ SDL_VIDEO_X11_DGAMOUSE=0 qemu-system-i386 -no-reboot -vga std -smp "$(nproc)" -serial mon:stdio -rtc base=localtime -m 256M -net nic,model=${network},macaddr=42:42:42:42:42:42 -net user "$@"
+ else
+ SDL_VIDEO_X11_DGAMOUSE=0 qemu-system-i386 -enable-kvm -cpu host -no-reboot -vga std -smp "$(nproc)" -serial stdio -rtc base=localtime -m 256M -net nic,model=${network},macaddr=42:42:42:42:42:42 -net user "$@"
+ fi
}
compile_with_flags() {
- if [ "${mode}" = "image" ] || [ "${mode}" = "image_debug" ]; then
- GCC_COLORS=1 ccache i686-elf-gcc -std=gnu99 -ffreestanding -nostdlib -Wall -Wextra -Wno-unused-parameter -D INSTALL_MELVIX "$@" || exit
- else
- GCC_COLORS=1 ccache i686-elf-gcc -std=gnu99 -ffreestanding -nostdlib -Wall -Wextra -Wno-unused-parameter "$@" || exit
- fi
+ if [ "${mode}" = "image" ] || [ "${mode}" = "image_debug" ]; then
+ GCC_COLORS=1 ccache i686-elf-gcc -std=gnu99 -ffreestanding -nostdlib -Wall -Wextra -Wno-unused-parameter -D INSTALL_MELVIX "$@" || exit
+ else
+ GCC_COLORS=1 ccache i686-elf-gcc -std=gnu99 -ffreestanding -nostdlib -Wall -Wextra -Wno-unused-parameter "$@" || exit
+ fi
}
make_cross() {
- if [ ! -d "./cross/" ]; then
- # Create directory
- mkdir -p cross
- cd cross || exit
- DIR=$(pwd)
-
- # Get sources
- mkdir "${DIR}/src" && cd "${DIR}/src" || exit
- echo "Downloading..."
- curl -sSL "https://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.xz" | tar xJ
- curl -sSL "https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz" | tar xJ
-
- # Prepare compiling
- mkdir -p "${DIR}/opt/bin"
- export PREFIX="${DIR}/opt"
- export TARGET=i686-elf
- export PATH="$PREFIX/bin:$PATH"
-
- # Compile binutils
- mkdir "${DIR}/src/build-binutils" && cd "${DIR}/src/build-binutils" || exit
- ../binutils-2.32/configure --target="$TARGET" --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
- make
- make install
-
- # Compile GCC
- mkdir "${DIR}/src/build-gcc" && cd "${DIR}/src/build-gcc" || exit
- ../gcc-9.2.0/configure --target="$TARGET" --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
- make all-gcc
- make all-target-libgcc
- make install-gcc
- make install-target-libgcc
-
- cd "${DIR}/.." || exit
- else
- # Should be sourced to take effect
- cd cross || exit
- DIR=$(pwd)
- export PREFIX="${DIR}/opt"
- export TARGET=i686-elf
- export PATH="$PREFIX/bin:$PATH"
- cd ..
- fi
+ if [ ! -d "./cross/" ]; then
+ # Create directory
+ mkdir -p cross
+ cd cross || exit
+ DIR=$(pwd)
+
+ # Get sources
+ mkdir "${DIR}/src" && cd "${DIR}/src" || exit
+ echo "Downloading..."
+ curl -sSL "https://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.xz" | tar xJ
+ curl -sSL "https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.xz" | tar xJ
+
+ # Prepare compiling
+ mkdir -p "${DIR}/opt/bin"
+ export PREFIX="${DIR}/opt"
+ export TARGET=i686-elf
+ export PATH="$PREFIX/bin:$PATH"
+
+ # Compile binutils
+ mkdir "${DIR}/src/build-binutils" && cd "${DIR}/src/build-binutils" || exit
+ ../binutils-2.32/configure --target="$TARGET" --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
+ make
+ make install
+
+ # Compile GCC
+ mkdir "${DIR}/src/build-gcc" && cd "${DIR}/src/build-gcc" || exit
+ ../gcc-9.2.0/configure --target="$TARGET" --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
+ make all-gcc
+ make all-target-libgcc
+ make install-gcc
+ make install-target-libgcc
+
+ cd "${DIR}/.." || exit
+ else
+ # Should be sourced to take effect
+ cd cross || exit
+ DIR=$(pwd)
+ export PREFIX="${DIR}/opt"
+ export TARGET=i686-elf
+ export PATH="$PREFIX/bin:$PATH"
+ cd ..
+ fi
}
make_build() {
- echo "Building..."
- mkdir -p ./build/kernel && mkdir -p ./build/userspace
-
- # Assemble ASM files
- find ./src/kernel/ -name \*.asm >./build/tmp
- while read -r line; do
- stripped=$(echo "${line}" | sed -r 's/\//_/g')
- stripped=${stripped#??????}
- stripped=${stripped%%???}o
- nasm -f elf ./"${line}" -o ./build/kernel/asm_"${stripped}" || exit
- done <./build/tmp
- rm ./build/tmp
-
- # Make all kernel C files
- find ./src/kernel/ -name \*.c >./build/tmp
- while read -r line; do
- stripped=$(echo "${line}" | sed -r 's/\//_/g')
- stripped=${stripped#??????}
- stripped=${stripped%%?}o
- compile_with_flags -Os -s -c ./"${line}" -I ./src -D ${network} -o ./build/kernel/"${stripped}"
- done <./build/tmp
- rm ./build/tmp
-
- # Link kernel ASM and C objects
- compile_with_flags -Os -s ./build/kernel/*.o -T ./src/kernel/linker.ld -I ./src -o ./build/melvix.bin
-
- # Modules
- # TODO: Find out why no font optimizations cause strange glitches
- compile_with_flags -Os -c ./src/resources/font.c -o ./build/font.o
- i686-elf-objcopy -O binary ./build/font.o ./build/font.bin
- rm ./build/font.o
-
- # Userspace
- # TODO: Find out why userspace optimizations (-Os) cause fatal errors
- find ./src/userspace/ -name \*.c >./build/tmp
- while read -r line; do
- stripped=$(echo "${line}" | sed -r 's/\//_/g')
- stripped=${stripped#??????}
- stripped=${stripped%%?}o
- compile_with_flags -O2 -c ./"${line}" -I ./src/userspace -o ./build/userspace/"${stripped}"
- done <./build/tmp
- rm ./build/tmp
- compile_with_flags -emain -O2 ./build/userspace/*.o -I ./src/userspace -o ./build/user.bin
-
- # Create ISO
- mkdir -p ./iso/boot/
- mv ./build/melvix.bin ./iso/boot/kernel.bin
- nasm ./src/bootloader/cd.asm -f bin -o ./iso/boot/cd.bin || exit
- nasm ./src/bootloader/hdd1.asm -f bin -o ./iso/boot/hdd1.bin || exit
- nasm ./src/bootloader/hdd2.asm -f bin -o ./iso/boot/hdd2.bin || exit
- cp ./build/user.bin ./iso/user.bin || exit
- cp ./build/font.bin ./iso/font.bin || exit
- genisoimage -quiet -input-charset utf-8 -no-emul-boot -b boot/cd.bin -o ./build/melvix.iso ./iso
- head -c 10485760 /dev/zero >./build/hdd10M.img
-
- printf "Build finshed successfully!\n\n"
+ echo "Building..."
+ mkdir -p ./build/kernel && mkdir -p ./build/userspace
+
+ # Assemble ASM files
+ find ./src/kernel/ -name \*.asm >./build/tmp
+ while read -r line; do
+ stripped=$(echo "${line}" | sed -r 's/\//_/g')
+ stripped=${stripped#??????}
+ stripped=${stripped%%???}o
+ nasm -f elf ./"${line}" -o ./build/kernel/asm_"${stripped}" || exit
+ done <./build/tmp
+ rm ./build/tmp
+
+ # Make all kernel C files
+ find ./src/kernel/ -name \*.c >./build/tmp
+ while read -r line; do
+ stripped=$(echo "${line}" | sed -r 's/\//_/g')
+ stripped=${stripped#??????}
+ stripped=${stripped%%?}o
+ compile_with_flags -Os -s -c ./"${line}" -I ./src -D ${network} -o ./build/kernel/"${stripped}"
+ done <./build/tmp
+ rm ./build/tmp
+
+ # Link kernel ASM and C objects
+ compile_with_flags -Os -s ./build/kernel/*.o -T ./src/kernel/linker.ld -I ./src -o ./build/melvix.bin
+
+ # Modules
+ # TODO: Find out why no font optimizations cause strange glitches
+ compile_with_flags -Os -c ./src/resources/font.c -o ./build/font.o
+ i686-elf-objcopy -O binary ./build/font.o ./build/font.bin
+ rm ./build/font.o
+
+ # Userspace
+ # TODO: Find out why userspace optimizations (-Os) cause fatal errors
+ find ./src/userspace/ -name \*.c >./build/tmp
+ while read -r line; do
+ stripped=$(echo "${line}" | sed -r 's/\//_/g')
+ stripped=${stripped#??????}
+ stripped=${stripped%%?}o
+ compile_with_flags -O2 -c ./"${line}" -I ./src/userspace -o ./build/userspace/"${stripped}"
+ done <./build/tmp
+ rm ./build/tmp
+ compile_with_flags -emain -O2 ./build/userspace/*.o -I ./src/userspace -o ./build/user.bin
+
+ # Create ISO
+ mkdir -p ./iso/boot/
+ mv ./build/melvix.bin ./iso/boot/kernel.bin
+ nasm ./src/bootloader/cd.asm -f bin -o ./iso/boot/cd.bin || exit
+ nasm ./src/bootloader/hdd1.asm -f bin -o ./iso/boot/hdd1.bin || exit
+ nasm ./src/bootloader/hdd2.asm -f bin -o ./iso/boot/hdd2.bin || exit
+ cp ./build/user.bin ./iso/user.bin || exit
+ cp ./build/font.bin ./iso/font.bin || exit
+ genisoimage -quiet -input-charset utf-8 -no-emul-boot -b boot/cd.bin -o ./build/melvix.iso ./iso
+ head -c 10485760 /dev/zero >./build/hdd10M.img
+
+ printf "Build finshed successfully!\n\n"
}
make_test() {
- qemu_with_flags -cdrom ./build/melvix.iso -drive file=./build/hdd10M.img,format=raw
+ qemu_with_flags -cdrom ./build/melvix.iso -drive file=./build/hdd10M.img,format=raw
}
make_debug() {
- qemu_with_flags -s -cdrom ./build/melvix.iso -drive file=./build/hdd10M.img,format=raw
+ qemu_with_flags -s -cdrom ./build/melvix.iso -drive file=./build/hdd10M.img,format=raw
}
make_image_debug() {
- qemu_with_flags -cdrom ./build/melvix.iso -drive file=./build/hdd10M.img,format=raw
- qemu_with_flags -drive file=./build/hdd10M.img,format=raw
+ qemu_with_flags -cdrom ./build/melvix.iso -drive file=./build/hdd10M.img,format=raw
+ qemu_with_flags -drive file=./build/hdd10M.img,format=raw
}
make_image() {
- start=$(date +%s.%N)
- qemu_with_flags -nographic -cdrom ./build/melvix.iso -drive file=./build/hdd10M.img,format=raw >install.log
- end=$(date +%s.%N)
- cat install.log
- printf "[LOG END]\n\n"
- tail install.log | grep -q "Installation successful!" && echo Booted and installed within "$(echo "$end - $start" | bc -l)" seconds || echo Installation failed!
- rm install.log
+ start=$(date +%s.%N)
+ qemu_with_flags -nographic -cdrom ./build/melvix.iso -drive file=./build/hdd10M.img,format=raw >install.log
+ end=$(date +%s.%N)
+ cat install.log
+ printf "[LOG END]\n\n"
+ tail install.log | grep -q "Installation successful!" && echo Booted and installed within "$(echo "$end - $start" | bc -l)" seconds || echo Installation failed!
+ rm install.log
}
make_sync() {
- rm tags compile_commands.json
- ctags -R --exclude=.git --exclude=build --exclude=iso --exclude=cross .
- mkdir cmake
- cd cmake
- cmake .. > /dev/null
- mv compile_commands.json ..
- cd ..
+ rm tags compile_commands.json
+ ctags -R --exclude=.git --exclude=build --exclude=iso --exclude=cross .
+ mkdir -p cmake
+ cd cmake
+ cmake .. >/dev/null
+ mv compile_commands.json ..
+ cd ..
+}
+
+make_tidy() {
+ find ./src -type f -name "*.sh" | xargs -l -i sh -c 'shfmt -w {}'
+ shfmt -w ./run
+ find ./src -type f -regex '.*\.\(c\|h\)' -exec clang-format -i {} \;
+ find ./src -type f | xargs -l -i sh -c 'printf %s "$(< {})" > {}'
}
make_clean() {
- rm -rf ./build ./iso
+ rm -rf ./build ./iso
}
if [ "${mode}" = "cross" ]; then
- make_cross
+ make_cross
elif [ "${mode}" = "build" ]; then
- make_cross
- make_clean
- make_build
+ make_cross
+ make_clean
+ make_build
elif [ "${mode}" = "clean" ]; then
- make_clean
+ make_clean
elif [ "${mode}" = "test" ]; then
- make_cross
- make_clean
- make_build
- make_test
+ make_cross
+ make_clean
+ make_build
+ make_test
elif [ "${mode}" = "debug" ]; then
- make_debug
+ make_debug
elif [ "${mode}" = "image_debug" ]; then
- make_cross
- make_clean
- make_build
- make_image_debug
+ make_cross
+ make_clean
+ make_build
+ make_image_debug
elif [ "${mode}" = "image" ]; then
- make_cross
- make_clean
- make_build
- make_image
+ make_cross
+ make_clean
+ make_build
+ make_image
elif [ "${mode}" = "sync" ]; then
- make_sync
+ make_sync
+elif [ "${mode}" = "tidy" ]; then
+ make_tidy
else
- echo "Please use the following syntax:"
- echo "./run {cross | build | clean | test | debug | image}"
+ echo "Please use the following syntax:"
+ echo "./run {cross | build | clean | test | debug | image}"
fi
diff --git a/src/bootloader/cd.asm b/src/bootloader/cd.asm
index ec9fc9d..1661df1 100644
--- a/src/bootloader/cd.asm
+++ b/src/bootloader/cd.asm
@@ -440,4 +440,4 @@ lba_not_supported:
boot db "BOOT"
boot_len equ ($ - boot)
kernelbin db "KERNEL.BIN", 0x3B, "1"
-kernelbin_len equ ($ - kernelbin)
+kernelbin_len equ ($ - kernelbin) \ No newline at end of file
diff --git a/src/bootloader/hdd2.asm b/src/bootloader/hdd2.asm
index 3330c96..db5aa38 100644
--- a/src/bootloader/hdd2.asm
+++ b/src/bootloader/hdd2.asm
@@ -385,4 +385,4 @@ gdtinfo:
gdt_end:
kernelbin db "KERNEL.BIN", 0x3B, "1"
-kernelbin_len equ ($ - kernelbin)
+kernelbin_len equ ($ - kernelbin) \ No newline at end of file
diff --git a/src/kernel/acpi/acpi.c b/src/kernel/acpi/acpi.c
index aaf8ce2..57ecc58 100644
--- a/src/kernel/acpi/acpi.c
+++ b/src/kernel/acpi/acpi.c
@@ -207,4 +207,4 @@ void reboot()
good = inb(0x64);
outb(0x64, 0xFE);
halt_loop();
-}
+} \ No newline at end of file
diff --git a/src/kernel/acpi/acpi.h b/src/kernel/acpi/acpi.h
index 9c8e369..1d3905f 100644
--- a/src/kernel/acpi/acpi.h
+++ b/src/kernel/acpi/acpi.h
@@ -77,4 +77,4 @@ struct FADT *fadt;
struct HPET *hpet;
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/boot.asm b/src/kernel/boot.asm
index 58ee8d6..06411ea 100644
--- a/src/kernel/boot.asm
+++ b/src/kernel/boot.asm
@@ -56,4 +56,4 @@ section .text
section .end_section
global ASM_KERNEL_END
ASM_KERNEL_END:
- ; Kernel size detection
+ ; Kernel size detection \ No newline at end of file
diff --git a/src/kernel/cmos/rtc.c b/src/kernel/cmos/rtc.c
index 7c7bfbe..13185b7 100644
--- a/src/kernel/cmos/rtc.c
+++ b/src/kernel/cmos/rtc.c
@@ -90,4 +90,4 @@ void write_time()
{
read_rtc();
printf("Current time: %d:%d:%d %d/%d/%d\n", hour, minute, second, month, day, year);
-}
+} \ No newline at end of file
diff --git a/src/kernel/cmos/rtc.h b/src/kernel/cmos/rtc.h
index 82ff86c..ca80f4f 100644
--- a/src/kernel/cmos/rtc.h
+++ b/src/kernel/cmos/rtc.h
@@ -12,4 +12,4 @@ void read_rtc();
void write_time();
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/fs/ata_pio.c b/src/kernel/fs/ata_pio.c
index 1786e66..0bd64a5 100644
--- a/src/kernel/fs/ata_pio.c
+++ b/src/kernel/fs/ata_pio.c
@@ -139,4 +139,4 @@ uint8_t ata_clear28(struct ata_interface *interface, uint32_t sector)
{
uint8_t empty_sector[512] = { 0 };
return ata_write28(interface, sector, empty_sector);
-}
+} \ No newline at end of file
diff --git a/src/kernel/fs/ata_pio.h b/src/kernel/fs/ata_pio.h
index bb62805..7fd45e2 100644
--- a/src/kernel/fs/ata_pio.h
+++ b/src/kernel/fs/ata_pio.h
@@ -28,4 +28,4 @@ uint8_t ata_write28(struct ata_interface *interface, uint32_t sector, const uint
uint8_t ata_clear28(struct ata_interface *interface, uint32_t sector);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/fs/atapi_pio.h b/src/kernel/fs/atapi_pio.h
index b7ddee8..1897d53 100644
--- a/src/kernel/fs/atapi_pio.h
+++ b/src/kernel/fs/atapi_pio.h
@@ -23,4 +23,4 @@ void ATAPI_read(uint16_t nblocks, uint32_t lba);
void ATAPI_granular_read(uint32_t nblocks, uint32_t lba, uint8_t *output);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/fs/elf.h b/src/kernel/fs/elf.h
index 5088962..ea8493b 100644
--- a/src/kernel/fs/elf.h
+++ b/src/kernel/fs/elf.h
@@ -50,4 +50,4 @@ typedef struct {
void elf_init();
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/fs/elfloader.c b/src/kernel/fs/elfloader.c
index 118a882..fa537f6 100644
--- a/src/kernel/fs/elfloader.c
+++ b/src/kernel/fs/elfloader.c
@@ -58,4 +58,4 @@ void elf_init()
elfloader->probe = (void *)elf_probe;
elfloader->start = (void *)elf_start;
register_loader(elfloader);
-}
+} \ No newline at end of file
diff --git a/src/kernel/fs/install.c b/src/kernel/fs/install.c
index b4f5275..d8ac121 100644
--- a/src/kernel/fs/install.c
+++ b/src/kernel/fs/install.c
@@ -91,4 +91,4 @@ void install_melvix()
// timer_wait(200);
acpi_poweroff();
halt_loop();
-}
+} \ No newline at end of file
diff --git a/src/kernel/fs/install.h b/src/kernel/fs/install.h
index 8475297..6e3ec7a 100644
--- a/src/kernel/fs/install.h
+++ b/src/kernel/fs/install.h
@@ -3,4 +3,4 @@
void install_melvix();
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/fs/iso9660/iso9660.h b/src/kernel/fs/iso9660/iso9660.h
index 9ba9cfa..6b2e0b0 100644
--- a/src/kernel/fs/iso9660/iso9660.h
+++ b/src/kernel/fs/iso9660/iso9660.h
@@ -19,4 +19,4 @@ struct iso9660_entity *ISO9660_get(char **dirs, uint8_t dirs_sz);
uint8_t *ISO9660_read(struct iso9660_entity *entity);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/fs/load.c b/src/kernel/fs/load.c
index 9eaa556..d6451c7 100644
--- a/src/kernel/fs/load.c
+++ b/src/kernel/fs/load.c
@@ -80,4 +80,4 @@ uint8_t exec_start(uint8_t *buf)
}
}
return 0;
-}
+} \ No newline at end of file
diff --git a/src/kernel/fs/load.h b/src/kernel/fs/load.h
index 468501c..0343092 100644
--- a/src/kernel/fs/load.h
+++ b/src/kernel/fs/load.h
@@ -32,4 +32,4 @@ uint8_t exec_start(uint8_t *buf);
uint32_t loader_get_unused_load_location();
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/fs/marfs/directory.c b/src/kernel/fs/marfs/directory.c
index f4a5b04..099746a 100644
--- a/src/kernel/fs/marfs/directory.c
+++ b/src/kernel/fs/marfs/directory.c
@@ -60,4 +60,4 @@ void marfs_add_to_dir(uint32_t lba_inode, char *filename, uint32_t lba)
inode->size = new_size;
ata_write28(interface, lba_inode, (uint8_t *)inode);
kfree(inode);
-}
+} \ No newline at end of file
diff --git a/src/kernel/fs/marfs/disklevel.c b/src/kernel/fs/marfs/disklevel.c
index f814f80..7dc77ea 100644
--- a/src/kernel/fs/marfs/disklevel.c
+++ b/src/kernel/fs/marfs/disklevel.c
@@ -23,4 +23,4 @@ void marfs_format(void)
// Initialize the chunks
for (uint32_t i = 0; i < sb.n_chunks; i++)
ata_clear28(interface, sb.s_first_chunk + i * 512);
-}
+} \ No newline at end of file
diff --git a/src/kernel/fs/marfs/marfs.h b/src/kernel/fs/marfs/marfs.h
index f2dfa1c..12d036e 100644
--- a/src/kernel/fs/marfs/marfs.h
+++ b/src/kernel/fs/marfs/marfs.h
@@ -72,4 +72,4 @@ void marfs_read_whole_file(uint32_t lba_inode, uint8_t *buffer);
uint8_t *marfs_allocate_and_read_whole_file(uint32_t lba_inode);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/fs/vfs.c b/src/kernel/fs/vfs.c
index 9aeadf0..f97a69b 100644
--- a/src/kernel/fs/vfs.c
+++ b/src/kernel/fs/vfs.c
@@ -44,4 +44,4 @@ fs_node_t *finddir_fs(fs_node_t *node, char *name)
return node->finddir(node, name);
else
return 0;
-}
+} \ No newline at end of file
diff --git a/src/kernel/fs/vfs.h b/src/kernel/fs/vfs.h
index 80b854a..4c92185 100644
--- a/src/kernel/fs/vfs.h
+++ b/src/kernel/fs/vfs.h
@@ -62,4 +62,4 @@ struct dirent *readdir_fs(fs_node_t *node, uint32_t index);
fs_node_t *finddir_fs(fs_node_t *node, char *name);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/gdt/gdt.h b/src/kernel/gdt/gdt.h
index 0e77103..5c6ae61 100644
--- a/src/kernel/gdt/gdt.h
+++ b/src/kernel/gdt/gdt.h
@@ -12,4 +12,4 @@ void tss_flush();
void set_kernel_stack(uintptr_t stack);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c
index 45a68d9..71e8de6 100644
--- a/src/kernel/graphics/vesa.c
+++ b/src/kernel/graphics/vesa.c
@@ -375,4 +375,4 @@ void vesa_set_color(uint32_t color)
{
vesa_convert_color(terminal_color, color);
vesa_convert_color(terminal_background, default_background_color);
-}
+} \ No newline at end of file
diff --git a/src/kernel/graphics/vesa.h b/src/kernel/graphics/vesa.h
index 684d72c..c45be19 100644
--- a/src/kernel/graphics/vesa.h
+++ b/src/kernel/graphics/vesa.h
@@ -255,4 +255,4 @@ unsigned char *fb;
unsigned char *cursor_buffer;
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/input/input.h b/src/kernel/input/input.h
index bacfaaa..9dc9276 100644
--- a/src/kernel/input/input.h
+++ b/src/kernel/input/input.h
@@ -18,4 +18,4 @@ char keyboard_char_buffer;
char *keyboard_buffer;
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/input/ps2/keyboard.c b/src/kernel/input/ps2/keyboard.c
index 886786b..b23d1bc 100644
--- a/src/kernel/input/ps2/keyboard.c
+++ b/src/kernel/input/ps2/keyboard.c
@@ -142,4 +142,4 @@ void keyboard_install()
irq_install_handler(1, keyboard_handler);
shift_pressed = 0;
info("Installed keyboard handler");
-}
+} \ No newline at end of file
diff --git a/src/kernel/interact.asm b/src/kernel/interact.asm
index e2b7805..59fbfe7 100644
--- a/src/kernel/interact.asm
+++ b/src/kernel/interact.asm
@@ -191,4 +191,4 @@ section .text
dw gdt16_ptr - gdt16_base - 1 ; table limit (size)
dd gdt16_base ; table base address
- int32_end: ; end marker (so we can copy the code)
+ int32_end: ; end marker (so we can copy the code) \ No newline at end of file
diff --git a/src/kernel/io/io.c b/src/kernel/io/io.c
index 1f67c11..803a78a 100644
--- a/src/kernel/io/io.c
+++ b/src/kernel/io/io.c
@@ -74,4 +74,4 @@ void serial_put(char ch)
while (is_transmit_empty() == 0)
;
outb(0x3f8, (uint8_t)ch);
-}
+} \ No newline at end of file
diff --git a/src/kernel/io/io.h b/src/kernel/io/io.h
index 7d09dcb..50e9c6f 100644
--- a/src/kernel/io/io.h
+++ b/src/kernel/io/io.h
@@ -60,4 +60,4 @@ void init_serial();
*/
void serial_put(char ch);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index 9a87579..e5cb666 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -67,4 +67,4 @@ void kernel_main(uint32_t initial_stack)
panic("This should NOT happen!");
// asm ("div %0" :: "r"(0)); // Exception testing x/0
-}
+} \ No newline at end of file
diff --git a/src/kernel/lib/lib.h b/src/kernel/lib/lib.h
index e94ad19..b2b7056 100644
--- a/src/kernel/lib/lib.h
+++ b/src/kernel/lib/lib.h
@@ -35,4 +35,4 @@ void memory_init();
uint32_t memory_get_all();
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/lib/math.h b/src/kernel/lib/math.h
index c9abf7d..57877ad 100644
--- a/src/kernel/lib/math.h
+++ b/src/kernel/lib/math.h
@@ -3,4 +3,4 @@
int pow(int base, int exp);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/lib/memory.c b/src/kernel/lib/memory.c
index 9ffd330..f9e0054 100644
--- a/src/kernel/lib/memory.c
+++ b/src/kernel/lib/memory.c
@@ -66,4 +66,4 @@ uint32_t memory_get_free()
uint32_t memory_get_all()
{
return total_memory;
-}
+} \ No newline at end of file
diff --git a/src/kernel/lib/stdio.h b/src/kernel/lib/stdio.h
index 8299dea..e1d7b9a 100644
--- a/src/kernel/lib/stdio.h
+++ b/src/kernel/lib/stdio.h
@@ -15,4 +15,4 @@ void printf(const char *fmt, ...);
void serial_printf(const char *fmt, ...);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/lib/stdlib.h b/src/kernel/lib/stdlib.h
index 9cd9fab..18d933d 100644
--- a/src/kernel/lib/stdlib.h
+++ b/src/kernel/lib/stdlib.h
@@ -17,4 +17,4 @@ char *htoa(uint32_t n);
int htoi(char *str);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/lib/string.h b/src/kernel/lib/string.h
index fe925cb..7375953 100644
--- a/src/kernel/lib/string.h
+++ b/src/kernel/lib/string.h
@@ -19,4 +19,4 @@ char *strdup(const char *orig);
void strinv(char *str);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/linker.ld b/src/kernel/linker.ld
index 192c86e..50edc46 100644
--- a/src/kernel/linker.ld
+++ b/src/kernel/linker.ld
@@ -24,4 +24,4 @@ SECTIONS {
.end_section BLOCK(4K) : ALIGN(4K) {
*(.end_section)
}
-}
+} \ No newline at end of file
diff --git a/src/kernel/memory/alloc.c b/src/kernel/memory/alloc.c
index 078d43b..174f298 100644
--- a/src/kernel/memory/alloc.c
+++ b/src/kernel/memory/alloc.c
@@ -476,4 +476,4 @@ void *PREFIX(realloc)(void *p, size_t size)
PREFIX(free)(p);
return ptr;
-}
+} \ No newline at end of file
diff --git a/src/kernel/net/network.h b/src/kernel/net/network.h
index 3c8e130..b2a2696 100644
--- a/src/kernel/net/network.h
+++ b/src/kernel/net/network.h
@@ -10,4 +10,4 @@ void network_install()
#endif
}
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/pci/pci.h b/src/kernel/pci/pci.h
index 4cf6633..6c14dfd 100644
--- a/src/kernel/pci/pci.h
+++ b/src/kernel/pci/pci.h
@@ -105,4 +105,4 @@ void pci_remap();
int pci_get_interrupt(uint32_t device);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/smbios/smbios.c b/src/kernel/smbios/smbios.c
index 748a2a6..a3224bf 100644
--- a/src/kernel/smbios/smbios.c
+++ b/src/kernel/smbios/smbios.c
@@ -50,4 +50,4 @@ void smbios_table(struct smbios_header *header)
{
// struct smbios_0 *table = (struct smbios_0 *) (header + sizeof(struct smbios_header));
// serial_printf("\n\n %d", table->bios_version);
-}
+} \ No newline at end of file
diff --git a/src/kernel/smbios/smbios.h b/src/kernel/smbios/smbios.h
index 204293b..4485f3e 100644
--- a/src/kernel/smbios/smbios.h
+++ b/src/kernel/smbios/smbios.h
@@ -46,4 +46,4 @@ struct smbios_entry *get_smbios();
void smbios_table(struct smbios_header *header);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/sound/sound.h b/src/kernel/sound/sound.h
index 312f0d8..44ec6f5 100644
--- a/src/kernel/sound/sound.h
+++ b/src/kernel/sound/sound.h
@@ -10,4 +10,4 @@
*/
void beep(uint32_t frequency, uint32_t ticks);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/system.c b/src/kernel/system.c
index d6dadc1..b58472b 100644
--- a/src/kernel/system.c
+++ b/src/kernel/system.c
@@ -131,4 +131,4 @@ void v86(uint8_t code, regs16_t *regs)
paging_disable();
int32(code, regs);
paging_enable();
-}
+} \ No newline at end of file
diff --git a/src/kernel/system.h b/src/kernel/system.h
index 062a880..687649f 100644
--- a/src/kernel/system.h
+++ b/src/kernel/system.h
@@ -95,4 +95,4 @@ void halt_loop();
*/
void v86(uint8_t code, regs16_t *regs);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/tasks/task.c b/src/kernel/tasks/task.c
index 3abcaca..036c5d4 100644
--- a/src/kernel/tasks/task.c
+++ b/src/kernel/tasks/task.c
@@ -174,4 +174,4 @@ void exec(uint32_t binary)
: "r"(binary));
// syscall_write("test");
-}
+} \ No newline at end of file
diff --git a/src/kernel/tasks/task.h b/src/kernel/tasks/task.h
index 081b001..8652e44 100644
--- a/src/kernel/tasks/task.h
+++ b/src/kernel/tasks/task.h
@@ -27,4 +27,4 @@ int getpid();
void exec(uint32_t binary);
-#endif
+#endif \ No newline at end of file
diff --git a/src/kernel/timer/timer.h b/src/kernel/timer/timer.h
index 30256d9..389da6b 100644
--- a/src/kernel/timer/timer.h
+++ b/src/kernel/timer/timer.h
@@ -18,4 +18,4 @@ void timer_wait(int ticks);
*/
unsigned int get_time();
-#endif
+#endif \ No newline at end of file
diff --git a/src/resources/conv.sh b/src/resources/conv.sh
index ff922dd..d323021 100755
--- a/src/resources/conv.sh
+++ b/src/resources/conv.sh
@@ -11,8 +11,8 @@ mkdir font
cd font || exit
wget $font_url -O temp.bdf
bdf2c -C font.h
-bdf2c -b < temp.bdf > temp.c
-gcc -E -CC temp.c > final.h
+bdf2c -b <temp.bdf >temp.c
+gcc -E -CC temp.c >final.h
sed -i -e 1,74d final.h
sed -i -e :a -e '$d;N;2,1533ba' -e 'P;D' final.h
diff --git a/src/userspace/main.c b/src/userspace/main.c
index cdd4130..2e4178a 100644
--- a/src/userspace/main.c
+++ b/src/userspace/main.c
@@ -16,4 +16,4 @@ void main()
char test[] = "banane";
syscall_write(test);
syscall_halt();
-}
+} \ No newline at end of file
diff --git a/src/userspace/mlibc/math.h b/src/userspace/mlibc/math.h
index c9abf7d..57877ad 100644
--- a/src/userspace/mlibc/math.h
+++ b/src/userspace/mlibc/math.h
@@ -3,4 +3,4 @@
int pow(int base, int exp);
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/mlibc/stdio.h b/src/userspace/mlibc/stdio.h
index d102dd6..b44a9b7 100644
--- a/src/userspace/mlibc/stdio.h
+++ b/src/userspace/mlibc/stdio.h
@@ -13,4 +13,4 @@ void vprintf(const char *format, va_list args);
void printf(const char *format, ...);
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/mlibc/stdlib.h b/src/userspace/mlibc/stdlib.h
index 36a3b5f..3ccdec2 100644
--- a/src/userspace/mlibc/stdlib.h
+++ b/src/userspace/mlibc/stdlib.h
@@ -23,4 +23,4 @@ char *htoa(uint32_t n);
int htoi(char *str);
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/mlibc/stdlib/liballoc.c b/src/userspace/mlibc/stdlib/liballoc.c
index 0b62f9a..e57a5e2 100644
--- a/src/userspace/mlibc/stdlib/liballoc.c
+++ b/src/userspace/mlibc/stdlib/liballoc.c
@@ -9,4 +9,4 @@ void *malloc(size_t count)
void free(void *ptr)
{
syscall_free((uint32_t)ptr);
-}
+} \ No newline at end of file
diff --git a/src/userspace/mlibc/stdlib/liballoc.h b/src/userspace/mlibc/stdlib/liballoc.h
index d9d08ee..64b7cce 100644
--- a/src/userspace/mlibc/stdlib/liballoc.h
+++ b/src/userspace/mlibc/stdlib/liballoc.h
@@ -7,4 +7,4 @@ void *malloc(size_t);
void free(void *);
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/mlibc/string.h b/src/userspace/mlibc/string.h
index 153b7cb..ad0858d 100644
--- a/src/userspace/mlibc/string.h
+++ b/src/userspace/mlibc/string.h
@@ -25,4 +25,4 @@ void *memset(void *dest, char val, size_t count);
int memcmp(const void *a_ptr, const void *b_ptr, size_t size);
-#endif
+#endif \ No newline at end of file
diff --git a/src/userspace/syscall.c b/src/userspace/syscall.c
index c147703..9462b10 100644
--- a/src/userspace/syscall.c
+++ b/src/userspace/syscall.c
@@ -17,4 +17,4 @@ DEFN_SYSCALL0(get_pointers, 5);
DEFN_SYSCALL1(alloc, 6, uint32_t);
-DEFN_SYSCALL1(free, 7, uint32_t);
+DEFN_SYSCALL1(free, 7, uint32_t); \ No newline at end of file