Bug when printing...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Bug when printing...

Post by Combuster »

Glad that you got it working

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'
There are two errors here. One is the "#pragma starts nethack" (GCC has an official replacement for packed structures), and the linker error is caused by some inefficient C usage. The rest of the warnings are for you to decide to act on. Getting around that and the missing base image, the thing just works as expected.

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!
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
benjii
Posts: 14
Joined: Sat Oct 20, 2012 3:27 pm

Re: Bug when printing...

Post by benjii »

Thanks a lot for the help! I'll look at these warnings tomorrow... Perhaps I should add more CFLAGS so I won't miss such an obvious warnings...
Post Reply