@@ -44,15 +44,15 @@ app_dashboard = $(BUILD_APP)/dashboard
4444# Parameters
4545# 1-byte hex and 1-based indexing for BT STAGE 2 ONLY
4646SECTOR_START_BT_STAGE2 = 03
47- SECTOR_COUNT_BT_STAGE2 = 19
47+ SECTOR_COUNT_BT_STAGE2 = 0b
4848SECTOR_START_SHARED_LIBRARY = 1
4949SECTOR_COUNT_SHARED_LIBRARY = 1
50- SECTOR_START_KERNEL = 27
51- SECTOR_COUNT_KERNEL = 33
52- SECTOR_START_APP_TTT = 60
53- SECTOR_COUNT_APP_TTT = 25
54- SECTOR_START_APP_CALC = 85
55- SECTOR_COUNT_APP_CALC = 25
50+ SECTOR_START_KERNEL = 13
51+ SECTOR_COUNT_KERNEL = 34
52+ SECTOR_START_APP_TTT = 47
53+ SECTOR_COUNT_APP_TTT = 18
54+ SECTOR_START_APP_CALC = 65
55+ SECTOR_COUNT_APP_CALC = 18
5656
5757MEMORY_STATIC_LIBRARY = 0x7E00
5858MEMORY_LOCATION_KERNEL = 0xC000
@@ -64,7 +64,8 @@ SOURCE_SNAPSHOT="\"$$(git rev-parse --short HEAD)$$(git diff --quiet || echo '_u
6464# # Integer is 4 bytes
6565
6666# Tools
67- CC =gcc -std=c++11 -Os
67+ CC =gcc -std=c++11 -Os -nostartfiles -nostdlib -static
68+ LD =ld -nostdlib -nostartfiles -nodefaultlibs --print-map --strip-all
6869
6970# Targets
7071rebuild : clean all_artifacts
@@ -170,7 +171,7 @@ $(bt_stage2): $(SRC_BOOTLOADER)/stage2.asm $(SRC_BOOTLOADER)/stage2.c $(SRC_MEMM
170171 -D MEMORY_LOCATION_KERNEL=$(MEMORY_LOCATION_KERNEL ) \
171172 -D MEMORY_LOCATION_APP=$(MEMORY_LOCATION_APP ) \
172173 -o $(BUILD_BOOTLOADER ) /stage2_c.o $(SRC_BOOTLOADER ) /stage2.c
173- ld --oformat binary -m elf_i386 -Ttext 0x8000 --strip-all -o $@ $(BUILD_BOOTLOADER ) /stage2_asm.o $(BUILD_BOOTLOADER ) /stage2_c.o $(BUILD_LIB_UTILS ) /libutils_16 $(BUILD_DRIVERS ) /display/libtm_bios $(BUILD_DRIVERS ) /disk/libdisk_16
174+ $( LD ) --oformat binary -m elf_i386 -Ttext 0x8000 -T linker.ld -o $@ $(BUILD_BOOTLOADER ) /stage2_asm.o $(BUILD_BOOTLOADER ) /stage2_c.o $(BUILD_LIB_UTILS ) /libutils_16 $(BUILD_DRIVERS ) /display/libtm_bios $(BUILD_DRIVERS ) /disk/libdisk_16
174175 truncate --size=%512 $@
175176
176177$(BUILD_REALMODE ) /static_library : $(SRC_REALMODE ) /static_library.asm $(SRC_REALMODE ) /stub.asm
@@ -191,7 +192,7 @@ $(kernel_core): $(SRC_KERNEL)/core.asm $(SRC_KERNEL)/core.c $(SRC_KERNEL)/essent
191192 -D SECTOR_START_APP_CALC=$(SECTOR_START_APP_CALC ) \
192193 -D SECTOR_COUNT_APP_CALC=$(SECTOR_COUNT_APP_CALC ) \
193194 -o $(BUILD_KERNEL ) /core_c.o $(SRC_KERNEL ) /core.c
194- ld --oformat binary -m elf_i386 --trace - Ttext 0x0000 --strip-all -o $(kernel_core ) $(BUILD_KERNEL ) /core_asm.o $(BUILD_KERNEL ) /process_asm.o $(BUILD_KERNEL ) /core_c.o $(BUILD_KERNEL ) /interrupts_asm.o $(BUILD_DRIVERS ) /keyboard/libkeyboard $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_DS ) /libds $(BUILD_DRIVERS ) /disk/libdisk $(BUILD_LIB_SYSCALL ) /libsyscall
195+ $( LD ) --oformat binary -m elf_i386 -Ttext 0x0000 -T linker.ld -o $(kernel_core ) $(BUILD_KERNEL ) /core_asm.o $(BUILD_KERNEL ) /process_asm.o $(BUILD_KERNEL ) /core_c.o $(BUILD_KERNEL ) /interrupts_asm.o $(BUILD_DRIVERS ) /keyboard/libkeyboard $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_DS ) /libds $(BUILD_DRIVERS ) /disk/libdisk $(BUILD_LIB_SYSCALL ) /libsyscall
195196 truncate --size=%512 $(kernel_core )
196197
197198# Libraries
@@ -274,11 +275,11 @@ $(BUILD_LIB_SYSCALL)/libsyscall: $(SRC_LIB_SYSCALL)/syscall.h $(SRC_LIB_SYSCALL)
274275$(app_calc ) : $(app_entry ) $(SRC_APP ) /calc.c $(SRC_LIB_UTILS ) /output.h $(SRC_LIB_UTILS ) /time.h $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall # And dependecies :/
275276 mkdir -p $$(dirname $(app_calc ) )
276277 $(CC ) -m32 -fno-pie -c -Isrc -o $(BUILD_APP ) /calc.o $(SRC_APP ) /calc.c
277- ld --oformat binary -m elf_i386 -Ttext 0x0 --strip-all -o $@ $(app_entry ) $(BUILD_APP ) /calc.o $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall
278+ $( LD ) --oformat binary -m elf_i386 -Ttext 0x0 -T linker.ld -o $@ $(app_entry ) $(BUILD_APP ) /calc.o $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall
278279 truncate --size=%512 $@
279280
280281$(app_tic_tac_toe ) : $(app_entry ) $(SRC_APP ) /tic_tac_toe.c $(SRC_LIB_UTILS ) /output.h $(SRC_LIB_UTILS ) /input.h $(SRC_LIB_UTILS ) /time.h $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall # And dependecies :/
281282 mkdir -p $$(dirname $(app_tic_tac_toe ) )
282283 $(CC ) -m32 -fno-pie -c -Isrc -o $(BUILD_APP ) /tic_tac_toe.o $(SRC_APP ) /tic_tac_toe.c
283- ld --oformat binary -m elf_i386 -Ttext 0x0 --strip-all -o $@ $(app_entry ) $(BUILD_APP ) /tic_tac_toe.o $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall
284+ $( LD ) --oformat binary -m elf_i386 -Ttext 0x0 -T linker.ld -o $@ $(app_entry ) $(BUILD_APP ) /tic_tac_toe.o $(BUILD_LIB_UTILS ) /libutils $(BUILD_DRIVERS ) /display/libtm_vga $(BUILD_LIB_SYSCALL ) /libsyscall
284285 truncate --size=%512 $@
0 commit comments