Page 3 of 3
Re:How to use cross-compiler on Brian Tutorial
Posted: Tue Jun 20, 2006 10:44 am
by Candamir
Well, if you want to know if it worked... just put it on a boot disk (there is a boot disk image in the zip from bkerndev) and see if everything's ok. You should be able to input text from your keyboard and every second, a message should appear on the screen.
Candamir
Re:How to use cross-compiler on Brian Tutorial
Posted: Tue Jun 20, 2006 6:05 pm
by jason7007
Hi,
Candamir, thank you very much. I will do your suggestion.
Posted: Fri Oct 26, 2007 4:36 pm
by Pixion
Hi,
I went through the same stages, but on a Mac.
Here a wrap up that is working for me:
-I assume you have a working cross-compiler and binutils (target: ELF)
-As mentioned earlier in this thread, the leading underscores in the start.asm need to be removed (all of them!) as otherwise they result in 'undefined' functions or variables.
-change, as mentioned the linker script (see attached)
-Also, as the output file is ELF and not aout formatted (as Brian's kernel is assuming), start.asm need a few more changes, see attachement.
-Further, make sure you use the -f elf option in nasm, and not the -f aout option (again, we need an ELF file, not a aout)
-A batch file can easily be transferred to a build.sh script, see attachement.
-Also, using the cross-binutil objdump -f or -h can be used to check the correct ELF format of all generated intermediate .o files, respectively, verify wether symbols are defined in thos object files. Also, if you move through the tutorial, and add more *.c sources, make sure you add the resulting *. files to the command line of the linker! Otherwise, you get again 'undefined function' build errors.
Hope this helps,
Sebastian