1998-09-05 17:33:57 +00:00
|
|
|
/*
|
|
|
|
* Various useful prototypes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __KERNEL_H
|
|
|
|
#define __KERNEL_H
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#include <ddk/ntddk.h>
|
|
|
|
|
|
|
|
#include <internal/linkage.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Use these to place a function in a specific section of the executable
|
|
|
|
*/
|
|
|
|
#define PLACE_IN_SECTION(s) __attribute__((section (s)))
|
|
|
|
#define INIT_FUNCTION (PLACE_IN_SECTION("init"))
|
|
|
|
#define PAGE_LOCKED_FUNCTION (PLACE_IN_SECTION("pagelk"))
|
|
|
|
#define PAGE_UNLOCKED_FUNCTION (PLACE_IN_SECTION("pagepo"))
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Maximum size of the kmalloc area (this is totally arbitary)
|
|
|
|
*/
|
|
|
|
#define NONPAGED_POOL_SIZE (4*1024*1024)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Defines a descriptor as it appears in the processor tables
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned int a;
|
|
|
|
unsigned int b;
|
|
|
|
} descriptor;
|
|
|
|
|
|
|
|
extern descriptor idt[256];
|
|
|
|
extern descriptor gdt[256];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* printf style functions
|
|
|
|
*/
|
|
|
|
int vsprintf(char *buf, const char *fmt, va_list args);
|
|
|
|
int sprintf(char* buf, const char* fmt, ...);
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Magic value (useless really)
|
|
|
|
*/
|
|
|
|
unsigned int magic;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Cursor position
|
|
|
|
*/
|
|
|
|
unsigned int cursorx;
|
|
|
|
unsigned int cursory;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Number of files (including the kernel) loaded
|
|
|
|
*/
|
|
|
|
unsigned int nr_files;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Range of physical memory being used by the system
|
|
|
|
*/
|
|
|
|
unsigned int start_mem;
|
|
|
|
unsigned int end_mem;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* List of module lengths (terminated by a 0)
|
|
|
|
*/
|
|
|
|
unsigned int module_length[64];
|
|
|
|
} boot_param;
|
|
|
|
|
1999-02-01 20:58:37 +00:00
|
|
|
VOID NtInitializeEventImplementation(VOID);
|
|
|
|
VOID NtInit(VOID);
|
1998-09-05 17:33:57 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Initalization functions (called once by main())
|
|
|
|
*/
|
1999-03-31 10:59:32 +00:00
|
|
|
VOID MmInitialize(boot_param* bp, ULONG LastKernelAddress);
|
1999-02-01 20:58:37 +00:00
|
|
|
VOID IoInit(VOID);
|
|
|
|
VOID ObInit(VOID);
|
|
|
|
VOID PsInit(VOID);
|
|
|
|
VOID TstBegin(VOID);
|
1998-09-05 17:33:57 +00:00
|
|
|
VOID KeInit(VOID);
|
1999-08-14 18:59:28 +00:00
|
|
|
VOID CmInitializeRegistry(VOID);
|
1999-10-26 04:52:39 +00:00
|
|
|
VOID CmImportHive(PCHAR);
|
1999-10-16 21:08:39 +00:00
|
|
|
VOID DbgInit(VOID);
|
1998-09-05 17:33:57 +00:00
|
|
|
|
|
|
|
#endif
|