Skip to content

Commit

Permalink
Better Page32, Added Bochs No Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Chourdakis committed Dec 25, 2018
1 parent 2342449 commit c1396ab
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 19 deletions.
3 changes: 3 additions & 0 deletions asm.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Bochs|DOS = Bochs|DOS
BochsNoDebug|DOS = BochsNoDebug|DOS
VMWare|DOS = VMWare|DOS
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{68FEA001-C33A-4EBC-A70F-9788736975B5}.Bochs|DOS.ActiveCfg = DOS|x64
{68FEA001-C33A-4EBC-A70F-9788736975B5}.Bochs|DOS.Build.0 = DOS|x64
{68FEA001-C33A-4EBC-A70F-9788736975B5}.BochsNoDebug|DOS.ActiveCfg = BochsNoDebug|x64
{68FEA001-C33A-4EBC-A70F-9788736975B5}.BochsNoDebug|DOS.Build.0 = BochsNoDebug|x64
{68FEA001-C33A-4EBC-A70F-9788736975B5}.VMWare|DOS.ActiveCfg = VMWare|x64
{68FEA001-C33A-4EBC-A70F-9788736975B5}.VMWare|DOS.Build.0 = VMWare|x64
EndGlobalSection
Expand Down
34 changes: 34 additions & 0 deletions asm.vcxproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="BochsNoDebug|x64">
<Configuration>BochsNoDebug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DOS|x64">
<Configuration>DOS</Configuration>
<Platform>x64</Platform>
Expand All @@ -24,6 +28,13 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='BochsNoDebug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='VMWare|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
Expand All @@ -39,6 +50,9 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='DOS|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='BochsNoDebug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='VMWare|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
Expand All @@ -58,6 +72,20 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='BochsNoDebug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='VMWare|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Expand All @@ -76,14 +104,19 @@
<CustomBuild Include="entry.asm">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='DOS|x64'">build.bat</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='BochsNoDebug|x64'">build.bat</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='VMWare|x64'">build.bat</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='DOS|x64'">entry.exe</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='BochsNoDebug|x64'">entry.exe</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='VMWare|x64'">entry.exe</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='DOS|x64'">false</LinkObjects>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='BochsNoDebug|x64'">false</LinkObjects>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='VMWare|x64'">false</LinkObjects>
<TreatOutputAsContent Condition="'$(Configuration)|$(Platform)'=='DOS|x64'">true</TreatOutputAsContent>
<TreatOutputAsContent Condition="'$(Configuration)|$(Platform)'=='BochsNoDebug|x64'">true</TreatOutputAsContent>
<TreatOutputAsContent Condition="'$(Configuration)|$(Platform)'=='VMWare|x64'">true</TreatOutputAsContent>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='DOS|x64'">*.asm</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='BochsNoDebug|x64'">*.asm</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='VMWare|x64'">*.asm</AdditionalInputs>
</CustomBuild>
</ItemGroup>
Expand All @@ -92,6 +125,7 @@
<FileType>Document</FileType>
</None>
<None Include="bochsrc.bxrc" />
<None Include="bochsrc_nd.bxrc" />
<None Include="build.bat" />
<None Include="code16.asm" />
<None Include="code32.asm" />
Expand Down
3 changes: 3 additions & 0 deletions asm.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,8 @@
<None Include="page32.asm">
<Filter>32 bit code</Filter>
</None>
<None Include="bochsrc_nd.bxrc">
<Filter>Configuration</Filter>
</None>
</ItemGroup>
</Project>
57 changes: 57 additions & 0 deletions bochsrc_nd.bxrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# configuration file generated by Bochs
plugin_ctrl: unmapped=1, biosdev=1, speaker=1, extfpuirq=1, parallel=1, serial=1, gameport=1
config_interface: win32config
display_library: win32
memory: host=32, guest=32
romimage: file="g:\bochs2/BIOS-bochs-latest", address=0x0, options=none
vgaromimage: file="g:\bochs2/VGABIOS-lgpl-latest"
boot: floppy
floppy_bootsig_check: disabled=0
floppya: type=1_44, 1_44="F:\TOOLS\ASM\full2\a.img", status=inserted, write_protected=0
# no floppyb
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=none
ata0-slave: type=cdrom, path="F:\TOOLS\ASM\full2\d.iso", status=inserted, model="Generic 1234", biosdetect=auto
ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata1-master: type=none
ata1-slave: type=none
ata2: enabled=0
ata3: enabled=0
optromimage1: file=none
optromimage2: file=none
optromimage3: file=none
optromimage4: file=none
optramimage1: file=none
optramimage2: file=none
optramimage3: file=none
optramimage4: file=none
pci: enabled=1, chipset=i440fx
vga: extension=vbe, update_freq=5, realtime=1
cpu: count=1, ips=4000000, model=bx_generic, reset_on_triple_fault=1, cpuid_limit_winnt=0, ignore_bad_msrs=1, mwait_is_nop=0
cpuid: level=6, stepping=3, model=3, family=6, vendor_string="GenuineIntel", brand_string=" Intel(R) Pentium(R) 4 CPU "
cpuid: mmx=1, apic=x2apic, simd=ssse3, sse4a=0, misaligned_sse=0, sep=1, movbe=0, adx=0
cpuid: aes=1, sha=0, xsave=0, xsaveopt=0, x86_64=1, 1g_pages=1, pcid=0, fsgsbase=0
cpuid: smep=0, smap=0, mwait=1, vmx=1
print_timestamps: enabled=0
port_e9_hack: enabled=0
private_colormap: enabled=0
clock: sync=none, time0=local, rtc_sync=0
# no cmosimage
# no loader
log: -
logprefix: %t%e%d
debug: action=ignore
info: action=report
error: action=report
panic: action=ask
keyboard: type=mf, serial_delay=250, paste_delay=100000, user_shortcut=none
mouse: type=ps2, enabled=0, toggle=ctrl+mbutton
sound: waveoutdrv=win, waveout=none, waveindrv=win, wavein=none, midioutdrv=win, midiout=none
speaker: enabled=1, mode=sound
parport1: enabled=1, file=none
parport2: enabled=0
com1: enabled=1, mode=null
com2: enabled=0
com3: enabled=0
com4: enabled=0
magic_break: enabled=1
8 changes: 4 additions & 4 deletions bx_enh_dbg.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ isLittleEndian = TRUE
DefaultAsmLines = 512
DumpWSIndex = 0
DockOrder = 0x123
ListWidthPix[0] = 267
ListWidthPix[1] = 349
ListWidthPix[2] = 393
ListWidthPix[0] = 289
ListWidthPix[1] = 338
ListWidthPix[2] = 382
FontName = System
FontSize = -16
MainWindow = 104, 104, 1129, 637
MainWindow = 52, 52, 1077, 585
10 changes: 6 additions & 4 deletions code32.asm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Start32:
mov ebx,[ds:d32]

; --------------------------------------- Interrupt Test ---------------------------------------
; int 0;
int 0;

; --------------------------------------- LLDT ---------------------------------------
mov ax,ldt_idx
Expand Down Expand Up @@ -65,11 +65,12 @@ Start32:
mov eax, cr0 ; Read CR0.
and eax,7FFFFFFFh; Set PE=0
mov cr0, eax ; Write CR0.
jmp Back32
; jmp ToBack16

; --------------------------------------- Prepare Long Mode ---------------------------------------
; call InitPageTable642
; Enable PAE
call InitPageTable642
; Enable PAE
mov eax, cr4
bts eax, 5
mov cr4, eax
Expand Down Expand Up @@ -128,6 +129,7 @@ Back32:
mov cr4, eax

; --------------------------------------- Back to Real mode ---------------------------------------
ToBack16:
; = Give FS the abs32 segment
; To test unreal mode
mov ax,absd32_idx
Expand Down
2 changes: 1 addition & 1 deletion data32.asm
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ d32 dd 0
SEGMENT PAGE32 USE32
ORG 0

Page32Null dd 8192 DUP (0)
Page32Null dd 20000 DUP (0)

12 changes: 2 additions & 10 deletions page32.asm
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,10 @@ InitPageTable32a:
mov ax,page32_idx
mov ds,ax
mov es,ax

; PageDir32 Clear
mov edi,ebp
mov ecx,1024
xor eax,eax
rep stosd
; PageTables32 Clear
; Tables Clear
mov edi,ebp
add edi,4096
mov ecx,1024
mov ecx,2048
xor eax,eax
rep stosd
Expand Down

0 comments on commit c1396ab

Please sign in to comment.