Skip to content

Commit ce0c3a1

Browse files
authored
Miscelleaneous bug fixes & improvements (#1264)
* Fix usage of deprecated "cpuid" Bochs option Signed-off-by: AnErrupTion <[email protected]> * Parse static options first in kernel Signed-off-by: AnErrupTion <[email protected]> * Add extern method module not found error Signed-off-by: AnErrupTion <[email protected]> * Reset instruction stage after refresh in Explorer Signed-off-by: AnErrupTion <[email protected]> * Make large text boxes' font monospace in Explorer Signed-off-by: AnErrupTion <[email protected]> * Add Mosa.UnitTests.TinyCoreLib in UnitTests folder Signed-off-by: AnErrupTion <[email protected]> * Fix SCCP constant value for null objects Signed-off-by: AnErrupTion <[email protected]> --------- Signed-off-by: AnErrupTion <[email protected]>
1 parent cfb39d9 commit ce0c3a1

File tree

8 files changed

+21
-17
lines changed

8 files changed

+21
-17
lines changed

Source/Mosa.Compiler.Framework/MethodCompiler.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -587,11 +587,7 @@ private void ExternalMethod()
587587

588588
if (filename != null)
589589
{
590-
var bytes = Compiler.SearchPathsForFileAndLoad(filename);
591-
592-
// TODO: Generate an error if the file is not found
593-
// CompilerException.FileNotFound
594-
590+
var bytes = Compiler.SearchPathsForFileAndLoad(filename) ?? throw new CompilerException($"Could not find extern method module: {filename}");
595591
Symbol.SetData(bytes);
596592
}
597593

Source/Mosa.Compiler.Framework/Stages/SparseConditionalConstantPropagationStage.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,13 @@ protected void ReplaceVirtualRegisterWithConstant(Operand target, ulong value)
9292
{
9393
Debug.Assert(!target.IsFloatingPoint);
9494

95-
var constant = target.IsInt32
96-
? Operand.CreateConstant32((uint)value)
97-
: Operand.CreateConstant64(value);
95+
Operand constant;
96+
if (target.IsInt32)
97+
constant = Operand.CreateConstant32((uint)value);
98+
else if (target.IsInt64)
99+
constant = Operand.CreateConstant64(value);
100+
else
101+
constant = Operand.NullObject;
98102

99103
// for each statement T that uses operand, substituted c in statement T
100104
foreach (var node in target.Uses.ToArray())

Source/Mosa.Kernel.BareMetal/BootOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ public static void Setup()
2828

2929
public static string GetValue(string key)
3030
{
31-
var result = GetValue(RuntimeOptions, key);
31+
var result = GetValue(StaticOptions, key);
3232

3333
if (string.IsNullOrEmpty(result))
3434
{
35-
result = GetValue(StaticOptions, key);
35+
result = GetValue(RuntimeOptions, key);
3636
}
3737

3838
return result;
3939
}
4040

4141
public static bool Contains(string value)
4242
{
43-
if (Contains(RuntimeOptions, value))
43+
if (Contains(StaticOptions, value))
4444
return true;
4545

46-
return Contains(StaticOptions, value);
46+
return Contains(RuntimeOptions, value);
4747
}
4848

4949
private static string GetValue(Pointer options, string key)

Source/Mosa.Linux.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,7 @@ Global
14381438
{FBC3B0CD-D775-41C6-A735-F59118838397} = {D032B24A-CE3A-4881-BACE-CC4FE0AFD69D}
14391439
{3347E41D-AD8B-4891-9A9B-5EE36BACA6F1} = {90065B0F-1BFE-40D8-AED5-11096B2535B0}
14401440
{844037C4-B018-4AD0-8237-BAE46E024994} = {079CE6E3-8038-44F5-B18A-2D586A827D95}
1441+
{F74513A5-E5B4-4ABC-9E8B-999EC55FCFC6} = {88D3D1D0-85D2-4301-A9EA-3F964CB05415}
14411442
EndGlobalSection
14421443
GlobalSection(ExtensibilityGlobals) = postSolution
14431444
SolutionGuid = {C22A5C94-6B05-4B1B-845A-A2EA7615E093}

Source/Mosa.Tool.Explorer.Avalonia/MainWindow.axaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
<Button Name="SaveB" Click="SaveB_OnClick">Save B</Button>
9191
</StackPanel>
9292

93-
<TextBox Grid.Row="1" Name="Instructions" IsReadOnly="True"/>
93+
<TextBox Grid.Row="1" Name="Instructions" FontFamily="Monospace" IsReadOnly="True"/>
9494
</Grid>
9595
</TabItem>
9696

@@ -106,7 +106,7 @@
106106
</StackPanel>
107107

108108
<Grid Grid.Row="1" ColumnDefinitions="*, 5, *">
109-
<TextBox Grid.Column="0" Name="Debug" IsReadOnly="True"/>
109+
<TextBox Grid.Column="0" Name="Debug" FontFamily="Monospace" IsReadOnly="True"/>
110110
<GridSplitter Grid.Column="1"/>
111111
<Panel Grid.Column="2" Name="DebugPanel"/>
112112
</Grid>
@@ -142,7 +142,7 @@
142142
<Label Name="Total">##</Label>
143143
</StackPanel>
144144

145-
<TextBox Grid.Row="1" Name="Transforms" IsReadOnly="True"/>
145+
<TextBox Grid.Row="1" Name="Transforms" FontFamily="Monospace" IsReadOnly="True"/>
146146
</Grid>
147147

148148
<GridSplitter Grid.Column="1"/>
@@ -181,7 +181,7 @@
181181
</Grid>
182182
</StackPanel>
183183

184-
<TextBox Grid.Row="1" Name="CompilerLogs" IsReadOnly="True"/>
184+
<TextBox Grid.Row="1" Name="CompilerLogs" FontFamily="Monospace" IsReadOnly="True"/>
185185
</Grid>
186186
</TabItem>
187187

Source/Mosa.Tool.Explorer.Avalonia/MainWindow.axaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,8 @@ private bool ShowGraphviz()
659659

660660
private void OpenFile()
661661
{
662+
InstructionsStage.SelectedIndex = -1;
663+
662664
UpdateSettings();
663665
UpdateSettings(lastOpenedFile);
664666
LoadAssembly();

Source/Mosa.Utility.Launcher/Starter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ private Process LaunchBochs()
384384
sb.AppendLine(MosaSettings.EmulatorMemory.ToString());
385385

386386
sb.AppendLine("ata0: enabled=1,ioaddr1=0x1f0,ioaddr2=0x3f0,irq=14");
387-
sb.AppendLine("cpuid: mmx=1,sep=1,simd=sse4_2,apic=xapic,aes=1,movbe=1,xsave=1");
387+
sb.AppendLine("cpu: model=core2_penryn_t9600, count=1");
388388
sb.AppendLine("boot: cdrom,disk");
389389

390390
sb.Append("log: \"");

Source/Mosa.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,7 @@ Global
14941494
{763FDCF2-2501-4756-A7A1-62813D610B00} = {D032B24A-CE3A-4881-BACE-CC4FE0AFD69D}
14951495
{B940F546-628B-45C0-9FA5-4479F166033F} = {90065B0F-1BFE-40D8-AED5-11096B2535B0}
14961496
{0E0E772E-5824-4ABA-8524-AA0B00BBD9BB} = {079CE6E3-8038-44F5-B18A-2D586A827D95}
1497+
{5B6E6C85-E89B-4384-96F2-69B1F3524EA5} = {88D3D1D0-85D2-4301-A9EA-3F964CB05415}
14971498
EndGlobalSection
14981499
GlobalSection(ExtensibilityGlobals) = postSolution
14991500
SolutionGuid = {C22A5C94-6B05-4B1B-845A-A2EA7615E093}

0 commit comments

Comments
 (0)