Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Quellcode |
|
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 |
;Bootloader.asm [BITS 16] ;16-Bit Code erstellen org 0x7C00 ;Startadresse festlegen 0000:7c00 ;=============== Funktionen =============== start: cli ;Interrupts ausschalten mov ax, 0x9000 ;Adresse des Stack speichern mov ss, ax ;Stackadresse festlegen mov sp, 0 ;Stackpointer auf 0 setzen sti ;Interrupts wieder einschalten mov [bootdriv], dl ;Bootlaufwerk speichern mov si, kernelload ;Info-Nachricht speichern call boot_printstring ;Nachricht ausgeben call loadkernel ;Kernel laden mov ax, 0x1000 ;Speicheradresse des Kernels mov es, ax mov ds, ax push ax mov ax, 0 push ax retf ;FAR-Rücksprung zum Kernel ;===== Lädt den Kernel ===== loadkernel: push ds mov ax, 0 mov dl, [bootdriv] int 13h pop ds jc loadkernel loadkernel1: mov ax, 0x1000 mov es, ax mov bx, 0 mov ah, 2 mov al, 5 mov cx, 2 mov dx, 0 int 13h jc loadkernel1 mov si, successload ;Erfolgsnachricht speichern call boot_printstring ;Nachricht ausgeben retn ;===== String ausgeben ===== boot_printstring: lodsb or al, al jz short boot_printstringd mov ah, 0x0E mov bx, 0x0007 int 0x10 jmp boot_printstring boot_printstringd: retn ;=============== Variablen =============== .DATA bootdriv db 0 ;Das Bootlaufwerk kernelload db "Please wait while loading the kernel into memory...",13,10,13,10,0 ;Info-Nachricht successload db "Kernel was success load into memory...",13,10,13,10,0 ;Erfolgsnachricht times 512-($-$$)-2 db 0 ;Bootloader auf 512 Bytes (1 Sektor) vergrößern dw 0AA55h ;Bootloader-Kennung (Endadresse) |
Quellcode |
|
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 |
;Kernel.asm mov ax, 1000h mov ds, ax mov es, ax ;=============== Funktionen =============== ;===== Einstiegspunkt des Kernels ===== start: mov si, kernelversion ;Bestätigungsnachricht laden call printstring ;Bestätigungsnachricht ausgeben call asm_kbhit ;Warten bis man eine Taste gedrückt hat jmp reset ;Wenn eine Taste gedrückt wurde, dann resette ;===== Wartet einen Tastendruck ab ===== asm_kbhit: mov ah, 0 int 016h ret ;===== Gibt einen Text aus ===== printstring: lodsb or al,al jz short putstrd mov ah,0x0E mov bx,0x0007 int 0x10 jmp printstring putstrd: retn ;===== Startet den PC neu ===== reset: db 0Eah dw 0000h dw 0FFFFh ;=============== Variablen =============== .DATA kernelversion db "Kernel v1.0a",13,10,13,10,0 ;Bestätigungsnachricht |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
@echo off nasmw Bootloader.asm -f bin -o Bootloader.bin echo Bootloader.bin wurde erstellt nasmw Kernel.asm -f bin -o Kernel.bin echo Kernel.bin wurde erstellt echo. copy Bootloader.bin+Kernel.bin Boot.img echo Das Image Boot.img wurde erfolgreich erstellt pause |
Werbeanzeige