-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcinit.c
80 lines (66 loc) · 1.72 KB
/
cinit.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/***************************************************************************
*
* Copyright (c) 1997, 1998 Timpanogas Research Group, Inc. All Rights
* Reserved.
*
* AUTHOR : Jeff V. Merkey
* FILE : CINIT.C
* DESCRIP : Initialization Code for MANOS v1.0
* DATE : November 2, 1997
*
*
***************************************************************************/
#include "stdarg.h"
#include "stdio.h"
#include "stdlib.h"
#include "ctype.h"
#include "string.h"
#include "kernel.h"
#include "keyboard.h"
#include "screen.h"
#include "types.h"
#include "emit.h"
#include "dos.h"
#include "tss.h"
#include "os.h"
#include "mps.h"
#include "hal.h"
#include "peexe.h"
#include "window.h"
#include "timer.h"
#include "line.h"
#include "dosfile.h"
#include "loader.h"
#include "event.h"
#include "bus.h"
#include "start.h"
LONG MajorVersion = MAJOR_VERSION;
LONG MinorVersion = MINOR_VERSION;
LONG BuildVersion = BUILD_VERSION;
void ExitOS(void)
{
register LONG *pD;
extern void ExitToDOS(void);
extern LONG oldZero;
EventNotify(EVENT_EXIT_OS, 0);
pD = (LONG *) 0;
*pD = oldZero;
ExitToDOS(); // call does not return
return;
}
void MANOSMain(DOS_TABLE *dos, PM_TABLE *pm)
{
extern void UpdateStartupRegistry(void);
extern void EnterSMPKernel(void);
extern LONG oldZero;
register LONG retCode, *pD;
pD = (LONG *) 0;
oldZero = *pD;
*pD = 0xF4CCCCCC; // three breakpoints and a halt (and a partridge in a pear tree)
// create startup registry
UpdateStartupRegistry();
// startup operating system
SystemStartupRoutine(dos, pm);
EnterSMPKernel();
return;
}