Paging stuff.

git-svn-id: https://spexeah.com:8443/svn/Asuro@113 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron
2017-05-19 14:32:06 +00:00
parent f40c1ca749
commit 97299c839c
49 changed files with 41 additions and 0 deletions

View File

@ -57,6 +57,14 @@ begin
STI;
isr32.hook(uint32(@bios_data_area.tick_update));
{z:= 1;
while true do begin
console.writeintln(z);
pint:= kalloc(65000);
if pint = nil then while true do begin end else pint^:= 1234;
z:=z+1;
end;}
//drivers
keyboard.init(keyboard_layout);

View File

@ -2,6 +2,32 @@ unit paging;
interface
type
PPageTableEntry = ^TPageTableEntry;
TPageTableEntry = bitpacked record
Present, Writable, UserMode, WriteThrough,
NotCacheable, Accessed, Dirty, AttrIndex,
GlobalPage: Boolean;
Avail: UBit3;
FrameAddr: UBit20;
end;
PPageDirEntry = ^TPageDirEntry;
TPageDirEntry = bitpacked record
Present, Writable, UserMode, WriteThrough,
NotCacheable, Accessed, Reserved, PageSize,
GlobalPage: Boolean;
Avail: UBit3;
TableAddr: UBit20;
end;
TPageDirectory = Array[1..1024] of TPageDirEntry;
PPageDirectory = ^TPageDirectory;
Var
PageDirectory : TPageDirectory; external name '_PageDirectory';
implementation
end.

View File

@ -41,6 +41,8 @@ KERNEL_PAGE_NUMBER equ (KERNEL_VIRTUAL_BASE >> 22)
section .data
align 0x1000
_PageDirectory equ BootPageDirectory
global _PageDirectory
BootPageDirectory:
dd 0x00000083
times (KERNEL_PAGE_NUMBER - 1) dd 0

View File

@ -13,6 +13,7 @@ interface
const
KERNEL_VIRTUAL_BASE = $C0000000;
KERNEL_PAGE_NUMBER = KERNEL_VIRTUAL_BASE SHR 22;
type
//internal types
@ -53,6 +54,10 @@ type
Void = ^uInt32;
//Alternate Types
UBit3 = 0..(1 shl 3) - 1;
UBit20 = 0..(1 shl 20) - 1;
implementation
end.