-
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.
Update basic skeleton of mipsivm.
- Loading branch information
Showing
8 changed files
with
548 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
*.ko | ||
*.obj | ||
*.elf | ||
*.cod | ||
|
||
# Linker output | ||
*.ilk | ||
|
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,22 @@ | ||
@echo off | ||
set ddkpath=C:\WinDDK\7600.16385.1\bin\x86 | ||
set incpath=C:\WinDDK\7600.16385.1\inc | ||
set libpath=C:\WinDDK\7600.16385.1\lib | ||
set binpath=.\bin\compchk_win7x64 | ||
set objpath=.\bin\compchk_win7x64\Intermediate | ||
|
||
title Compiling mipsivm, Checked Build, 64-Bit Windows (AMD64 Architecture) | ||
echo Project: mipsivm | ||
echo Platform: 64-Bit Windows | ||
echo Preset: Debug/Checked Build | ||
pause | ||
|
||
echo ============Start Compiling============ | ||
%ddkpath%\amd64\cl.exe .\src\entry.c /I"%incpath%\api" /I"%incpath%\crt" /I".\src\include" /Zi /nologo /W3 /WX /Od /D"_msvc" /D"_amd64" /Zc:wchar_t /Zc:forScope /FAcs /Fa"%objpath%\entry.cod" /Fo"%objpath%\entry.obj" /Fd"%objpath%\vc90.pdb" /GS- /Gd /TC /c /errorReport:queue | ||
|
||
%ddkpath%\amd64\cl.exe .\src\vcpu.c /I".\src\include" /Zi /nologo /W3 /WX /Oi /Od /D"_msvc" /D"_amd64" /Zc:wchar_t /Zc:forScope /FAcs /Fa"%objpath%\vcpu.cod" /Fo"%objpath%\vcpu.obj" /Fd"%objpath%\vc90.pdb" /GS- /Gd /TC /c /errorReport:queue | ||
|
||
echo ============Start Linking============ | ||
%ddkpath%\amd64\link.exe "%objpath%\vcpu.obj" "%objpath%\entry.obj" /LIBPATH:"%libpath%\win7\amd64" /LIBPATH:"%libpath%\Crt\amd64" /NODEFAULTLIB "msvcrt.lib" /NOLOGO /DEBUG /PDB:"%objpath%\mipsivm.pdb" /INCREMENTAL:NO /OUT:"%binpath%\mipsivm.exe" /SUBSYSTEM:CONSOLE /ENTRY:"main" /Machine:X64 /ERRORREPORT:QUEUE | ||
|
||
pause |
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,22 @@ | ||
/* | ||
mipsivm - MIPS Interpreting Virtual Machine | ||
Copyright 2018-2019, Yaotian "Zero" Tang. All rights reserved. | ||
This file is the entry module of mipsivm program. | ||
This program is distributed in the hope that it will be useful, but | ||
without any warranty (no matter implied warranty or merchantability | ||
or fitness for a particular purpose, etc.). | ||
File Location: /include/entry.c | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
void main() | ||
{ | ||
printf("Welcome to mipsivm!\n"); | ||
} |
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,79 @@ | ||
/* | ||
mipsivm - MIPS Interpreting Virtual Machine | ||
Copyright 2018-2019, Yaotian "Zero" Tang. All rights reserved. | ||
This file defines basic types, constants, etc. | ||
This program is distributed in the hope that it will be useful, but | ||
without any warranty (no matter implied warranty or merchantability | ||
or fitness for a particular purpose, etc.). | ||
File Location: /include/midef.h | ||
*/ | ||
|
||
#if defined(_msvc) | ||
#pragma once | ||
|
||
typedef unsigned __int8 u8; | ||
typedef unsigned __int16 u16; | ||
typedef unsigned __int32 u32; | ||
typedef unsigned __int64 u64; | ||
|
||
typedef signed __int8 i8; | ||
typedef signed __int16 i16; | ||
typedef signed __int32 i32; | ||
typedef signed __int64 i64; | ||
#endif | ||
|
||
#if defined(_amd64) | ||
typedef u64 ulong_ptr; | ||
typedef i64 long_ptr; | ||
#else | ||
typedef u32 ulong_ptr; | ||
typedef i32 long_ptr; | ||
#endif | ||
|
||
typedef union _large_integer | ||
{ | ||
struct | ||
{ | ||
u32 lo; | ||
u32 hi; | ||
}; | ||
u64 value; | ||
}large_integer,*large_integer_p; | ||
|
||
typedef volatile u8 u8v; | ||
typedef volatile u16 u16v; | ||
typedef volatile u32 u32v; | ||
typedef volatile u64 u64v; | ||
|
||
typedef volatile i8 i8v; | ||
typedef volatile i16 i16v; | ||
typedef volatile i32 i32v; | ||
typedef volatile i64 i64v; | ||
|
||
typedef volatile ulong_ptr vulong_ptr; | ||
typedef volatile long_ptr vlong_ptr; | ||
|
||
#if defined(_msvc) | ||
typedef enum | ||
{ | ||
false=0, | ||
true=1 | ||
}bool; | ||
|
||
#define cdecl __cdecl | ||
#define stdcall __stdcall | ||
#define fastcall __fastcall | ||
|
||
#define inline __inline | ||
#define always_inline __forceinline | ||
#endif | ||
|
||
#define null (void*)0 | ||
#define maxu8 0xff | ||
#define maxu16 0xffff | ||
#define maxu32 0xffffffff | ||
#define maxu64 0xffffffffffffffff |
Oops, something went wrong.