#
# This code is identical to bootasm.S except:
# - it does not need to enable A20
-# - it uses 0(start-4) for the %esp
-# - it jumps to 0(start-8) instead of calling cmain
+# - it uses the address at start-4 for the %esp
+# - it jumps to the address at start-8 instead of calling cmain
.set PROT_MODE_CSEG, 0x8 # kernel code segment selector
.set PROT_MODE_DSEG, 0x10 # kernel data segment selector
void panic(char*) __attribute__((noreturn));
// exec.c
-int exec(char*, char**);
+int exec(char*, char**);
// file.c
struct file* filealloc(void);
inb(ushort port)
{
uchar data;
+
asm volatile("in %1,%0" : "=a" (data) : "d" (port));
return data;
}
cpuid(uint info, uint *eaxp, uint *ebxp, uint *ecxp, uint *edxp)
{
uint eax, ebx, ecx, edx;
+
asm volatile("cpuid" :
"=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) :
"a" (info));