[1] | 1 | ############################################################################# |
---|
[58] | 2 | # ALMOS-MKH Makefile for TSAR # |
---|
[1] | 3 | ############################################################################# |
---|
| 4 | |
---|
| 5 | -include params.mk |
---|
| 6 | |
---|
| 7 | # Compilation flags. |
---|
| 8 | CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \ |
---|
| 9 | -fno-delete-null-pointer-checks |
---|
| 10 | # -fno-delete-null-pointer-checks -std=c99 |
---|
| 11 | |
---|
[58] | 12 | export |
---|
[1] | 13 | CC = mipsel-unknown-elf-gcc |
---|
| 14 | AS = mipsel-unknown-elf-as |
---|
| 15 | LD = mipsel-unknown-elf-ld |
---|
| 16 | DU = mipsel-unknown-elf-objdump |
---|
| 17 | AR = mipsel-unknown-elf-ar |
---|
| 18 | |
---|
| 19 | # Default values for hardware parameters. |
---|
| 20 | # These parameters should be defined in the 'params.mk' file. |
---|
[58] | 21 | ARCH ?= /users/alain/soc/tsar-trunk-svn-2013/platforms/tsar_generic_iob |
---|
[1] | 22 | X_SIZE ?= 2 |
---|
| 23 | Y_SIZE ?= 2 |
---|
| 24 | NB_PROCS ?= 2 |
---|
| 25 | NB_TTYS ?= 1 |
---|
| 26 | FBF_WIDTH ?= 256 |
---|
| 27 | IOC_TYPE ?= IOC_BDV |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | # Checking hardware platform definition. |
---|
| 31 | ifeq ($(wildcard $(ARCH)),) |
---|
| 32 | $(error Please define in ARCH parameter the path to the hardware platform!) |
---|
| 33 | endif |
---|
| 34 | |
---|
[58] | 35 | # Rules that don't build target files |
---|
[1] | 36 | # always out-of-date, need to be regenerated everytime they are called |
---|
| 37 | .PHONY: compile \ |
---|
| 38 | dirs \ |
---|
| 39 | list \ |
---|
| 40 | extract \ |
---|
| 41 | fsck \ |
---|
| 42 | clean \ |
---|
| 43 | build-disk \ |
---|
| 44 | build/boot/boot.elf \ |
---|
| 45 | build/kernel/kernel.elf |
---|
| 46 | |
---|
| 47 | # Objects to be linked for boot.elf generation |
---|
| 48 | BOOT_OBJS = build/boot/boot.o \ |
---|
| 49 | build/boot/boot_fat32.o \ |
---|
| 50 | build/boot/boot_utils.o \ |
---|
| 51 | build/boot/boot_entry.o \ |
---|
| 52 | build/boot/boot_tty_driver.o \ |
---|
| 53 | build/boot/boot_hba_driver.o \ |
---|
| 54 | build/boot/boot_bdv_driver.o \ |
---|
| 55 | build/boot/boot_mmc_driver.o |
---|
| 56 | |
---|
| 57 | # List of directories to be searched for included files |
---|
| 58 | # when compiling for boot.elf generation |
---|
| 59 | BOOT_INCLUDE = -Itools/bootloader_tsar \ |
---|
| 60 | -Itools/arch_info \ |
---|
[62] | 61 | -Ihal/tsar_mips32/core \ |
---|
[1] | 62 | -I. |
---|
| 63 | |
---|
[58] | 64 | # Objects to be linked for the soclib drivers library |
---|
[1] | 65 | DRIVERS_OBJS = build/kernel/drivers/soclib_tty.o \ |
---|
| 66 | build/kernel/drivers/soclib_bdv.o \ |
---|
| 67 | build/kernel/drivers/soclib_hba.o \ |
---|
| 68 | build/kernel/drivers/soclib_mmc.o \ |
---|
| 69 | build/kernel/drivers/soclib_xcu.o \ |
---|
| 70 | build/kernel/drivers/soclib_pic.o \ |
---|
| 71 | build/kernel/drivers/soclib_nic.o \ |
---|
[12] | 72 | build/kernel/drivers/soclib_dma.o \ |
---|
[1] | 73 | build/kernel/drivers/soclib_iob.o |
---|
| 74 | |
---|
[58] | 75 | # Objects to be linked for kernel.elf generation |
---|
[1] | 76 | KERN_OBJS = build/kernel/kern/kernel_init.o \ |
---|
| 77 | build/kernel/kern/printk.o \ |
---|
| 78 | build/kernel/kern/thread.o \ |
---|
| 79 | build/kernel/kern/process.o \ |
---|
[12] | 80 | build/kernel/kern/chdev.o \ |
---|
[1] | 81 | build/kernel/kern/cluster.o \ |
---|
| 82 | build/kernel/kern/scheduler.o \ |
---|
| 83 | build/kernel/kern/core.o \ |
---|
| 84 | build/kernel/kern/dqdt.o \ |
---|
[16] | 85 | build/kernel/kern/do_syscall.o \ |
---|
| 86 | build/kernel/kern/do_interrupt.o \ |
---|
| 87 | build/kernel/kern/do_exception.o \ |
---|
[23] | 88 | build/kernel/kern/rpc.o \ |
---|
| 89 | build/kernel/kern/signal.o |
---|
[1] | 90 | |
---|
| 91 | HAL_OBJS = build/kernel/hal/hal_special.o \ |
---|
| 92 | build/kernel/hal/hal_context.o \ |
---|
| 93 | build/kernel/hal/hal_atomic.o \ |
---|
| 94 | build/kernel/hal/hal_remote.o \ |
---|
| 95 | build/kernel/hal/hal_uspace.o \ |
---|
| 96 | build/kernel/hal/hal_irqmask.o \ |
---|
[16] | 97 | build/kernel/hal/hal_gpt.o \ |
---|
[53] | 98 | build/kernel/hal/hal_ppm.o \ |
---|
[16] | 99 | build/kernel/hal/hal_exception.o \ |
---|
| 100 | build/kernel/hal/hal_interrupt.o \ |
---|
| 101 | build/kernel/hal/hal_syscall.o \ |
---|
| 102 | build/kernel/hal/hal_kentry.o |
---|
[1] | 103 | |
---|
| 104 | DEV_OBJS = build/kernel/devices/dev_txt.o \ |
---|
| 105 | build/kernel/devices/dev_ioc.o \ |
---|
| 106 | build/kernel/devices/dev_icu.o \ |
---|
| 107 | build/kernel/devices/dev_mmc.o \ |
---|
| 108 | build/kernel/devices/dev_nic.o \ |
---|
| 109 | build/kernel/devices/dev_pic.o \ |
---|
[12] | 110 | build/kernel/devices/dev_dma.o \ |
---|
| 111 | build/kernel/devices/dev_fbf.o \ |
---|
[58] | 112 | build/kernel/devices/dev_iob.o |
---|
[1] | 113 | |
---|
| 114 | MM_OBJS = build/kernel/mm/ppm.o \ |
---|
| 115 | build/kernel/mm/vmm.o \ |
---|
| 116 | build/kernel/mm/vseg.o \ |
---|
| 117 | build/kernel/mm/page.o \ |
---|
| 118 | build/kernel/mm/kcm.o \ |
---|
| 119 | build/kernel/mm/khm.o \ |
---|
| 120 | build/kernel/mm/mapper.o \ |
---|
| 121 | build/kernel/mm/kmem.o |
---|
| 122 | |
---|
| 123 | LIBK_OBJS = build/kernel/libk/grdxt.o \ |
---|
| 124 | build/kernel/libk/bits.o \ |
---|
| 125 | build/kernel/libk/elf.o \ |
---|
| 126 | build/kernel/libk/string.o \ |
---|
| 127 | build/kernel/libk/ctype.o \ |
---|
| 128 | build/kernel/libk/rwlock.o \ |
---|
| 129 | build/kernel/libk/spinlock.o \ |
---|
[16] | 130 | build/kernel/libk/barrier.o \ |
---|
[1] | 131 | build/kernel/libk/remote_barrier.o \ |
---|
| 132 | build/kernel/libk/remote_spinlock.o \ |
---|
| 133 | build/kernel/libk/remote_rwlock.o \ |
---|
| 134 | build/kernel/libk/remote_fifo.o \ |
---|
[23] | 135 | build/kernel/libk/remote_mutex.o \ |
---|
| 136 | build/kernel/libk/remote_sem.o \ |
---|
| 137 | build/kernel/libk/remote_condvar.o \ |
---|
[1] | 138 | build/kernel/libk/memcpy.o \ |
---|
[23] | 139 | build/kernel/libk/htab.o \ |
---|
[1] | 140 | build/kernel/libk/xhtab.o |
---|
| 141 | |
---|
[16] | 142 | SYS_OBJS_0 = build/kernel/syscalls/sys_thread_exit.o \ |
---|
[23] | 143 | build/kernel/syscalls/sys_mmap.o \ |
---|
[16] | 144 | build/kernel/syscalls/sys_thread_create.o \ |
---|
| 145 | build/kernel/syscalls/sys_thread_join.o \ |
---|
| 146 | build/kernel/syscalls/sys_thread_detach.o \ |
---|
| 147 | build/kernel/syscalls/sys_thread_yield.o \ |
---|
| 148 | build/kernel/syscalls/sys_sem.o \ |
---|
[23] | 149 | build/kernel/syscalls/sys_condvar.o \ |
---|
[16] | 150 | build/kernel/syscalls/sys_barrier.o \ |
---|
[23] | 151 | build/kernel/syscalls/sys_mutex.o |
---|
[1] | 152 | |
---|
[16] | 153 | SYS_OBJS_1 = build/kernel/syscalls/sys_thread_sleep.o \ |
---|
[23] | 154 | build/kernel/syscalls/sys_thread_wakeup.o \ |
---|
[16] | 155 | build/kernel/syscalls/sys_open.o \ |
---|
| 156 | build/kernel/syscalls/sys_creat.o \ |
---|
| 157 | build/kernel/syscalls/sys_read.o \ |
---|
| 158 | build/kernel/syscalls/sys_write.o \ |
---|
| 159 | build/kernel/syscalls/sys_lseek.o \ |
---|
| 160 | build/kernel/syscalls/sys_close.o \ |
---|
| 161 | build/kernel/syscalls/sys_unlink.o \ |
---|
[23] | 162 | build/kernel/syscalls/sys_pipe.o |
---|
[16] | 163 | |
---|
| 164 | SYS_OBJS_2 = build/kernel/syscalls/sys_chdir.o \ |
---|
| 165 | build/kernel/syscalls/sys_mkdir.o \ |
---|
| 166 | build/kernel/syscalls/sys_mkfifo.o \ |
---|
| 167 | build/kernel/syscalls/sys_opendir.o \ |
---|
| 168 | build/kernel/syscalls/sys_readdir.o \ |
---|
| 169 | build/kernel/syscalls/sys_closedir.o \ |
---|
| 170 | build/kernel/syscalls/sys_getcwd.o \ |
---|
| 171 | build/kernel/syscalls/sys_clock.o \ |
---|
| 172 | build/kernel/syscalls/sys_alarm.o \ |
---|
[56] | 173 | build/kernel/syscalls/sys_rmdir.o |
---|
[16] | 174 | |
---|
| 175 | SYS_OBJS_3 = build/kernel/syscalls/sys_utls.o \ |
---|
[23] | 176 | build/kernel/syscalls/sys_chmod.o \ |
---|
[16] | 177 | build/kernel/syscalls/sys_signal.o \ |
---|
[50] | 178 | build/kernel/syscalls/sys_timeofday.o \ |
---|
[23] | 179 | build/kernel/syscalls/sys_kill.o \ |
---|
[16] | 180 | build/kernel/syscalls/sys_getpid.o \ |
---|
| 181 | build/kernel/syscalls/sys_fork.o \ |
---|
| 182 | build/kernel/syscalls/sys_exec.o \ |
---|
[23] | 183 | build/kernel/syscalls/sys_stat.o \ |
---|
[56] | 184 | build/kernel/syscalls/sys_trace.o |
---|
[16] | 185 | |
---|
[1] | 186 | VFS_OBJS = build/kernel/vfs/vfs.o \ |
---|
| 187 | build/kernel/vfs/fatfs.o \ |
---|
[23] | 188 | build/kernel/vfs/devfs.o \ |
---|
[1] | 189 | build/kernel/vfs/ramfs.o |
---|
| 190 | |
---|
| 191 | # List of directories to be searched for included files |
---|
[58] | 192 | # when compiling for kernel.elf generation |
---|
[1] | 193 | KERNEL_INCLUDE = -Ikernel \ |
---|
| 194 | -Ikernel/kern \ |
---|
| 195 | -Ikernel/devices \ |
---|
[16] | 196 | -Ikernel/syscalls \ |
---|
[75] | 197 | -Ihal/tsar_mips32/drivers \ |
---|
[1] | 198 | -Ikernel/syscalls \ |
---|
| 199 | -Ikernel/libk \ |
---|
| 200 | -Ikernel/mm \ |
---|
| 201 | -Ikernel/vfs \ |
---|
[23] | 202 | -Ikernel/fatfs \ |
---|
| 203 | -Ikernel/sysfs \ |
---|
| 204 | -Ikernel/ramfs \ |
---|
| 205 | -Ikernel/devfs \ |
---|
[1] | 206 | -Itools/arch_info \ |
---|
[16] | 207 | -Ihal/generic \ |
---|
[62] | 208 | -Ihal/tsar_mips32/core \ |
---|
[1] | 209 | -I. |
---|
| 210 | |
---|
| 211 | # Macros to be processed by the C preprocessor. |
---|
| 212 | MACROS = -DARCHINFO_PATHNAME="\"arch_info.bin\"" \ |
---|
| 213 | -DKERNEL_PATHNAME="\"/bin/kernel/kernel.elf\"" |
---|
| 214 | |
---|
| 215 | # Virtual disk path |
---|
| 216 | DISK_IMAGE := hdd/virt_hdd.dmg |
---|
| 217 | |
---|
| 218 | # The Mtools used to build the FAT32 disk image perfom a few sanity checks, to |
---|
| 219 | # make sure that the disk is indeed an MS-DOS disk. However, the size of the |
---|
[58] | 220 | # disk image used by ALMOS-VM is not MS-DOS compliant. |
---|
[1] | 221 | # Setting this variable prevents these checks. |
---|
| 222 | MTOOLS_SKIP_CHECK := 1 |
---|
| 223 | |
---|
| 224 | # Rule to compile boot.elf, kernel.elf, and update virtual disk. |
---|
| 225 | compile: dirs \ |
---|
| 226 | hard_config.h \ |
---|
| 227 | build/boot/boot.elf \ |
---|
| 228 | build/kernel/kernel.elf \ |
---|
| 229 | list |
---|
| 230 | |
---|
| 231 | # Rule to create the build directories. |
---|
| 232 | dirs: |
---|
| 233 | @mkdir -p build/boot |
---|
| 234 | @mkdir -p build/kernel |
---|
| 235 | @mkdir -p build/kernel/kern |
---|
| 236 | @mkdir -p build/kernel/hal |
---|
| 237 | @mkdir -p build/kernel/devices |
---|
| 238 | @mkdir -p build/kernel/mm |
---|
| 239 | @mkdir -p build/kernel/libk |
---|
| 240 | @mkdir -p build/kernel/drivers |
---|
[58] | 241 | @mkdir -p build/kernel/vfs |
---|
[16] | 242 | @mkdir -p build/kernel/syscalls |
---|
[1] | 243 | @mkdir -p hdd |
---|
| 244 | |
---|
| 245 | # Rule to make a recursive list of the virtual disk content. |
---|
| 246 | list: |
---|
| 247 | mdir -/ -w -i $(DISK_IMAGE) ::/ |
---|
| 248 | |
---|
| 249 | # Rule to make a file system check for the virtual disk. |
---|
| 250 | fsck: |
---|
| 251 | fsck.msdos $(DISK_IMAGE) |
---|
| 252 | |
---|
| 253 | ############################################################## |
---|
[58] | 254 | # Rule to copy the files generated by the virtual prototype |
---|
[1] | 255 | # from the virtual disk 'home' directory to the current directory. |
---|
| 256 | extract: |
---|
| 257 | mcopy -o -i $(DISK_IMAGE) ::/home . |
---|
| 258 | |
---|
[58] | 259 | # Rules to delete all binary files from Unix File System |
---|
[1] | 260 | # without modifying the virtual disk. |
---|
| 261 | clean: |
---|
| 262 | rm -f *.o *.elf *.bin *.txt core |
---|
| 263 | rm -f hard_config.h arch_info.xml arch_info.bin |
---|
| 264 | rm -rf build |
---|
| 265 | |
---|
| 266 | #################################################### |
---|
| 267 | # Rule for building a new virtual disk from scratch. |
---|
| 268 | # It creates the bin / home directories. |
---|
| 269 | # This requires the generic Linux/MacOS 'create_dmg' script, that should be |
---|
| 270 | # placed in the same directory as this Makefile. |
---|
| 271 | build-disk: |
---|
| 272 | rm -f $(DISK_IMAGE) |
---|
| 273 | ./create_dmg create $(basename $(DISK_IMAGE)) |
---|
| 274 | dd if=$(DISK_IMAGE) of=temp.dmg count=65536 |
---|
| 275 | mv temp.dmg $(DISK_IMAGE) |
---|
| 276 | mmd -o -i $(DISK_IMAGE) ::/bin || true |
---|
| 277 | mmd -o -i $(DISK_IMAGE) ::/bin/kernel || true |
---|
| 278 | mmd -o -i $(DISK_IMAGE) ::/home || true |
---|
| 279 | mdir -/ -b -i $(DISK_IMAGE) ::/ |
---|
| 280 | |
---|
| 281 | ############################################################## |
---|
| 282 | # Rules to generate hardware description files (hard_config.h, |
---|
| 283 | # arch_info.bin and arch_info.xml), and update the virtual disk. |
---|
| 284 | hard_config.h: $(ARCH)/arch_info.py |
---|
| 285 | tools/arch_info/genarch.py --arch=$(ARCH) \ |
---|
| 286 | --x_size=$(X_SIZE) \ |
---|
| 287 | --y_size=$(Y_SIZE) \ |
---|
| 288 | --nb_cores=$(NB_PROCS) \ |
---|
| 289 | --nb_ttys=$(NB_TTYS) \ |
---|
| 290 | --fbf_size=$(FBF_WIDTH) \ |
---|
| 291 | --ioc_type=$(IOC_TYPE) \ |
---|
| 292 | --hard=. \ |
---|
| 293 | --bin=. \ |
---|
| 294 | --xml=. |
---|
| 295 | mcopy -o -i $(DISK_IMAGE) arch_info.bin ::/ || true |
---|
| 296 | |
---|
| 297 | ################################################ |
---|
| 298 | # Rules to compile boot drivers used by boot.elf |
---|
| 299 | build/boot/boot_tty_driver.o: tools/bootloader_tsar/boot_tty_driver.c \ |
---|
| 300 | tools/bootloader_tsar/boot_tty_driver.h \ |
---|
| 301 | tools/bootloader_tsar/boot_utils.h \ |
---|
| 302 | tools/bootloader_tsar/boot_config.h \ |
---|
[62] | 303 | hal/tsar_mips32/core/hal_types.h \ |
---|
[1] | 304 | hard_config.h |
---|
| 305 | $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 306 | $(DU) -D $@ > $@.txt |
---|
| 307 | |
---|
| 308 | build/boot/boot_bdv_driver.o: tools/bootloader_tsar/boot_bdv_driver.c \ |
---|
| 309 | tools/bootloader_tsar/boot_bdv_driver.h \ |
---|
| 310 | tools/bootloader_tsar/boot_utils.h \ |
---|
| 311 | tools/bootloader_tsar/boot_config.h \ |
---|
[62] | 312 | hal/tsar_mips32/core/hal_types.h \ |
---|
[1] | 313 | hard_config.h |
---|
| 314 | $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 315 | $(DU) -D $@ > $@.txt |
---|
| 316 | |
---|
| 317 | build/boot/boot_hba_driver.o: tools/bootloader_tsar/boot_hba_driver.c \ |
---|
| 318 | tools/bootloader_tsar/boot_hba_driver.h \ |
---|
| 319 | tools/bootloader_tsar/boot_utils.h \ |
---|
| 320 | tools/bootloader_tsar/boot_config.h \ |
---|
[62] | 321 | hal/tsar_mips32/core/hal_types.h \ |
---|
[1] | 322 | hard_config.h |
---|
| 323 | $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 324 | $(DU) -D $@ > $@.txt |
---|
| 325 | |
---|
| 326 | build/boot/boot_mmc_driver.o: tools/bootloader_tsar/boot_mmc_driver.c \ |
---|
| 327 | tools/bootloader_tsar/boot_mmc_driver.h \ |
---|
| 328 | tools/bootloader_tsar/boot_utils.h \ |
---|
| 329 | tools/bootloader_tsar/boot_config.h \ |
---|
[62] | 330 | hal/tsar_mips32/core/hal_types.h \ |
---|
[1] | 331 | hard_config.h |
---|
| 332 | $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 333 | $(DU) -D $@ > $@.txt |
---|
| 334 | |
---|
| 335 | ############################## |
---|
| 336 | # Rule to compile boot_fat32.o |
---|
| 337 | build/boot/boot_fat32.o: tools/bootloader_tsar/boot_fat32.c \ |
---|
| 338 | tools/bootloader_tsar/boot_fat32.h \ |
---|
| 339 | tools/bootloader_tsar/boot_utils.h \ |
---|
| 340 | tools/bootloader_tsar/boot_config.h \ |
---|
[62] | 341 | hal/tsar_mips32/core/hal_types.h \ |
---|
[1] | 342 | hard_config.h |
---|
| 343 | $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 344 | $(DU) -D $@ > $@.txt |
---|
| 345 | |
---|
| 346 | ############################## |
---|
[58] | 347 | # Rule to compile boot_utils.o |
---|
[1] | 348 | build/boot/boot_utils.o: tools/bootloader_tsar/boot_utils.c \ |
---|
| 349 | tools/bootloader_tsar/boot_utils.h \ |
---|
| 350 | tools/bootloader_tsar/boot_tty_driver.h \ |
---|
[62] | 351 | hal/tsar_mips32/core/hal_types.h \ |
---|
[1] | 352 | hard_config.h |
---|
| 353 | $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 354 | $(DU) -D $@ > $@.txt |
---|
| 355 | |
---|
| 356 | ######################## |
---|
| 357 | # Rule to compile boot.o |
---|
| 358 | build/boot/boot.o: tools/bootloader_tsar/boot.c \ |
---|
| 359 | tools/bootloader_tsar/boot_utils.h \ |
---|
| 360 | tools/bootloader_tsar/boot_fat32.h \ |
---|
| 361 | tools/bootloader_tsar/boot_tty_driver.h \ |
---|
| 362 | tools/bootloader_tsar/boot_hba_driver.h \ |
---|
| 363 | tools/bootloader_tsar/boot_bdv_driver.h \ |
---|
| 364 | tools/bootloader_tsar/boot_mmc_driver.h \ |
---|
| 365 | tools/bootloader_tsar/boot_config.h \ |
---|
[62] | 366 | hal/tsar_mips32/core/hal_types.h \ |
---|
[1] | 367 | hard_config.h |
---|
| 368 | $(CC) $(BOOT_INCLUDE) $(CFLAGS) $(MACROS) -c -o $@ $< |
---|
| 369 | $(DU) -D $@ > $@.txt |
---|
| 370 | |
---|
| 371 | ############################## |
---|
| 372 | # Rule to compile boot_entry.o |
---|
| 373 | build/boot/boot_entry.o: tools/bootloader_tsar/boot_entry.S \ |
---|
| 374 | tools/bootloader_tsar/boot_config.h \ |
---|
| 375 | hard_config.h |
---|
| 376 | $(CC) $(BOOT_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 377 | $(DU) -D $@ > $@.txt |
---|
| 378 | |
---|
| 379 | ##################################################################### |
---|
| 380 | # Rule to generate boot.elf and place it in sector #2 of virtual disk |
---|
| 381 | build/boot/boot.elf: $(BOOT_OBJS) \ |
---|
| 382 | tools/bootloader_tsar/boot.ld |
---|
[58] | 383 | $(LD) -o $@ -T tools/bootloader_tsar/boot.ld $(BOOT_OBJS) |
---|
[1] | 384 | $(DU) -D $@ > $@.txt |
---|
| 385 | dd if=build/boot/boot.elf of=$(DISK_IMAGE) seek=2 conv=notrunc |
---|
| 386 | |
---|
| 387 | |
---|
| 388 | ############################## |
---|
[58] | 389 | # rules to compile the drivers |
---|
[75] | 390 | build/kernel/drivers/%.o: hal/tsar_mips32/drivers/%.c \ |
---|
| 391 | hal/tsar_mips32/drivers/%.h \ |
---|
[16] | 392 | kernel_config.h \ |
---|
[62] | 393 | hal/tsar_mips32/core/hal_types.h |
---|
[1] | 394 | $(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 395 | $(DU) -D $@ > $@.txt |
---|
| 396 | |
---|
| 397 | ####################################### |
---|
| 398 | # Rules to generate kernel/kern objects |
---|
| 399 | build/kernel/kern/%.o: kernel/kern/%.c \ |
---|
| 400 | kernel/kern/%.h \ |
---|
[16] | 401 | kernel_config.h \ |
---|
[62] | 402 | hal/tsar_mips32/core/hal_types.h |
---|
[1] | 403 | $(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 404 | $(DU) -D $@ > $@.txt |
---|
| 405 | |
---|
| 406 | ###################################### |
---|
| 407 | # Rules to generate kernel/hal objects |
---|
[62] | 408 | build/kernel/hal/%.o: hal/tsar_mips32/core/%.c \ |
---|
[16] | 409 | hal/generic/%.h \ |
---|
| 410 | kernel_config.h \ |
---|
[62] | 411 | hal/tsar_mips32/core/hal_types.h |
---|
[1] | 412 | $(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 413 | $(DU) -D $@ > $@.txt |
---|
| 414 | |
---|
[62] | 415 | build/kernel/hal/hal_kentry.o: hal/tsar_mips32/core/hal_kentry.S \ |
---|
| 416 | hal/tsar_mips32/core/hal_kentry.h \ |
---|
[16] | 417 | kernel_config.h \ |
---|
[62] | 418 | hal/tsar_mips32/core/hal_types.h |
---|
[16] | 419 | $(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 420 | $(DU) -D $@ > $@.txt |
---|
| 421 | |
---|
[1] | 422 | ###################################### |
---|
| 423 | # Rules to generate kernel/dev objects |
---|
| 424 | build/kernel/devices/%.o: kernel/devices/%.c \ |
---|
| 425 | kernel/devices/%.h \ |
---|
[16] | 426 | kernel_config.h \ |
---|
[62] | 427 | hal/tsar_mips32/core/hal_types.h |
---|
[1] | 428 | $(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 429 | $(DU) -D $@ > $@.txt |
---|
| 430 | |
---|
| 431 | ##################################### |
---|
| 432 | # Rules to generate kernel/mm objects |
---|
| 433 | build/kernel/mm/%.o: kernel/mm/%.c \ |
---|
| 434 | kernel/mm/%.h \ |
---|
[16] | 435 | kernel_config.h \ |
---|
[62] | 436 | hal/tsar_mips32/core/hal_types.h |
---|
[1] | 437 | $(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 438 | $(DU) -D $@ > $@.txt |
---|
| 439 | |
---|
| 440 | ####################################### |
---|
| 441 | # Rules to generate kernel/libk objects |
---|
| 442 | build/kernel/libk/%.o: kernel/libk/%.c \ |
---|
| 443 | kernel/libk/%.h \ |
---|
[16] | 444 | kernel_config.h \ |
---|
[62] | 445 | hal/tsar_mips32/core/hal_types.h |
---|
[1] | 446 | $(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 447 | $(DU) -D $@ > $@.txt |
---|
| 448 | |
---|
[16] | 449 | ########################################### |
---|
| 450 | # Rules to generate kernel/syscalls objects |
---|
| 451 | build/kernel/syscalls/%.o: kernel/syscalls/%.c \ |
---|
| 452 | kernel/syscalls/syscalls.h \ |
---|
| 453 | kernel_config.h \ |
---|
[62] | 454 | hal/tsar_mips32/core/hal_types.h |
---|
[16] | 455 | $(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 456 | $(DU) -D $@ > $@.txt |
---|
| 457 | |
---|
[1] | 458 | ####################################### |
---|
| 459 | # Rules to generate kernel/vfs objects |
---|
| 460 | build/kernel/vfs/%.o: kernel/vfs/%.c \ |
---|
[23] | 461 | kernel/vfs/%.h \ |
---|
[16] | 462 | kernel_config.h \ |
---|
[62] | 463 | hal/tsar_mips32/core/hal_types.h |
---|
[1] | 464 | $(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $< |
---|
| 465 | $(DU) -D $@ > $@.txt |
---|
| 466 | |
---|
| 467 | ########################################################### |
---|
| 468 | # Rule to generate kernel.elf and place it on virtual disk |
---|
| 469 | build/kernel/kernel.elf: $(KERN_OBJS) \ |
---|
| 470 | $(HAL_OBJS) \ |
---|
| 471 | $(DEV_OBJS) \ |
---|
| 472 | $(MM_OBJS) \ |
---|
| 473 | $(LIBK_OBJS) \ |
---|
| 474 | $(DRIVERS_OBJS) \ |
---|
| 475 | $(VFS_OBJS) \ |
---|
[23] | 476 | $(SYS_OBJS_0) \ |
---|
| 477 | $(SYS_OBJS_1) \ |
---|
| 478 | $(SYS_OBJS_2) \ |
---|
| 479 | $(SYS_OBJS_3) \ |
---|
[63] | 480 | hal/tsar_mips32/kernel.ld |
---|
| 481 | $(LD) -o $@ -T hal/tsar_mips32/kernel.ld \ |
---|
[1] | 482 | $(KERN_OBJS) $(HAL_OBJS) $(DEV_OBJS) $(MM_OBJS) \ |
---|
[16] | 483 | $(LIBK_OBJS) $(DRIVERS_OBJS) $(VFS_OBJS) \ |
---|
[58] | 484 | $(SYS_OBJS_0) $(SYS_OBJS_1) $(SYS_OBJS_2) \ |
---|
| 485 | $(SYS_OBJS_3) |
---|
[23] | 486 | |
---|
[1] | 487 | $(DU) -D $@ > $@.txt |
---|
| 488 | mcopy -o -i $(DISK_IMAGE) build/kernel/kernel.elf ::/bin/kernel |
---|
| 489 | |
---|