nits
This commit is contained in:
parent
8e67005320
commit
7bb73cdbc7
3 changed files with 5 additions and 3 deletions
|
@ -15,8 +15,8 @@
|
||||||
#
|
#
|
||||||
# This code is identical to bootasm.S except:
|
# This code is identical to bootasm.S except:
|
||||||
# - it does not need to enable A20
|
# - it does not need to enable A20
|
||||||
# - it uses 0(start-4) for the %esp
|
# - it uses the address at start-4 for the %esp
|
||||||
# - it jumps to 0(start-8) instead of calling cmain
|
# - it jumps to the address at start-8 instead of calling cmain
|
||||||
|
|
||||||
.set PROT_MODE_CSEG, 0x8 # kernel code segment selector
|
.set PROT_MODE_CSEG, 0x8 # kernel code segment selector
|
||||||
.set PROT_MODE_DSEG, 0x10 # kernel data segment selector
|
.set PROT_MODE_DSEG, 0x10 # kernel data segment selector
|
||||||
|
|
2
defs.h
2
defs.h
|
@ -23,7 +23,7 @@ void kbd_intr(void);
|
||||||
void panic(char*) __attribute__((noreturn));
|
void panic(char*) __attribute__((noreturn));
|
||||||
|
|
||||||
// exec.c
|
// exec.c
|
||||||
int exec(char*, char**);
|
int exec(char*, char**);
|
||||||
|
|
||||||
// file.c
|
// file.c
|
||||||
struct file* filealloc(void);
|
struct file* filealloc(void);
|
||||||
|
|
2
x86.h
2
x86.h
|
@ -5,6 +5,7 @@ static inline uchar
|
||||||
inb(ushort port)
|
inb(ushort port)
|
||||||
{
|
{
|
||||||
uchar data;
|
uchar data;
|
||||||
|
|
||||||
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
|
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -91,6 +92,7 @@ static inline void
|
||||||
cpuid(uint info, uint *eaxp, uint *ebxp, uint *ecxp, uint *edxp)
|
cpuid(uint info, uint *eaxp, uint *ebxp, uint *ecxp, uint *edxp)
|
||||||
{
|
{
|
||||||
uint eax, ebx, ecx, edx;
|
uint eax, ebx, ecx, edx;
|
||||||
|
|
||||||
asm volatile("cpuid" :
|
asm volatile("cpuid" :
|
||||||
"=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) :
|
"=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) :
|
||||||
"a" (info));
|
"a" (info));
|
||||||
|
|
Loading…
Reference in a new issue