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