Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
triazo
/
kernel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
3
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
92318b02
authored
Sep 02, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
hello world bootloader, boots properly on x86
parent
c3b5208c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
boot.asm
boot.asm
0 → 100644
View file @
92318b02
;--------------- PRELIMINARY SETUP ---------------;
[
BITS
16
]
; 16 bit real mode
[
ORG
0x7C00
]
; MBR is loaded at 0x7C00
;---------------- BOOTLOADER CODE ----------------;
ls
:
MOV
SI
,
str1
; pointer to string in SI
CALL
PrintStr
; print string
;MOV ebx, 1000 ;start at 10000
;SUB ebx, 1 ;down 1 each time
;NOP ;waste time
;JZ 6 ;for loop
;JMP ls ;
HLT
;---------------- SCREEN FUNCTIONS ---------------;
PrintStr
:
; print string at SI
nextchar
:
MOV
AL
,
[SI]
; Grab next char
OR
AL
,
AL
; if char is null term
JZ
exit
; then return
CALL
PrintChar
; else print char
INC
SI
; inc pointer to next char
JMP
nextchar
; loop
exit
:
RET
PrintChar
:
; print char at AL
MOV
AH
,
0x0E
; Teletype Mode
MOV
BH
,
0x00
; Page zero
MOV
BL
,
0x07
; Light Gray
INT
0x10
; Print Character
RET
;------------------ DATA BLOCK ------------------;
str1
db
'
Hello
World
'
,
0
;stuff
;-------------- PADDING / SIGNATURE -------------;
; $ is current line, $$ is first line, db 0 is a 00000000 byte
; So, pad the code with 0s until you reach 510 bytes
TIMES
510
-
(
$
-
$$
)
DB
0
; Fill last two bytes (a word) with the MBR signature 0xAA55
DW
0xAA55
Main
:
;main section
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment