Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


First cut at a keyboard device (partially done)
[palacios.git] / palacios / src / geekos / lowlevel.asm
index 63f93c2..fe3b61b 100644 (file)
@@ -2,7 +2,7 @@
 ; Low level interrupt/thread handling code for GeekOS.
 ; Copyright (c) 2001,2003,2004 David H. Hovemeyer <daveho@cs.umd.edu>
 ; Copyright (c) 2003, Jeffrey K. Hollingsworth <hollings@cs.umd.edu>
-; $Revision: 1.1 $
+; $Revision: 1.5 $
 
 ; This is free software.  You are permitted to use,
 ; redistribute, and modify it as specified in the file "COPYING".
@@ -165,12 +165,15 @@ EXPORT Flush_TLB
 ; CPUID functions
 EXPORT cpuid_ecx
 EXPORT cpuid_eax
+EXPORT cpuid_edx
 
 ; Utility Functions
 EXPORT Set_MSR
 EXPORT Get_MSR
 
+
 EXPORT Get_CR2
+EXPORT Get_CR3
 
 
 EXPORT Proc_test
@@ -269,6 +272,29 @@ Flush_TLB:
        ret
 
 
+
+;
+; cpuid_edx - return the edx register from cpuid
+;
+align 8
+cpuid_edx:
+       push    ebp
+       mov     ebp, esp
+       push    edx
+       push    ecx
+       push    ebx
+
+       mov     eax, [ebp + 8]
+       cpuid
+       mov     eax, edx
+
+       pop     ebx
+       pop     ecx
+       pop     edx
+       pop     ebp
+       ret
+
+
 ;
 ; cpuid_ecx - return the ecx register from cpuid
 ;
@@ -276,11 +302,17 @@ align 8
 cpuid_ecx:
        push    ebp
        mov     ebp, esp
+       push    edx
        push    ecx
+       push    ebx
+
        mov     eax, [ebp + 8]
        cpuid
        mov     eax, ecx
+
+       pop     ebx
        pop     ecx
+       pop     edx
        pop     ebp
        ret
 
@@ -289,8 +321,19 @@ cpuid_ecx:
 ;
 align 8
 cpuid_eax:
+       push    ebp
+       mov     ebp, esp
+       push    edx
+       push    ecx
+       push    ebx
+
        mov     eax, [esp+4]
        cpuid
+
+       pop     ebx
+       pop     ecx
+       pop     edx
+       pop     ebp
        ret
 
 ;
@@ -332,6 +375,7 @@ Get_MSR:
 
 
 
+
 align 8
 Get_CR2:
        mov     eax, cr2
@@ -339,6 +383,11 @@ Get_CR2:
 
 
 align 8
+Get_CR3:
+       mov     eax, cr3
+       ret
+
+align 8
 Proc_test:
        push    ebp
        mov     ebp, esp