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
35ecb3ae
authored
Sep 13, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
GDT all fixed up, no longer crashes. Added some 32 bit setup.
parent
ed35d779
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
44 deletions
boot.asm
boot.asm
View file @
35ecb3ae
...
@@ -101,9 +101,8 @@ str1 db 'Hello World', 0 ; Hello World
...
@@ -101,9 +101,8 @@ str1 db 'Hello World', 0 ; Hello World
str2
db
'
WHY
IS
THIS
'
,
0
str2
db
'
WHY
IS
THIS
'
,
0
hexChars
db
'
0123456789
abcdef
'
; Used for hex formatting
hexChars
db
'
0123456789
abcdef
'
; Used for hex formatting
gdtr
:
dw
48
gdtr
:
dw
gdt_end
-
gdt
-
1
dw
0x0
dd
gdt
dw
gdt
Main
:
;main section
Main
:
;main section
nop
nop
nop
nop
...
@@ -133,49 +132,38 @@ setGdt:
...
@@ -133,49 +132,38 @@ setGdt:
mov
eax
,
cr0
mov
eax
,
cr0
or
eax
,
1
or
eax
,
1
mov
cr0
,
eax
mov
cr0
,
eax
jmp
08
h
:
PMain
jmp
08
h
:
PMain
gdt
:
gdt
:
times
16
db
0
dd
0
dw
0xffff
; segment limit
dd
0
.
src
:
.
code
:
dw
0
dw
0
FFFFh
; limit
db
2
dw
0
; base low
db
0x93
; data access rights
db
0
; base mid
dw
0
db
10011010
b
; access
dw
0xffff
; segment limit
db
11001111
b
; granularity
.
dest
:
db
0
; base high
dw
0
.
data
:
db
0x10
; load protected-mode kernel to 100000h
dw
0
FFFFh
; limit
db
0x93
; data access rights
dw
0
; base low
dw
0
db
0
; base mid
times
15
db
0
db
10010010
b
; access
gdt_end
:
db
0
db
11001111
b
; granularity
;; .null: times 8 db 0
db
0
; base high
;; .code: dw 0x0400 ; limit (4MiB)
gdt_end
:
;; dw 0x0000 ; base 0-15
;; db 0x00 ; base 16-23
[
bits
32
]
;; db 0x9A ; access byte
;; db 0xC0 ; flags/limit 16-19
;; db 0x04 ; base 24-31
;; .data: dw 0x0400
;; dw 0x0000
;; db 0x00
;; db 0x92
;; db 0xC0
;; db 0x08
;; .tss: dw 0x0400
;; dw 0x0000
;; db 0x00
;; db 0x89
;; db 0xC0
;; db 0x0C
PMain
:
PMain
:
[
bits
32
]
mov
si
,
str1
mov
ax
,
0x10
; set data segments to data selector (0x10)
call
PrintStr
mov
ds
,
ax
nop
mov
ss
,
ax
nop
mov
es
,
ax
hlt
mov
esp
,
90000
h
;mov si, str1
;call PrintStr
;nop
;nop
hlt
jp
$
jp
$
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