Modestus Moon OS  R4
CS 450 project
system.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  date_time
 
struct  s_processContext
 The s_processContext struct defines the context that each process stores . More...
 

Macros

#define NULL   0
 
#define no_warn(p)   if (p) while (1) break
 
#define asm   __asm__
 
#define volatile   __volatile__
 
#define sti()   asm volatile ("sti"::)
 
#define cli()   asm volatile ("cli"::)
 
#define nop()   asm volatile ("nop"::)
 
#define hlt()   asm volatile ("hlt"::)
 
#define iret()   asm volatile ("iret"::)
 
#define GDT_CS_ID   0x01
 
#define GDT_DS_ID   0x02
 

Typedefs

typedef unsigned int size_t
 
typedef unsigned char u8int
 
typedef unsigned short u16int
 
typedef unsigned long u32int
 
typedef unsigned char uint8_t
 
typedef unsigned short uint16_t
 
typedef unsigned long uint32_t
 
typedef struct s_processContext processContext_t
 

Functions

void klogv (const char *msg)
 
void kpanic (const char *msg)
 
struct s_processContext __attribute__ ((packed))
 

Variables

u32int gs
 
u32int fs
 
u32int es
 
u32int ds
 
u32int edi
 
u32int esi
 
u32int ebp
 
u32int esp
 
u32int ebx
 
u32int edx
 
u32int ecx
 
u32int eax
 
u32int eip
 
u32int cs
 
u32int eflags
 

Macro Definition Documentation

#define asm   __asm__

Definition at line 11 of file system.h.

#define cli ( )    asm volatile ("cli"::)

Definition at line 15 of file system.h.

Referenced by kmain(), kpanic(), set_date(), and set_time().

#define GDT_CS_ID   0x01

Definition at line 20 of file system.h.

#define GDT_DS_ID   0x02

Definition at line 21 of file system.h.

#define hlt ( )    asm volatile ("hlt"::)

Definition at line 17 of file system.h.

Referenced by kmain(), and kpanic().

#define iret ( )    asm volatile ("iret"::)

Definition at line 18 of file system.h.

#define no_warn (   p)    if (p) while (1) break

Definition at line 7 of file system.h.

Referenced by alloc(), and make_heap().

#define nop ( )    asm volatile ("nop"::)

Definition at line 16 of file system.h.

#define NULL   0

Definition at line 4 of file system.h.

Referenced by parse_comm(), and strtok().

#define sti ( )    asm volatile ("sti"::)

Definition at line 14 of file system.h.

Referenced by set_date(), and set_time().

#define volatile   __volatile__

Definition at line 12 of file system.h.

Typedef Documentation

Definition at line 65 of file system.h.

typedef unsigned int size_t

Definition at line 24 of file system.h.

typedef unsigned short u16int

Definition at line 26 of file system.h.

typedef unsigned long u32int

Definition at line 27 of file system.h.

typedef unsigned char u8int

Definition at line 25 of file system.h.

typedef unsigned short uint16_t

Definition at line 30 of file system.h.

typedef unsigned long uint32_t

Definition at line 31 of file system.h.

typedef unsigned char uint8_t

Definition at line 29 of file system.h.

Function Documentation

struct s_processContext __attribute__ ( (packed)  )
void klogv ( const char *  msg)

Definition at line 11 of file system.c.

References serial_println(), and strcat().

Referenced by kmain(), and kpanic().

12 {
13  char logmsg[64] = {'\0'}, prefix[] = "klogv: ";
14  strcat(logmsg, prefix);
15  strcat(logmsg, msg);
16  serial_println(logmsg);
17 }
char * strcat(char *s1, const char *s2)
strcat concatenates the contents of one string onto another.
Definition: string.c:101
int serial_println(const char *msg)
Definition: serial.c:44
void kpanic ( const char *  msg)

Definition at line 24 of file system.c.

References cli, hlt, klogv(), and strcat().

Referenced by do_bounds(), do_breakpoint(), do_coprocessor(), do_coprocessor_segment(), do_debug(), do_device_not_available(), do_divide_error(), do_double_fault(), do_general_protection(), do_invalid_op(), do_invalid_tss(), do_nmi(), do_overflow(), do_page_fault(), do_segment_not_present(), do_stack_segment(), new_frame(), and sys_call().

25 {
26  cli(); //disable interrupts
27  char logmsg[64] = {'\0'}, prefix[] = "Panic: ";
28  strcat(logmsg, prefix);
29  strcat(logmsg, msg);
30  klogv(logmsg);
31  hlt(); //halt
32 }
#define hlt()
Definition: system.h:17
void klogv(const char *msg)
Definition: system.c:11
#define cli()
Definition: system.h:15
char * strcat(char *s1, const char *s2)
strcat concatenates the contents of one string onto another.
Definition: string.c:101

Variable Documentation

u32int cs

Definition at line 59 of file system.h.

u32int ds

Definition at line 57 of file system.h.

u32int eax

Definition at line 58 of file system.h.

u32int ebp

Definition at line 58 of file system.h.

u32int ebx

Definition at line 58 of file system.h.

u32int ecx

Definition at line 58 of file system.h.

u32int edi

Definition at line 58 of file system.h.

u32int edx

Definition at line 58 of file system.h.

u32int eflags

Definition at line 59 of file system.h.

u32int eip

Definition at line 59 of file system.h.

u32int es

Definition at line 57 of file system.h.

u32int esi

Definition at line 58 of file system.h.

u32int esp

Definition at line 58 of file system.h.

u32int fs

Definition at line 57 of file system.h.

u32int gs

Definition at line 57 of file system.h.