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
0a7e2777
authored
Sep 06, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Testing switch to protected mode for execution of C code. Does not work. At all.
parent
69500cf3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
boot.asm
boot.asm
View file @
0a7e2777
...
...
@@ -41,13 +41,14 @@ read_fail db 'Failure to read from disk.', 13, 10, 0
times
510
-
(
$
-
$$
)
db
0
; Fill last two bytes (a word) with the MBR signature 0xAA55
dw
0xaa55
;---------------- BOOTLOADER CODE ----------------;
ls
:
mov
si
,
str1
; pointer to string in si
call
PrintStr
; print string
jmp
Main
;
hlt
;---------------- SCREEN FUNCTIONS ---------------;
PrintStr
:
; print string at SI
nextChar
:
mov
al
,
[si]
; grab next char
...
...
@@ -95,7 +96,7 @@ PrintHexChar:
call
PrintChar
ret
;------------------ DATA BLOCK ------------------;
str1
db
'
Hello
World
'
,
0
; Hello World
str2
db
'
WHY
IS
THIS
'
,
0
...
...
@@ -109,3 +110,28 @@ Main: ;main section
mov
si
,
str1
mov
ax
,
10
call
PrintHexStr
; print string
mov
ax
,
0x2401
int
0x15
;; now to try protected mode...
cli
lgdt
[gdtinfo]
mov
eax
,
cr0
or
al
,
1
mov
cr0
,
eax
jmp
08
h
:
PMain
gdtinfo
:
dw
gdt_end
-
gdt
-
1
;last byte in table
dd
gdt
;start of table
gdt
dd
0
,
0
flatdesc
db
0xff
,
0xff
,
0
,
0
,
0
,
10010010
b
,
11001111
b
,
0
gdt_end
:
db
0x55
db
0xAA
PMain
:
nop
nop
hlt
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