takeharukato / sample-tsk-sw

A Sample Operating System Kernel for Embedded Systems
Other
14 stars 3 forks source link

Compilation on Debian machine #2

Closed S-YOU closed 6 years ago

S-YOU commented 6 years ago

お疲れ様です。本日発表ありがとうございました。 Debianで実行したエラーログを添付します。 優先度は低いのでお時間ある時見ていただければと思います。 あまり詳しくないので単純なコンパイルミスしている可能性もありますが、 どうぞ宜しくおねがいします。

ログ ``` debian [master] ~/repo/c/sample-tsk-sw/ % uname -a Linux debian 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 GNU/Linux debian [master] ~/repo/c/sample-tsk-sw/ % gcc --version gcc (Debian 7.3.0-21) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. debian [master] ~/repo/c/sample-tsk-sw/ % ld --version GNU ld (GNU Binutils for Debian) 2.30 Copyright (C) 2018 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. debian [master] ~/repo/c/sample-tsk-sw/ % git checkout . debian [master] ~/repo/c/sample-tsk-sw/ % debian [master] ~/repo/c/sample-tsk-sw/ % make clean for dir in include common kern dev hal user tools configs ; do \ make -C ${dir} clean ;\ done make[1]: Entering directory '/media/sf_c/sample-tsk-sw/include' rm -f hal ln -s hal-`uname -m|sed -e "s/x86-64/x64/" -e "s/amd64/x64/" -e "s/x86_64/x64/" -e "s/i?86/ia32/"` hal for dir in kern hal ; do \ make -C ${dir} clean ;\ done make[2]: Entering directory '/media/sf_c/sample-tsk-sw/include/kern' make[2]: Nothing to be done for 'clean'. make[2]: Leaving directory '/media/sf_c/sample-tsk-sw/include/kern' make[2]: Entering directory '/media/sf_c/sample-tsk-sw/include/hal-x64' make[2]: Nothing to be done for 'clean'. make[2]: Leaving directory '/media/sf_c/sample-tsk-sw/include/hal-x64' make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/include' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/common' rm -f *.o libcommon.a make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/common' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/kern' rm -f *.o libkern.a make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/kern' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/dev' rm -f *.o libdev.a make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/dev' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/hal' rm -f hal ln -s `uname -m|sed -e "s/x86-64/x64/" -e "s/amd64/x64/" -e "s/x86_64/x64/" -e "s/i?86/ia32/"` hal make -C hal clean make[2]: Entering directory '/media/sf_c/sample-tsk-sw/hal/x64' rm -f *.o libhal.a vector.S asm-offset.s ../../include/hal/asm-offset.h make[2]: Leaving directory '/media/sf_c/sample-tsk-sw/hal/x64' make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/hal' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/user' rm -f *.o libuser.a make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/user' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/tools' for dir in gdb shell asmoffset templates x64 ; do \ make -C ${dir} distclean; \ done make[2]: Entering directory '/media/sf_c/sample-tsk-sw/tools/gdb' rm -f *~ make[2]: Leaving directory '/media/sf_c/sample-tsk-sw/tools/gdb' make[2]: Entering directory '/media/sf_c/sample-tsk-sw/tools/shell' rm -f *~ make[2]: Leaving directory '/media/sf_c/sample-tsk-sw/tools/shell' make[2]: Entering directory '/media/sf_c/sample-tsk-sw/tools/asmoffset' rm -f *~ make[2]: Leaving directory '/media/sf_c/sample-tsk-sw/tools/asmoffset' make[2]: Entering directory '/media/sf_c/sample-tsk-sw/tools/templates' rm -f *~ make[2]: Leaving directory '/media/sf_c/sample-tsk-sw/tools/templates' make[2]: Entering directory '/media/sf_c/sample-tsk-sw/tools/x64' rm -f *~ make[2]: Leaving directory '/media/sf_c/sample-tsk-sw/tools/x64' cd kconfig && make clean make[2]: Entering directory '/media/sf_c/sample-tsk-sw/tools/kconfig' make[2]: Warning: File 'Rules.mak' has modification time 4.6 s in the future rm -f lkc_defs.h qconf.moc .tmp_qtcheck .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h mconf qconf gconf config.pot linux.pot conf make[2]: warning: Clock skew detected. Your build may be incomplete. make[2]: Leaving directory '/media/sf_c/sample-tsk-sw/tools/kconfig' make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/tools' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/configs' make[1]: Nothing to be done for 'clean'. make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/configs' rm -f *.o kernel.elf kernel-dbg.elf kernel.asm kernel.map *.tmp *.elf *.asm *.map *.iso debian [master] ~/repo/c/sample-tsk-sw/ % make make -C include hal make[1]: Entering directory '/media/sf_c/sample-tsk-sw/include' rm -f hal ln -s hal-`uname -m|sed -e "s/x86-64/x64/" -e "s/amd64/x64/" -e "s/x86_64/x64/" -e "s/i?86/ia32/"` hal make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/include' make -C hal hal make[1]: Entering directory '/media/sf_c/sample-tsk-sw/hal' rm -f hal ln -s `uname -m|sed -e "s/x86-64/x64/" -e "s/amd64/x64/" -e "s/x86_64/x64/" -e "s/i?86/ia32/"` hal make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/hal' make -C configs hal make[1]: Entering directory '/media/sf_c/sample-tsk-sw/configs' rm -f hal ln -s `uname -m|sed -e "s/x86-64/x64/" -e "s/amd64/x64/" -e "s/x86_64/x64/" -e "s/i?86/ia32/"` hal make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/configs' for dir in common kern dev hal user ; do \ make -C ${dir} ;\ done make[1]: Entering directory '/media/sf_c/sample-tsk-sw/common' gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o bitops.o bitops.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o string.o string.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o malloc.o malloc.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o heap.o heap.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o list.o list.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o printf.o printf.c ar rvc libcommon.a bitops.o string.o malloc.o heap.o list.o printf.o a - bitops.o a - string.o a - malloc.o a - heap.o a - list.o a - printf.o ranlib libcommon.a make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/common' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/kern' gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o psw.o psw.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o thread.o thread.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o ready_queue.o ready_queue.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o sched.o sched.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o idle.o idle.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o wqueue.o wqueue.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o reaper.o reaper.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o mutex.o mutex.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o pconsole.o pconsole.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o irq.o irq.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o timer.o timer.c ar rvc libkern.a psw.o thread.o ready_queue.o sched.o idle.o wqueue.o reaper.o mutex.o pconsole.o irq.o timer.o a - psw.o a - thread.o a - ready_queue.o a - sched.o a - idle.o a - wqueue.o a - reaper.o a - mutex.o a - pconsole.o a - irq.o a - timer.o ranlib libkern.a gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o main.o main.c make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/kern' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/dev' gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o kconsole.o kconsole.c ar rvc libdev.a kconsole.o a - kconsole.o ranlib libdev.a make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/dev' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/hal' rm -f hal ln -s `uname -m|sed -e "s/x86-64/x64/" -e "s/amd64/x64/" -e "s/x86_64/x64/" -e "s/i?86/ia32/"` hal make -C hal make[2]: Entering directory '/media/sf_c/sample-tsk-sw/hal/x64' gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -S -o asm-offset.s asm-offset.c ../../tools/asmoffset/gen-asm-offset.py \ -i ../../hal/hal/asm-offset.s \ -o ../../include/hal/asm-offset.h gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o thr_context.o thr_context.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o ctxsw_glue.o ctxsw_glue.S gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o boot.o boot.S gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o boot64.o boot64.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o data.o data.S gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o early_console.o early_console.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o kmap.o kmap.c rm -f vector.S ../../tools/x64/gen-vec.py > vector.S gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o vector.o vector.S gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o segments.o segments.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o idt.o idt.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o lgdtr.o lgdtr.S gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o ltr.o ltr.S gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o lidtr.o lidtr.S gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o traps.o traps.S gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o exception.o exception.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o i8259.o i8259.c gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../../include -c -o i8254.o i8254.c ar rvc libhal.a thr_context.o ctxsw_glue.o boot.o boot64.o data.o early_console.o kmap.o vector.o segments.o idt.o lgdtr.o ltr.o lidtr.o traps.o exception.o i8259.o i8254.o a - thr_context.o a - ctxsw_glue.o a - boot.o a - boot64.o a - data.o a - early_console.o a - kmap.o a - vector.o a - segments.o a - idt.o a - lgdtr.o a - ltr.o a - lidtr.o a - traps.o a - exception.o a - i8259.o a - i8254.o ranlib libhal.a make[2]: Leaving directory '/media/sf_c/sample-tsk-sw/hal/x64' make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/hal' make[1]: Entering directory '/media/sf_c/sample-tsk-sw/user' gcc -O0 -g -Wall -ffreestanding -m64 -mcmodel=large -mno-red-zone -mno-aes -mno-avx -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls -mtune=generic -I../include -c -o user.o user.c ar rvc libuser.a user.o a - user.o ranlib libuser.a make[1]: Leaving directory '/media/sf_c/sample-tsk-sw/user' gcc -Wl,-z,max-page-size=0x1000 -Wl,--build-id=none \ -nostdlib -T hal/hal/kernel.lds \ -o kernel-dbg.elf hal/hal/boot.o kern/main.o \ -Wl,--start-group user/libuser.a kern/libkern.a common/libcommon.a dev/libdev.a hal/hal/libhal.a -Wl,--end-group /usr/bin/ld: hal/hal/boot.o: relocation R_X86_64_32 against undefined symbol `__bss_start' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status Makefile:44: recipe for target 'kernel-dbg.elf' failed make: *** [kernel-dbg.elf] Error 1 ```
takeharukato commented 6 years ago

加藤です。

詳細ログありがとうございます。 原因は、分かったと思います。 gccのバージョンが新しくなって(7系からかな), --enable-default-pieつきでgccが構築されているのが原因で 位置独立コードが生成されるようです。 -fno-pie 今のgccならを付けろと言うことでしょうね。 ありがとうございます。やってみます。

takeharukato commented 6 years ago

gccのバージョンが新しくなってというよりDebianやGentooのgccの構築方針が, この方針のようですね。

takeharukato commented 6 years ago

commit 221c41f8015c46c9b1ab5d3ced81cadbd8c08784 で-fno-pieをデフォルトに設定するようにしてみました。 手元にgcc-7.Xで, かつ, --enable-default-pieでコンパイルされたgccがないのですぐには試せないのですが、よろしければお試しいただけるとありがたく存じます。

takeharukato commented 6 years ago

Debian環境を入れて追跡してみました。 最終的に, -staticを明示しつつ, -fno-pic -fno-PIC(念のため)と-fno-pie(さらに念のため、多分要らないけども)を付けるようにしてコンパイルできることを確認しました。

gcc -static -fno-pie -fno-pic -fno-PIC -Wl,-z,max-page-size=0x1000 -Wl,--build-id=none \ -nostdlib -T hal/hal/kernel.lds \ -o kernel-dbg.elf hal/hal/boot.o kern/main.o \ -Wl,--start-group user/libuser.a kern/libkern.a common/libcommon.a dev/libdev.a hal/hal/libhal.a -Wl,--end-group cp kernel-dbg.elf kernel.elf strip -g kernel.elf rm -f kernel.asm objdump -S kernel.elf > kernel.asm rm -f kernel.map nm kernel.elf |sort > kernel.map

takeharukato commented 6 years ago

なお、make runをするときに make run GRUB2_RESCUE=grub-mkrescue を指定して下さい。Debianの場合は, grub2-mkrescueではなくgrub-mkrescueらしいです。 あと, 多分実施済みと思われますが、 apt-get install build-essential xorriso qemu ncurses-dev をしておかないとコンパイラやライブラリが足らないと思います。

S-YOU commented 6 years ago

早速の対応ありがとうございます。ご指摘のコマンドにて問題なくコンパイルできることは確認しました。

gcc -static -fno-pie -fno-pic -fno-PIC -Wl,-z,max-page-size=0x1000 -Wl,--build-id=none \
-nostdlib -T hal/hal/kernel.lds \
-o kernel-dbg.elf hal/hal/boot.o kern/main.o \
-Wl,--start-group user/libuser.a kern/libkern.a common/libcommon.a dev/libdev.a hal/hal/libhal.a -Wl,--end-group

Makefileのどこかに-static -fno-pie -fno-pic 適用すれば、makeやmake run利用可能という理解で良いでしょうか?

補足のDebian用のライブラリなどもありがとうございます。

takeharukato commented 6 years ago

既に修正をコミットしてあるのでgit pullして,

$ make
$ make run GRUB2_RESCUE=grub-mkrescue

を実行すれば動くと思います。

S-YOU commented 6 years ago

ありがとうございます。make 問題ないこと確認できました。最新版の取得もれでした。 クローズさせていただきます。

takeharukato commented 6 years ago

ご協力感謝いたします。 P.S. IPMSGやってたときもDebianとRHEL系の違いは結構苦労したのを思い出しました。

S-YOU commented 6 years ago

P.S. IPMSGやってたときもDebianとRHEL系の違いは結構苦労したのを思い出しました。

あのIP MessengerをDebian系に移植されたんですね。以前7年間ぐらいNTTでネットワークの仕事をしていたことがあって、その時社内でIP Messengerを使っていました。