I'm using mtools for your exactly those things you seem need for images - you can have it embed a bootsector while it creates the FAT filesystem (and even put the right values in the BPB). It also saves you from calls to sudo as it can move files in, out and around images without mounting them. (you can find an example in my platform configuration file)
Other than that, it seems like you're already depending on features of your host compiler:
Code: Select all
In file included from loader/booter/i386.c:1:
include/types.h:8:7: warning: no newline at end of file
In file included from loader/booter/i386.c:3:
loader/booter/include/idt.h:53:7: warning: no newline at end of file
loader/booter/i386.c:7: warning: #pragma pack(push[, id], <n>) is not supported on this target
loader/booter/i386.c:29: warning: #pragma pack(pop[, id], <n>) is not supported on this target
In file included from loader/booter/pic.c:1:
include/types.h:8:7: warning: no newline at end of file
loader/booter/pic.c:14: warning: 'inb' defined but not used
In file included from loader/booter/include/i386.h:4,
from loader/booter/main.c:1:
include/types.h:8:7: warning: no newline at end of file
loader/booter/main.c: In function 'kmain':
loader/booter/main.c:6: warning: implicit declaration of function 'init_printf'
loader/booter/main.c:5: warning: unused parameter 'argc'
loader/booter/main.c:5: warning: unused parameter 'argv'
include/clib/printf.c: In function 'dectohex':
include/clib/printf.c:15: warning: implicit declaration of function '_memset'
include/clib/printf.c:21: warning: implicit declaration of function 'reverse'
include/clib/printf.c: In function '_printf':
include/clib/printf.c:48: warning: implicit declaration of function '_strcpy'
include/clib/printf.c:29: warning: unused variable 'y'
i386.o: In function `i386_isrs_install':
i386.c:(.text+0x71): undefined reference to `memcpy'
Regarding Makefiles, the wiki has quite a nice tutorial on their effective use.
I hope you can use that to get a bit further. Happy coding!