
Dose anyone can ake the code???




You wil get the tutorial at osdever.net
Seriously, if you cannot take enough care to copy the name of the tutorial correctly, I don't expect you can copy the code correctly.Paging for Barns Kernel Development Tutorial???
Care to prove it?Yashas wrote:What ever.I had made it so advanced that it supported VGA, ATA, IDE, ACPI(Great Difficulty),ATA PI,ISO File System and now i am trying NTFS (I am Crazy).
ACPI or AHCI ?ACPI COde //
////////////////////////////////////////////
there a glitch also here
static void ahci_pci_save_initial_config(struct pci_dev *pdev,
struct ahci_host_priv *hpriv)
{
No. You get #GP if you enable paging (by writing to CR0), or modify CR3 in ring3.Yashas wrote:There was a line go to ring3 and set up the cr3 to enable paging.I do that then i got the next instruction in those tutorial.Not just copypaste.
Code: Select all
; --------------------------------------
; Identify Map
; --------------------------------------
mov edi, K_PHYADDR(k_pagetbl_kernel)
mov ecx, K_PHYADDR(_kernel_end) +4096
mov eax, 1
.1:
stosd
add eax, 4096
cmp eax, ecx ; map 0 to _kernel_end, assume < 4 MiB
jb .1
; --------------------------------------
; Map the tables
; --------------------------------------
mov eax, K_PHYADDR(k_pagedir)
mov dword [eax + ((KERNEL_PHYADDR>>22)*4)], K_PHYADDR(k_pagetbl_kernel) +1
mov dword [eax + ((KERNEL_ADDR>>22)*4)], K_PHYADDR(k_pagetbl_kernel) +1
mov dword [eax + 1023*4], K_PHYADDR(k_pagedir) +1
; --------------------------------------
; Enable paging
; --------------------------------------
mov cr3, eax
mov ebx, cr0
or ebx, 0x80000000
mov cr0, ebx
lea ecx, [.HigherHalf]
jmp ecx
.HigherHalf:
; --------------------------------------
; Unmap identify
; --------------------------------------
mov dword [k_pagedir + (KERNEL_PHYADDR>>20)], 0
mov cr3, eax