git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0ebba25
)
Kernel/x86 - Fixed usage of Proc_Clone
author
John Hodge
<
[email protected]
>
Tue, 23 Aug 2011 10:27:48 +0000
(18:27 +0800)
committer
John Hodge
<
[email protected]
>
Tue, 23 Aug 2011 10:27:48 +0000
(18:27 +0800)
Kernel/arch/x86/include/arch.h
patch
|
blob
|
history
Kernel/arch/x86/main.c
patch
|
blob
|
history
Kernel/arch/x86/mm_phys.c
patch
|
blob
|
history
Kernel/arch/x86/proc.asm
patch
|
blob
|
history
Kernel/arch/x86/vm8086.c
patch
|
blob
|
history
diff --git
a/Kernel/arch/x86/include/arch.h
b/Kernel/arch/x86/include/arch.h
index
d82fc2c
..
755ecdf
100644
(file)
--- a/
Kernel/arch/x86/include/arch.h
+++ b/
Kernel/arch/x86/include/arch.h
@@
-9,6
+9,7
@@
// - Base Defintions
#define KERNEL_BASE 0xC0000000
#define BITS 32
// - Base Defintions
#define KERNEL_BASE 0xC0000000
#define BITS 32
+#define PAGE_SIZE 0x1000
#define INVLPTR ((void*)-1)
#define INVLPTR ((void*)-1)
diff --git
a/Kernel/arch/x86/main.c
b/Kernel/arch/x86/main.c
index
b0fe6e0
..
a65c230
100644
(file)
--- a/
Kernel/arch/x86/main.c
+++ b/
Kernel/arch/x86/main.c
@@
-19,10
+19,9
@@
extern void Heap_Install(void);
extern void Desctab_Install(void);
extern void MM_PreinitVirtual(void);
extern void MM_Install(tMBoot_Info *MBoot);
extern void Desctab_Install(void);
extern void MM_PreinitVirtual(void);
extern void MM_Install(tMBoot_Info *MBoot);
-extern void MM_InstallVirtual(void);
+extern void
MM_InstallVirtual(void);
extern void Threads_Init(void);
extern int Time_Setup(void);
extern void Threads_Init(void);
extern int Time_Setup(void);
-extern Uint Proc_Clone(Uint *Err, Uint Flags);
// --- Core ---
extern void System_Init(char *Commandline);
// --- Core ---
extern void System_Init(char *Commandline);
diff --git
a/Kernel/arch/x86/mm_phys.c
b/Kernel/arch/x86/mm_phys.c
index
64b56fb
..
78755d9
100644
(file)
--- a/
Kernel/arch/x86/mm_phys.c
+++ b/
Kernel/arch/x86/mm_phys.c
@@
-413,7
+413,7
@@
void MM_RefPhys(tPAddr PAddr)
{
if( MM_GetPhysAddr( (tVAddr)&gaPageReferences[PAddr] ) == 0 ) {
tVAddr addr = ((tVAddr)&gaPageReferences[PAddr]) & ~0xFFF;
{
if( MM_GetPhysAddr( (tVAddr)&gaPageReferences[PAddr] ) == 0 ) {
tVAddr addr = ((tVAddr)&gaPageReferences[PAddr]) & ~0xFFF;
- Log_Debug("PMem", "MM_RefPhys:
Info not allocated %llx
", PAddr);
+ Log_Debug("PMem", "MM_RefPhys:
Allocating info for %X
", PAddr);
Mutex_Release( &glPhysAlloc );
if( MM_Allocate( addr ) == 0 ) {
Log_KernelPanic("PMem", "MM_RefPhys: Out of physical memory");
Mutex_Release( &glPhysAlloc );
if( MM_Allocate( addr ) == 0 ) {
Log_KernelPanic("PMem", "MM_RefPhys: Out of physical memory");
diff --git
a/Kernel/arch/x86/proc.asm
b/Kernel/arch/x86/proc.asm
index
f53f11d
..
1011b53
100644
(file)
--- a/
Kernel/arch/x86/proc.asm
+++ b/
Kernel/arch/x86/proc.asm
@@
-135,7
+135,7
@@
scheduler_return: ; Used by some hackery in Proc_DumpThreadCPUState
SpawnTask:
; Call Proc_Clone with Flags=0
xor eax, eax
SpawnTask:
; Call Proc_Clone with Flags=0
xor eax, eax
-
push eax
+
;
push eax
push eax
call Proc_Clone
add esp, 8 ; Remove arguments from stack
push eax
call Proc_Clone
add esp, 8 ; Remove arguments from stack
diff --git
a/Kernel/arch/x86/vm8086.c
b/Kernel/arch/x86/vm8086.c
index
6d60d9b
..
3c1bfed
100644
(file)
--- a/
Kernel/arch/x86/vm8086.c
+++ b/
Kernel/arch/x86/vm8086.c
@@
-6,6
+6,7
@@
#include <acess.h>
#include <vm8086.h>
#include <modules.h>
#include <acess.h>
#include <vm8086.h>
#include <modules.h>
+#include <hal_proc.h>
// === CONSTANTS ===
#define VM8086_MAGIC_CS 0xFFFF
// === CONSTANTS ===
#define VM8086_MAGIC_CS 0xFFFF
@@
-28,9
+29,6
@@
enum eVM8086_Opcodes
#define VM8086_BLOCKSIZE 128
#define VM8086_BLOCKCOUNT ((0x9F000-0x10000)/VM8086_BLOCKSIZE)
#define VM8086_BLOCKSIZE 128
#define VM8086_BLOCKCOUNT ((0x9F000-0x10000)/VM8086_BLOCKSIZE)
-// === IMPORTS ===
- int Proc_Clone(Uint *Err, Uint Flags);
-
// === TYPES ===
struct sVM8086_InternalData
{
// === TYPES ===
struct sVM8086_InternalData
{
@@
-63,7
+61,7
@@
int VM8086_Install(char **Arguments)
Mutex_Acquire( &glVM8086_Process );
// Create BIOS Call process
Mutex_Acquire( &glVM8086_Process );
// Create BIOS Call process
- pid = Proc_Clone(
NULL,
CLONE_VM);
+ pid = Proc_Clone(CLONE_VM);
if(pid == -1)
{
Log_Error("VM8086", "Unable to clone kernel into VM8086 worker");
if(pid == -1)
{
Log_Error("VM8086", "Unable to clone kernel into VM8086 worker");
@@
-74,15
+72,18
@@
int VM8086_Install(char **Arguments)
Uint * volatile stacksetup; // Initialising Stack
Uint16 * volatile rmstack; // Real Mode Stack
int i;
Uint * volatile stacksetup; // Initialising Stack
Uint16 * volatile rmstack; // Real Mode Stack
int i;
-
+
// Set Image Name
Threads_SetName("VM8086");
// Set Image Name
Threads_SetName("VM8086");
-
+
+ Log_Debug("VM8086", "Mapping memory");
+
// Map ROM Area
for(i=0xA0;i<0x100;i++) {
MM_Map( i * 0x1000, i * 0x1000 );
// Map ROM Area
for(i=0xA0;i<0x100;i++) {
MM_Map( i * 0x1000, i * 0x1000 );
-
//MM_SetFlags( i * 0x1000, MM_PFLAG_RO, MM_PFLAG_RO );
// Set Read Only
+
// MM_SetFlags( i * 0x1000, MM_PFLAG_RO, MM_PFLAG_RO );
// Set Read Only
}
}
+ Log_Debug("VM8086", "ROM area mapped");
MM_Map( 0, 0 ); // IVT / BDA
// Map (but allow allocation) of 0x1000 - 0x9F000
// - So much hack, it isn't funny
MM_Map( 0, 0 ); // IVT / BDA
// Map (but allow allocation) of 0x1000 - 0x9F000
// - So much hack, it isn't funny
@@
-99,6
+100,7
@@
int VM8086_Install(char **Arguments)
gVM8086_WorkerPID = 0;
Threads_Exit(0, 1);
}
gVM8086_WorkerPID = 0;
Threads_Exit(0, 1);
}
+ Log_Debug("VM8086", "Mapped low memory");
*(Uint8*)(0x100000) = VM8086_OP_IRET;
*(Uint8*)(0x100001) = 0x07; // POP ES
*(Uint8*)(0x100000) = VM8086_OP_IRET;
*(Uint8*)(0x100001) = 0x07; // POP ES
UCC
git Repository :: git.ucc.asn.au