Paging stuff.
git-svn-id: https://spexeah.com:8443/svn/Asuro@113 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
@ -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);
|
||||
|
||||
|
@ -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.
|
@ -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
|
||||
|
@ -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.
|
||||
|
Reference in New Issue
Block a user