system.h

Go to the documentation of this file.
00001 /* system.h */
00002 
00003 #ifndef __ROUTIX_TYPES
00004 #include "sys/types.h"
00005 #endif
00006 
00007 #ifndef __SYSTEM
00008 #define __SYSTEM
00009 
00010 #define rdtscl(low) \
00011      __asm__ __volatile__ ("rdtsc" : "=A" (low))
00012 
00013 
00014 /* Constantes de memoria física y virtual */
00015 #define KERNEL_FCODE    0
00016 #define KERNEL_FDATA    0x100000
00017 #define KERNEL_FSTACK_TOP 0x200000      
00018 #define KERNEL_STACK_SIZE 0x20000
00019 #define KERNEL_FSTACK   KERNEL_FSTACK_TOP - KERNEL_STACK_SIZE
00020 
00021 #define KERNEL_END      KERNEL_FSTACK_TOP
00022 
00023 #define KERNEL_CODE             0xc0000000
00024 #define KERNEL_DATA             0xc8000000
00025 #define KERNEL_STACK            0xd0000000
00026 #define KERNEL_STACK_TOP        KERNEL_STACK + 0x8000000
00027 #define KERNEL_INTERRUPT        KERNEL_STACK_TOP
00028 
00029 
00030 #define DESC_CODE               1<<3
00031 #define DESC_DATA               2<<3
00032 #define DESC_CODE_USUARIO       3<<3 | 3
00033 #define DESC_DATA_USUARIO       4<<3 | 3
00034 #define DESC_TSS0               5<<3
00035 #define DESC_TSS1               6<<3
00036 
00037 /* Variables Globales */
00038 extern dword memoria;
00039 
00040 extern addr_t KERNEL_PDT;
00041 extern addr_t USER_PDT;
00042 
00043 //Kernel PANIC (suceso inesperado o irrecuperable)
00044 void kpanic(char *str);
00045 
00046 #define nop() __asm__ __volatile__ ("nop")
00047 
00048 #define cli() __asm__ __volatile__ ("pushf ; cli")
00049 #define sti() __asm__ __volatile__ ("popf")
00050 
00051 #define _cli()  __asm__ __volatile__ ("cli")
00052 #define _sti()  __asm__ __volatile__ ("sti")
00053 
00054 int getvar (char *);
00055 int setvar (char *, int);
00056 // Funciones de libreria
00057 int sys_putc (char);
00058 void kprintf ( char *string, ... );
00059 
00060 
00061 #endif

Generated on Sun May 30 18:38:35 2004 for Routix OS by doxygen 1.3.6