-
Notifications
You must be signed in to change notification settings - Fork 0
/
loader_fake.kaba
81 lines (72 loc) · 1.93 KB
/
loader_fake.kaba
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
#----------------------------------------------------------------------------*\
#| Eusebius - Boot Loader |
#| -> Boot-Loader fuer die Root-Partition |
#| -> laedt das Image des Init-Programmes von der aktuellen Partition |
#| in den Speicher und fuehrt es aus |
#| |
#| zuletzt geaendert: 2008.09.14 (c) by MichiSoft TM |
#\*----------------------------------------------------------------------------
func main()
asm{
# wir befinden uns noch im 16bit RealMode
bits_16
# Debug
mov al, 'L'
mov ah, 0x0e
mov bx, 0x0000
int 0x10
mov al, 'L'
mov ah, 0x0e
mov bx, 0x0000
int 0x10
# Image laden
_reset_drive:
mov dl, 0x00
mov ah, 0x00
int 0x13
or ah, ah
#jnz.b _reset_drive
xor ax, ax
mov es, ax
# Ziel des Images
mov ebx, 0x00007e00
mov ah, 0x02 # "ReadSector"
mov al, 0x02
mov cx, 0x0019
mov dx, 0x0080
#mov al, 0x04 # 4 Sektoren = 2kb
#mov cx, 0x0006 # Cylinder 0, Sector 6
#mov dx, 0x0180 # Head 1 ,Disk0
int 0x13
or ah, ah
#jnz _reset_drive
jnz _death
# Debug
mov al, 'J'
mov ah, 0x0e
mov bx, 0x0000
int 0x10
# das Image ausführen
jmp_far 0x00007e00 # 0x0000:0x7e00
_death:
mov al, 'X'
mov ah, 0x0e
mov bx, 0x0000
int 0x10
jmp $
#--------------------------------------------------------------
# Daten
# Position des zu ladenden Images (abhängig von der Festplatte/Partitionierung!!!)
# (Partition-Beginn: h-s-c 01-01-00)
_read_cx:
dw 0x0006 # Cylinder 0, Sector 6
_read_dx:
dw 0x0180 # Head 1 ,Disk 0
_read_size:
dw 0x0004 # 4 Sektoren = 2kb
_read_size_kernel:
dw 0x0040 # 64 Sektoren = 32kb
# auf welcher Partition befinden wir uns?
_partition_no:
dw 0x0000 # 1. primäre Partition!
}