proc.h

00001 /***************************************************************************
00002                           proc.h  -  description
00003                              -------------------
00004     begin                : Wed Dec 24 2003
00005     copyright            : (C) 2003 by Dynacube Team
00006     email                : 
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018  #ifndef __PROC_H
00019  #define __PROC_H
00020 
00021  #include "common/ktypes.h"
00022  #include "common/kconst.h"
00023  
00024  //Process Init - Lazy initialize
00025  
00026  typedef struct
00027  {
00028    boolean avl;
00029    DW ppid;
00030 
00031          DW pre_task_link;
00032 
00033    DD esp0;
00034          DW ss0;
00035 
00036          DD esp1;
00037          DW ss1;
00038 
00039          DD esp2;
00040          DW ss2;
00041 
00042          DD cr3;
00043          DD eip;
00044          DD eflags;
00045          DD eax;
00046          DD ecx;
00047          DD edx;
00048          DD ebx;
00049          DD esp;
00050          DD ebp;
00051          DD esi;
00052          DD edi;
00053    DW es;
00054 
00055    DW cs;
00056 
00057    DW ss;
00058 
00059    DW ds;
00060 
00061          DW fs;
00062 
00063          DW gs;
00064 
00065    DW ldt_sel;
00066 
00067    DW flags; //T
00068    DW io_map;
00069 
00070    DW msg_q_delim; //Size of q = 2^16
00071 
00072    DD recv_addr;    // to store the address from the recv call when blocked
00073    DD wait_int_num; //The interrupt that the process wants to receive
00074    DD time_out;     //The timeout registered with the TIMER
00075 
00076  } PROC; //Create array of PROC 
00077 
00078  extern LDT _ldt[MAX_PROC];
00079  extern SEG_DESC _ldte[MAX_PROC][3] __attribute__((aligned (8)));
00080  
00081  extern PROC _proc[MAX_PROC];
00082 
00083  void proc_init(); 
00084  SDB fork(); //Negative returns allowed
00085  void do_exit(DW pid);
00086  void forkNULL();
00087  SDB create(char *fname);
00088  
00089  SDW load(char *fname,DW pid);
00090  
00091  //Sample Processes
00092  void reti();
00093  void null_proc();
00094  void rogue();
00095 
00096  #endif
00097  

Generated on Thu Jul 27 23:52:27 2006 for Dynacube by  doxygen 1.4.7