Changeset 4155
- Timestamp:
- 12/20/09 14:36:15 (3 years ago)
- File:
-
- 1 edited
-
libcaca/trunk/build-kernel (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/build-kernel
r4148 r4155 1 1 #! /bin/sh 2 2 3 ## Kernel-mode libcaca compilation script -- Sam Hocevar <sam@ hocevar.net>3 ## Kernel-mode libcaca compilation script -- Sam Hocevar <sam@zoy.org> 4 4 ## $Id$ 5 5 … … 7 7 set -e 8 8 9 CFLAGS="-fno-builtin -O2 -I. -I.. -I../caca/ -Wall" 10 CPPFLAGS="-D__KERNEL__ -nostdinc -include kernel/kernel.h" 9 CFLAGS="-fno-builtin -O0 -I. -I.. -I../caca/ -Wall -D__KERNEL__ -fno-stack-protector -m32" 11 10 LDFLAGS="-nostdlib -Wl,-N -Wl,-Ttext -Wl,100000" 12 11 13 12 ./configure --disable-slang --disable-ncurses --disable-win32 \ 14 --disable-conio --disable-x11 --disable-gl --disable-network \15 --enable-vga --disable-imlib2 --disable-doc \16 --host i38613 --disable-conio --disable-x11 --disable-gl --disable-network \ 14 --enable-vga --disable-imlib2 --disable-doc \ 15 --host i386 17 16 18 # We need this. 19 make clean 17 # Compile cacademo, leave it as an object 18 cd caca && make && cd .. 19 cd examples && make dithering.o && cd .. 20 20 21 cd caca && make && cd ..22 21 23 cd src && make cacademo.o && cd ..22 cd kernel 24 23 25 cd kernel && 26 gcc $CFLAGS -c multiboot.S -o multiboot.o && 27 gcc $CFLAGS $CPPFLAGS -c kernel.c -o kernel.o && 24 # Bootsector 25 nasm -f bin -o bootsect.bin boot/bootsect.asm 26 # Interruption handlers 27 nasm -f elf -o int.o boot/int.asm 28 29 ##### Boot (x86) 30 # Stage2, loads GDT, PIC, IDT, interrupts, then calls kmain() 31 gcc $CFLAGS boot/stage2.c -c 32 # GDT installation, called by stage2 33 gcc $CFLAGS boot/gdt.c -c 34 # PIC installation, called by stage2 35 gcc $CFLAGS boot/pic.c -c 36 # IDT installation, called by stage2 37 gcc $CFLAGS boot/idt.c -c 38 # Interruptions installation, called by stage2 39 gcc $CFLAGS boot/interruptions.c -c 40 41 ##### Drivers 42 # Floppy driver 43 gcc $CFLAGS drivers/floppy.c -c 44 # Processor driver 45 gcc $CFLAGS drivers/processor.c -c 46 # Keyboard handler 47 gcc $CFLAGS drivers/keyboard.c -c 48 # Memory driver 49 gcc $CFLAGS drivers/memory.c -c 50 # Programmable Interval Timer driver 51 gcc $CFLAGS drivers/timer.c -c 52 53 # Minimalistic libc 54 gcc $CFLAGS klibc.c -c 55 56 # Kernel by itself, contains cmain() which calls main() 57 gcc $CFLAGS kernel.c -c 58 59 # Link everything but bootsector, kernel.o MUST be at the very end 60 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 -Map kernel.map ../caca/.libs/libcaca.a -o kern.bin 61 62 ls -ail kern.bin 28 63 cd .. 29 64 30 gcc $LDFLAGS -o src/cacademo kernel/multiboot.o kernel/kernel.o src/cacademo.o caca/.libs/libcaca.a 31 32 objcopy -O binary src/cacademo cacademo.boot 33 34 # For further development: create floppy images using the kernel 35 gcc -traditional -c -o bootsect.o kernel/bootsect.S 36 ld -Ttext 0x0 -s --oformat binary bootsect.o -o cacademo.img 37 65 # Copy bootsector at the very beginning of the floppy (first sector/512 bytes of the image), then kernel right after 66 cat kernel/bootsect.bin kernel/kern.bin /dev/zero | dd of=cacademo.img bs=512 count=2500
Note: See TracChangeset
for help on using the changeset viewer.
