21
19. April 2024, 19:29
Diese Sektion erlaubt es dir alle Beiträge dieses Mitglieds zu sehen. Beachte, dass du nur solche Beiträge sehen kannst, zu denen du auch Zugriffsrechte hast.
;pm32.asm
[Bits 32]
extern _main
extern _jump
global start
start:
mov BYTE [0xB8000],0x4F
mov BYTE [0xB8000+1],7
mov BYTE [0xB8000+2],0x4B
mov BYTE [0xB8000+3],7
call _jump
Stop:
jmp Stop
;check_link.asm
[bits 32]
global _jump
_jump:
mov BYTE [0xB8000],0x4F
mov BYTE [0xB8000+1],16
mov BYTE [0xB8000+2],0x4B
mov BYTE [0xB8000+3],16
ret
//Linkfile
OUTPUT_FORMAT("binary")
INPUT(pm32.o check_link.o kernel.o video.o)
ENTRY(start)
SECTIONS
{
.text 0x10200: {
*(.text)
. = ALIGN(1);
}
.data : {
*(.data)
. = ALIGN(1);
}
.bss : {
*(.bss)
. = ALIGN(1);
}
end = .;_end = .;__end = .;
}
pm32.obj: file not recognized: File format not recognized
nasmw -f aout -o pm32.obj pm32.asm
[Bits 32]
extern _main
global start
start:
call _main
Stop:
jmp Stop
jmp code ;Bootjump
db "MSWIN4.1" ;OS_Name
db 0x200 ;Bytes/Sector
db 0x01 ;Anzahl Sektoren/Cluster
db 0x02 ;FAT-Tabellen
db 0xe0
db 0xb40
db 0xF0
db 0x09
db 0x12
db 0x02
db 0x00
db 0x00
db 0x00
db 0x00
db 0x29
db 0x00
db 0x00
db 0x00
db 0x00
db " "
db "FAT12 "
msg db "Hallo auf meiner Diskette",0
code:
mov si,msg
lodsb
or al,al
jz code_end
mov ah,0x0e
mov bx,0x0007
int 0x10
jmp code
code_end:
times 512-($-$$)-2 db 0
dw 0x0aa55
mov ax,1000h
mov ds,ax
mov es,ax
start:
mov si,msg
mov al,0x01
int 0x21
mov si,msg_clear
mov al,0x01
int 21h
mov si,msg_os1
mov al,0x01
int 21h
mov si,msg_os2
mov al,0x01
int 21h
mov si,msg_os3
call putstr
mov si,msg_os4
call putstr
mov si,msg_os5
call putstr
mov si,msg_os6
call putstr
mov si,msg_os7
call putstr
mov si,msg_os8
call putstr
mov si,msg_os9
call putstr
mov si,msg_os0
call putstr
mov si,msg_clear
call putstr
mov si,msg_boot
call putstr
call getkey
jmp reboot
msg db " Jeremia B",132,"r pr",132,"sentiert:",13,10,0
msg_boot db " Diskette entnehmen und Taste dr",129,"cken....",13,10,0
msg_clear db 13,10,0
msg_os1 db " 11111 1 111 11111",13,10,0
msg_os2 db " 1 1 11 11 1 ",13,10,0
msg_os3 db " 1 1 1 1 1 ",13,10,0
msg_os4 db " 1 1 1 1 1 1 ",13,10,0
msg_os5 db " 1111 1 11 1 1 1 ",13,10,0
msg_os6 db " 1 1 111 11111 1111 1 11 1 1 11111",13,10,0
msg_os7 db " 1 111 1 1 1 1 11 111 1 1 1",13,10,0
msg_os8 db " 1 1 11111 1 1 1 11 1 1 1",13,10,0
msg_os9 db " 1 1 1 1 111 1 11 11 11 1",13,10,0
msg_os0 db " 1 1 11111 111 1 1 1 111 11111",13,10,0
;Interrupts anmelden
push dx
push es
xor ax,ax
mov es,ax
cli
mov word [es:0x21*4],_int0x21
mov [es:0x21*4+2],cs
sti
pop es
pop dx
;Die Interrupts
_int0x21:
_int0x21_ser0x01:
cmp al,0x01
jne _int0x21_end
_int0x21_ser0x01_start:
lodsb
or al,al
jz _int0x21_ser0x01_end
mov ah,0x0e
mov bx,0x0007
int 0x10
jmp _int0x21_ser0x01_start
_int0x21_ser0x01_end:
jmp _int0x21_end
_int0x21_end:
iret
putstr:
lodsb
or al,al
jz short putstrd
mov ah,0x0e
mov bx,0x0007
int 0x10
jmp putstr
putstrd:
retn
getkey:
mov ah,0
int 016h
ret
reboot:
db 0eah
dw 0000h
dw 0ffffh