Closed saurabh-ss closed 1 year ago
Make these changes to fix the build error. Instead of using linux tools to format a FAT16 filesystem, this will have QEMU emulate it. Shouldn't require any dependencies. The warning is...todo.
diff --git a/Makefile b/Makefile
index 359999d..81ab76f 100644
--- a/Makefile
+++ b/Makefile
@@ -29,11 +29,11 @@ $(target_dir)/_disk_image: $(kernel)
sudo cp -r base/* $(target_dir)/mnt
sudo umount $(target_dir)/mnt
-run: $(kernel) $(target_dir)/_disk_image
+run: $(kernel)
@qemu-system-i386$(qemu_exe) -kernel $< \
-m 2g \
-serial stdio \
- -drive file=$(target_dir)/_disk_image,format=raw,media=disk,cache=writethrough
+ -drive file=fat:rw:base,format=raw,media=disk,cache=writethrough
# TODO: Disk flush? (remove cache=writethrough)
always: ;
Worked.
extern
block uses typeFATFileSystem
, which is not FFI-safe --> src/main.rs:68:23note: the type is defined here --> src/fat.rs:204:1 | 204 | pub struct FATFileSystem { | ^^^^^^^^^^^^^^^^^^^^^^^^ = note:
#[warn(improper_ctypes)]
on by defaultwarning:
ivy
(bin "ivy") generated 1 warning Finished dev [unoptimized + debuginfo] target(s) in 10.52s`extern
block uses typeFATFileSystem
, which is not FFI-safe --> src/main.rs:68:23note: the type is defined here --> src/fat.rs:204:1 | 204 | pub struct FATFileSystem { | ^^^^^^^^^^^^^^^^^^^^^^^^ = note:
#[warn(improper_ctypes)]
on by defaultwarning:
ivy
(bin "ivy") generated 1 warning Finished dev [unoptimized + debuginfo] target(s) in 0.02s qemu-img"" create -f raw target/kernel/_disk_image 1g Formatting 'target/kernel/_disk_image', fmt=raw size=1073741824 mkfs.fat -F 16 target/kernel/_disk_image make: mkfs.fat: No such file or directory make: *** [Makefile:26: target/kernel/_disk_image] Error 127