summaryrefslogtreecommitdiff
path: root/util/ADLO/Makefile
blob: 6af8c7409e6f43035e03ea7c35a315216d8221c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#-------------------------------------------------
# $Id: Makefile,v 1.2 2003/05/22 12:52:38 aip Exp $
#-------------------------------------------------

ELF064=elf/elf-header-065kb.payload
ELF113=elf/elf-header-113kb.payload
ELF129=elf/elf-header-129kb.payload

LOADER=loader.o

BOCHS_R=bochs
BOCHS_B=bochs/bios
BOCHS_C=bochs/bochs-cvs
BOCHS_X=bochs/bochs-cvs/bochs/bios

BIOS_R=${BOCHS_R}/rombios.bin
BIOS_B=${BOCHS_B}/rombios.bin
BIOS_X=${BOCHS_X}/rombios.bin

PAYLOAD=payload

BOCHSCVS=-d:pserver:anonymous@cvs.bochs.sourceforge.net:/cvsroot/bochs

#-------------------------------------------------

all: clean build #install

#-------------------------------------------------

epia: loader.o bios
	cat ${ELF064} ${LOADER} ${BIOS_B} > ${PAYLOAD}
build: loader.o bios
	cat ${ELF064} ${LOADER} ${BIOS_B} > ${PAYLOAD}

#-------------------------------------------------

loader.o: loader.s
	as86 loader.s -b ${LOADER}

#-------------------------------------------------

bios:
	( cd ${BOCHS_B} ; $(MAKE) )
	sync

#-------------------------------------------------

#64kb -- sive of Video BIOS
#
#C=`echo 64*1024 | bc`
C=65536

#0xC0000 -- start of Video BIOS in ram.
#S=`echo -e "ibase=16 \n C0000" | bc`
#
# ELF header offset -- 0x1000 == 4096
#
# 786432+4096 = 790528
S=790528

videobios:
	 dd if=/proc/kcore of=./video.bios.bin bs=1 count=${C} skip=${S}

# 0xF000+0x1000
S2=987136

pcbios: 
	 dd if=/proc/kcore of=./pc.bios.bin bs=1 count=${C} skip=${S2}

pirq: pcbios
	#grep -a "\$PIR" -B0 -A127 pc.bios.bin > pirq.bin
	grep -a "\$PIR" -B0 -A0 pc.bios.bin > pirq.bin

#now you have to hand edit the pirq.bin file

#-------------------------------------------------

bochslogin:
	mkdir -p ${BOCHS_C}
	echo "When prompted for a password, simply press the Enter key."
	( cd ${BOCHS_C} ; cvs ${BOCHSCVS} login )

bochsco:
	mkdir -p ${BOCHS_C}
	( cd ${BOCHS_C} ; cvs ${BOCHSCVS} co bochs/bios )

bochsstat:
	( cd ${BOCHS_C} ; cvs ${BOCHSCVS} status bochs/bios/rombios.c )

bochsupdate:
	( cd ${BOCHS_C} ; cvs ${BOCHSCVS} update bochs/bios/rombios.c )


#-------------------------------------------------

install:
	cp -abf ${PAYLOAD} /tftpboot/kernel
	sync

#-------------------------------------------------

clean:
	rm -rf *.o ${PAYLOAD}
	(cd ${BOCHS_B} ; $(MAKE) clean ) 

distclean: clean
	rm -rf ${BOCHS_C}

#-------------------------------------------------