Skip to content

Commit c47dc2b

Browse files
committed
Added Makefile
1 parent fd3a2c2 commit c47dc2b

File tree

13 files changed

+92
-94
lines changed

13 files changed

+92
-94
lines changed

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
BL_SRC_DIR = src/bootloader
2+
BUILD_DIR = build
3+
4+
.PHONY: all clean
5+
6+
bt_stage1 = $(BUILD_DIR)/bt_stage1
7+
image_vmdk = $(BUILD_DIR)/image.vmdk
8+
9+
all: images binaries
10+
11+
images: $(image_vmdk)
12+
13+
binaries: $(bt_stage1)
14+
15+
$(image_vmdk): $(bt_stage1)
16+
dd bs=512 if=$< of=$@
17+
/bin/echo -ne "\x55\xaa" | dd seek=510 bs=1 of=$@
18+
19+
$(bt_stage1): $(BL_SRC_DIR)/stage1.asm $(BL_SRC_DIR)/constants.asm $(BL_SRC_DIR)/io.asm
20+
nasm -o $@ -f bin -i $(BL_SRC_DIR)/ $<
21+
22+
clean:
23+
rm $(BUILD_DIR)/*

bootloader/init.asm

Lines changed: 0 additions & 37 deletions
This file was deleted.

scripts/build.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

scripts/burn.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/bin/bash
22
set -e
3-
source "$(dirname $0)/common.sh"
43

5-
BINARY=${1?"path to binary is missing: \$1"}
6-
DISK=${2?"path for disk to burn is missing: \$2"}
4+
IMAGE=${1?"path to image is missing: \$1"}
5+
DISK=${2?"path for disk for burning is missing: \$2"}
76

87
echo "[Burn] Starting..."
9-
dd bs=512 if=${BINARY:?} of=${DISK:?}
10-
echo -ne "\x55\xaa" | dd seek=510 bs=1 of=${DISK:?}
8+
dd bs=512 if=${IMAGE:?} of=${DISK:?}
119
echo "[Burn] Done."

scripts/common.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

scripts/run.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
%include "constants.asm"
2-
;;%include "io.asm___
3-
"
2+
;;%include "io.asm"
43
%macro print_string 4
54
; Args: (str, len, x, y)
65
; check es, bx

0 commit comments

Comments
 (0)