您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

63 行
1.8 KiB

  1. #! /bin/sh
  2. ## Kernel-mode libcaca compilation script -- Sam Hocevar <sam@zoy.org>
  3. ## $Id$
  4. set -x
  5. set -e
  6. MYCFLAGS="-fno-builtin -O0 -I. -I.. -I../caca/ -Wall -D__KERNEL__ -fno-stack-protector -m32"
  7. ./configure --enable-kernel --disable-doc --host i386
  8. # Compile cacademo, leave it as an object
  9. cd caca && make && cd ..
  10. cd examples && make dithering.o && cd ..
  11. cd kernel
  12. # Bootsector
  13. nasm -f bin -o bootsect.bin boot/bootsect.asm
  14. # Interruption handlers
  15. nasm -f elf -o int.o boot/int.asm
  16. ##### Boot (x86)
  17. # Stage2, loads GDT, PIC, IDT, interrupts, then calls kmain()
  18. gcc $MYCFLAGS boot/stage2.c -c
  19. # GDT installation, called by stage2
  20. gcc $MYCFLAGS boot/gdt.c -c
  21. # PIC installation, called by stage2
  22. gcc $MYCFLAGS boot/pic.c -c
  23. # IDT installation, called by stage2
  24. gcc $MYCFLAGS boot/idt.c -c
  25. # Interruptions installation, called by stage2
  26. gcc $MYCFLAGS boot/interruptions.c -c
  27. ##### Drivers
  28. # Floppy driver
  29. gcc $MYCFLAGS drivers/floppy.c -c
  30. # Processor driver
  31. gcc $MYCFLAGS drivers/processor.c -c
  32. # Keyboard handler
  33. gcc $MYCFLAGS drivers/keyboard.c -c
  34. # Memory driver
  35. gcc $MYCFLAGS drivers/memory.c -c
  36. # Programmable Interval Timer driver
  37. gcc $MYCFLAGS drivers/timer.c -c
  38. # Minimalistic libc
  39. gcc $MYCFLAGS klibc.c -c
  40. # Kernel by itself, contains cmain() which calls main()
  41. gcc $MYCFLAGS kernel.c -c
  42. # Link everything but bootsector, kernel.o MUST be at the very end
  43. ld --oformat binary -Ttext 1000 stage2.o gdt.o pic.o int.o idt.o interruptions.o keyboard.o memory.o timer.o floppy.o processor.o klibc.o kernel.o ../caca/.libs/libcaca.a -Map kernel.map -o kern.bin
  44. ls -ail kern.bin
  45. cd ..
  46. # Copy bootsector at the very beginning of the floppy (first sector/512 bytes of the image), then kernel right after
  47. cat kernel/bootsect.bin kernel/kern.bin /dev/zero | dd of=cacademo.img bs=512 count=2500