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
str2
db
'
WHY
IS
THIS
'
,
0
hexChars
db
'
0123456789
abcdef
'
; Used for hex formatting
gdtr
:
dw
48
dw
0x0
dw
gdt
gdtr
:
dw
gdt_end
-
gdt
-
1
dd
gdt
Main
:
;main section
nop
nop
...
...
@@ -133,49 +132,38 @@ setGdt:
mov
eax
,
cr0
or
eax
,
1
mov
cr0
,
eax
jmp
08
h
:
PMain
gdt
:
times
16
db
0
dw
0xffff
; segment limit
.
src
:
dw
0
db
2
db
0x93
; data access rights
dw
0
dw
0xffff
; segment limit
.
dest
:
dw
0
db
0x10
; load protected-mode kernel to 100000h
db
0x93
; data access rights
dw
0
times
15
db
0
gdt_end
:
db
0
;; .null: times 8 db 0
;; .code: dw 0x0400 ; limit (4MiB)
;; dw 0x0000 ; base 0-15
;; db 0x00 ; base 16-23
;; 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
dd
0
dd
0
.
code
:
dw
0
FFFFh
; limit
dw
0
; base low
db
0
; base mid
db
10011010
b
; access
db
11001111
b
; granularity
db
0
; base high
.
data
:
dw
0
FFFFh
; limit
dw
0
; base low
db
0
; base mid
db
10010010
b
; access
db
11001111
b
; granularity
db
0
; base high
gdt_end
:
[
bits
32
]
PMain
:
[
bits
32
]
mov
si
,
str1
call
PrintStr
nop
nop
hlt
mov
ax
,
0x10
; set data segments to data selector (0x10)
mov
ds
,
ax
mov
ss
,
ax
mov
es
,
ax
mov
esp
,
90000
h
;mov si, str1
;call PrintStr
;nop
;nop
hlt
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