-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
1,092 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-us"> | ||
<head> | ||
<title>https://lynxline.com/posts/lab-15-eve-hello-world-from-limbo/</title> | ||
<link rel="canonical" href="https://lynxline.com/posts/lab-15-eve-hello-world-from-limbo/"> | ||
<meta name="robots" content="noindex"> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="refresh" content="0; url=https://lynxline.com/posts/lab-15-eve-hello-world-from-limbo/"> | ||
</head> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "u.h" | ||
#include "../port/lib.h" | ||
#include "mem.h" | ||
#include "dat.h" | ||
#include "fns.h" | ||
|
||
static void | ||
linkproc(void) | ||
{ | ||
spllo(); | ||
if (waserror()) | ||
print("error() underflow: %r\n"); | ||
else (*up->kpfun)(up->arg); | ||
pexit("end proc", 1); | ||
} | ||
|
||
void | ||
kprocchild(Proc *p, void (*func)(void*), void *arg) | ||
{ | ||
p->sched.pc = (ulong)linkproc; | ||
p->sched.sp = (ulong)p->kstack+KSTACK-8; | ||
p->kpfun = func; | ||
p->arg = arg; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
|
||
#define HZ (100) /*! clock frequency */ | ||
#define MS2HZ (1000/HZ) /*! millisec per clock tick */ | ||
#define TK2SEC(t) ((t)/HZ) /*! ticks to seconds */ | ||
#define MS2TK(t) ((t)/MS2HZ) /*! milliseconds to ticks */ | ||
|
||
#define MACHP(n) (n == 0 ? (Mach*)(MACHADDR) : (Mach*)0) | ||
|
||
typedef struct Lock Lock; | ||
typedef struct Ureg Ureg; | ||
typedef struct Label Label; | ||
typedef struct FPenv FPenv; | ||
typedef struct Mach Mach; | ||
typedef struct FPU FPU; | ||
typedef ulong Instr; | ||
typedef struct Conf Conf; | ||
|
||
struct Lock | ||
{ | ||
ulong key; | ||
ulong sr; | ||
ulong pc; | ||
int pri; | ||
}; | ||
|
||
struct Label | ||
{ | ||
ulong sp; | ||
ulong pc; | ||
}; | ||
|
||
enum | ||
{ | ||
FPINIT, | ||
FPACTIVE, | ||
FPINACTIVE | ||
}; | ||
|
||
struct FPenv | ||
{ | ||
ulong status; | ||
ulong control; | ||
ushort fpistate; /* emulated fp */ | ||
ulong regs[8][3]; /* emulated fp */ | ||
}; | ||
|
||
struct FPU | ||
{ | ||
FPenv env; | ||
}; | ||
|
||
struct Conf | ||
{ | ||
ulong nmach; /* processors */ | ||
ulong nproc; /* processes */ | ||
ulong npage; /* total physical pages of memory */ | ||
ulong npage0; /* total physical pages of memory */ | ||
ulong npage1; /* total physical pages of memory */ | ||
ulong base0; /* base of bank 0 */ | ||
ulong base1; /* base of bank 1 */ | ||
ulong ialloc; /* max interrupt time allocation in bytes */ | ||
ulong topofmem; /* top addr of memory */ | ||
}; | ||
|
||
#include "../port/portdat.h" | ||
|
||
struct Mach | ||
{ | ||
ulong splpc; /* pc of last caller to splhi */ | ||
int machno; /* physical id of processor */ | ||
ulong ticks; /* of the clock since boot time */ | ||
Proc* proc; /* current process on this processor */ | ||
Label sched; /* scheduler wakeup */ | ||
ulong cpuhz; | ||
|
||
/* stacks for exceptions */ | ||
ulong fiqstack[4]; | ||
ulong irqstack[4]; | ||
ulong abtstack[4]; | ||
ulong undstack[4]; | ||
int stack[1]; | ||
}; | ||
|
||
extern Mach *m; | ||
extern Proc *up; |
Oops, something went wrong.