compile simple os on linux
Posted: Mon Jul 07, 2008 10:14 am
Hi!
I have a simple OS , which is wrote to compile with nasm and DJGPP , now i want to compile it on linux with nasm and gcc
Here are sources: http://binboy.sphere.pl/down.php?idmk=36
when I compile it on linux i have:
Linux don't uses coff files, so in makefile I chanded:
nasm $*.asm -o $*.o -f coff
now is :
nasm $*.asm -o $*.o -f elf
But is still don't works
How to do this ?
I have a simple OS , which is wrote to compile with nasm and DJGPP , now i want to compile it on linux with nasm and gcc
Here are sources: http://binboy.sphere.pl/down.php?idmk=36
when I compile it on linux i have:
Code: Select all
1. wojtek@wojtek-desktop:~/Pulpit/doc3_files$ make
2. nasm start.asm -o start.o -f coff
3. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o main.o main.c
4. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o intr.o intr.c
5. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o cons.o cons.c
6. nasm irqroute.asm -o irqroute.o -f coff
7. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o kbd.o kbd.c
8. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o sched.o sched.c
9. nasm exc.asm -o exc.o -f coff
10. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o traps.o traps.c
11. ld -Tkernel.ld -o kernel.bin start.o main.o intr.o cons.o irqroute.o kbd.o sched.o exc.o traps.o
12. start.o: file not recognized: File format not recognized
13. make: *** [kernel.bin] Błąd 1
14. wojtek@wojtek-desktop:~/Pulpit/doc3_files$
nasm $*.asm -o $*.o -f coff
now is :
nasm $*.asm -o $*.o -f elf
But is still don't works
Code: Select all
1. wojtek@wojtek-desktop:~/Pulpit/doc3_files$ make
2. nasm start.asm -o start.o -f elf
3. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o main.o main.c
4. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o intr.o intr.c
5. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o cons.o cons.c
6. nasm irqroute.asm -o irqroute.o -f elf
7. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o kbd.o kbd.c
8. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o sched.o sched.c
9. nasm exc.asm -o exc.o -f elf
10. cc -O2 -fomit-frame-pointer -I. -nostdinc -fno-builtin -c -o traps.o traps.c
11. ld -Tkernel.ld -o kernel.bin start.o main.o intr.o cons.o irqroute.o kbd.o sched.o exc.o traps.o
12. start.o: In function `_start.1':
13. start.asm:(.text+0x5f): undefined reference to `_start_kernel'
14. start.o: In function `_irq1':
15. start.asm:(.text+0x7a): undefined reference to `_do_irq1'
16. start.o: In function `_irq0':
17. start.asm:(.text+0x9a): undefined reference to `_do_irq0'
18. main.o: In function `start_kernel':
19. main.c:(.text+0x6a): undefined reference to `irq0'
20. intr.o: In function `set_intr_gate':
21. intr.c:(.text+0x1a): undefined reference to `idt'
22. intr.c:(.text+0x21): undefined reference to `idt'
23. intr.o: In function `set_trap_gate':
24. intr.c:(.text+0x4a): undefined reference to `idt'
25. intr.c:(.text+0x51): undefined reference to `idt'
26. intr.o: In function `set_system_gate':
27. intr.c:(.text+0x7a): undefined reference to `idt'
28. intr.o:intr.c:(.text+0x81): more undefined references to `idt' follow
29. kbd.o: In function `kbd_init':
30. kbd.c:(.text+0x47): undefined reference to `irq1'
31. exc.o: In function `exception_table':
32. exc.asm:(.text+0x0): undefined reference to `_do_exc0'
33. exc.asm:(.text+0x4): undefined reference to `_do_exc1'
34. exc.asm:(.text+0x8): undefined reference to `_do_exc2'
35. exc.asm:(.text+0xc): undefined reference to `_do_exc3'
36. exc.asm:(.text+0x10): undefined reference to `_do_exc4'
37. exc.asm:(.text+0x14): undefined reference to `_do_exc5'
38. exc.asm:(.text+0x18): undefined reference to `_do_exc6'
39. exc.asm:(.text+0x1c): undefined reference to `_do_exc7'
40. exc.asm:(.text+0x20): undefined reference to `_do_exc8'
41. exc.asm:(.text+0x24): undefined reference to `_do_exc9'
42. exc.asm:(.text+0x28): undefined reference to `_do_exc10'
43. exc.asm:(.text+0x2c): undefined reference to `_do_exc11'
44. exc.asm:(.text+0x30): undefined reference to `_do_exc12'
45. exc.asm:(.text+0x34): undefined reference to `_do_exc13'
46. exc.asm:(.text+0x38): undefined reference to `_do_exc14'
47. traps.o: In function `trap_init':
48. traps.c:(.text+0x7): undefined reference to `exc0'
49. traps.c:(.text+0x1b): undefined reference to `exc1'
50. traps.c:(.text+0x2f): undefined reference to `exc2'
51. traps.c:(.text+0x43): undefined reference to `exc3'
52. traps.c:(.text+0x57): undefined reference to `exc4'
53. traps.c:(.text+0x6b): undefined reference to `exc5'
54. traps.c:(.text+0x7f): undefined reference to `exc6'
55. traps.c:(.text+0x93): undefined reference to `exc7'
56. traps.c:(.text+0xa7): undefined reference to `exc8'
57. traps.c:(.text+0xbb): undefined reference to `exc9'
58. traps.c:(.text+0xcf): undefined reference to `exc10'
59. traps.c:(.text+0xe3): undefined reference to `exc11'
60. traps.c:(.text+0xf7): undefined reference to `exc12'
61. traps.c:(.text+0x10b): undefined reference to `exc13'
62. traps.c:(.text+0x11f): undefined reference to `exc14'
63. make: *** [kernel.bin] Błąd 1
64. wojtek@wojtek-desktop:~/Pulpit/doc3_files$