Make it run on Linux.

This commit is contained in:
Alexander Myltsev 2022-11-25 09:18:38 +00:00
parent 7a2cc02ba8
commit 2e56f726c3
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,8 @@
ifeq ($(shell uname -s),Darwin)
AS=x86_64-elf-as AS=x86_64-elf-as
LD=x86_64-elf-ld LD=x86_64-elf-ld
CC=x86_64-elf-gcc CC=x86_64-elf-gcc
endif
run: image.bin run: image.bin
qemu-system-i386 -drive format=raw,file=$< -serial mon:stdio qemu-system-i386 -drive format=raw,file=$< -serial mon:stdio

View File

@ -60,7 +60,8 @@ int main(int argc, char* argv[]) {
} }
dirent->reserved = 0; dirent->reserved = 0;
strlcpy(dirent->name, basename(name), sizeof(dirent->name)); dirent->name[sizeof(dirent->name) - 1] = '\0';
strncpy(dirent->name, basename(name), sizeof(dirent->name) - 1);
} }
fseek(image, 0, SEEK_SET); fseek(image, 0, SEEK_SET);