NOVA
Stripped down NOVA kernel for the OSY course
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Ec Class Reference

Public Member Functions

ALWAYS_INLINE NORETURN void make_current ()
 

Static Public Member Functions

HOT static NORETURN void ret_user_sysexit ()
 
static NORETURN void ret_user_iret () asm("ret_user_iret")
 
static NORETURN void idle ()
 
static void root_setup (mword)
 
HOT NORETURN static REGPARM_1 void syscall_handler (uint8 a) asm("syscall_handler")
 System call handler. More...
 
static ALWAYS_INLINE void * operator new (size_t)
 
static ALWAYS_INLINE void operator delete (void *)
 

Public Attributes

Ecnext
 

Static Public Attributes

static Eccurrent
 

Member Function Documentation

◆ syscall_handler()

void Ec::syscall_handler ( uint8  a)
static

System call handler.

Parameters
[in]aValue of the al register before the system call
17 {
18  // Get access to registers stored during entering the system - see
19  // entry_sysenter in entry.S
20  Sys_regs * r = current->sys_regs();
21  Syscall_numbers number = static_cast<Syscall_numbers> (a);
22 
23  switch (number) {
24  case sys_print: {
25  // Tisk řetězce na sériovou linku
26  char *data = reinterpret_cast<char*>(r->esi);
27  unsigned len = r->edi;
28  for (unsigned i = 0; i < len; i++)
29  printf("%c", data[i]);
30  break;
31  }
32  case sys_sum: {
33  // Naprosto nepotřebné systémové volání na sečtení dvou čísel
34  int first_number = r->esi;
35  int second_number = r->edi;
36  r->eax = first_number + second_number;
37  break;
38  }
39  // TODO: Add your system calls here
40  default:
41  printf ("unknown syscall %d\n", number);
42  break;
43  };
44 
45  ret_user_sysexit();
46 }
Definition: regs.h:26

The documentation for this class was generated from the following files: