hackersmacker / es40-ng Goto Github PK
View Code? Open in Web Editor NEWNext-generation version of the AlphaServer ES40 emulator
License: GNU General Public License v2.0
Next-generation version of the AlphaServer ES40 emulator
License: GNU General Public License v2.0
In writing my one emulator, I discovered that there is are a number of bugs in the emulation of the Intel 8254 PIT Chip.
FWIW: I'm in the process of writing a new implemenration of es40 DECaxp Emulator
Here are some issues I found (if you are interested):
inst.sh
seemed to generate code that would not run (some missing qualifiers when running configure
)FLAGS
, LD
and CXX
, that should probably be specified. Here are the ones I used:$ ./configure LDFLAGS=-pthread CXXFLAGS='-Wno-unused-result -Wno-literal-suffix -Wno-format -Wno-write-strings'
$ ./configure LDFLAGS=-pthread CXXFLAGS='-Wno-unused-result -Wno-literal-suffix -Wno-format -Wno-write-strings -ggdb -Og'
diff --git a/src/DMA.cpp b/src/DMA.cpp
index d2e5a92..c263c85 100644
--- a/src/DMA.cpp
+++ b/src/DMA.cpp
@@ -185,8 +185,9 @@ u64 CDMA::ReadMem(int index, u64 address, int dsize)
#if defined(DEBUG_DMA)
printf("dma: read %s,%02x: %02x. \n", DMA_INDEX(index), address, data);
#endif
- return data;
+ ret = data;
}
+ return ret;
}
void CDMA::WriteMem(int index, u64 address, int dsize, u64 data)
diff --git a/src/base/Thread_POSIX.cpp b/src/base/Thread_POSIX.cpp
index b050e80..af692ae 100644
--- a/src/base/Thread_POSIX.cpp
+++ b/src/base/Thread_POSIX.cpp
@@ -217,7 +217,7 @@ void* CThreadImpl::entry(void* pThread)
catch (CException& exc)
{
printf("Thread has terminated with an unexpected %s exception:\n",exc.className());
- printf(" %s\n",exc.displayText());
+ printf(" %s\n",exc.displayText().c_str());
}
catch (std::exception& exc)
{
diff --git a/src/es40-cfg.cpp b/src/es40-cfg.cpp
index 8f7ca7f..a610e9b 100644
--- a/src/es40-cfg.cpp
+++ b/src/es40-cfg.cpp
@@ -119,6 +119,7 @@ void add_disks(ShrinkingChoiceQuestion * disk_q, ostream * os)
*os << " " << disk_q->getAnswer() << " = " << type_q.ask() << "\n";
*os << " {\n";
+ MultipleChoiceQuestion cdrom_q;
if (type_q.getAnswer() == "file" || type_q.getAnswer() == "device")
{
/* For a file or device, we need to know what
@@ -128,9 +129,19 @@ void add_disks(ShrinkingChoiceQuestion * disk_q, ostream * os)
img_q.setQuestion("What " + type_q.getAnswer() + " should " + disk_q->getAnswer() + " use?");
img_q.setExplanation("Enter the path to the " + type_q.getAnswer() + " to use for this disk.");
*os << " " << type_q.getAnswer() << " = \"" << img_q.ask() << "\";\n";
+
+ /* We need to know whether to emulate this as
+ * a cd-rom, or as a hard-disk.
+ */
+ cdrom_q.setQuestion("Should " + disk_q->getAnswer() + " be a disk or a cd-rom device?");
+ cdrom_q.setExplanation("Do you want the OS to see this " + type_q.getAnswer() + " as a hard-disk, or as a cd-rom?");
+ cdrom_q.addAnswer("disk","false","Hard-disk");
+ cdrom_q.addAnswer("cd-rom","true","CD-ROM drive");
+ cdrom_q.setDefault("disk");
+ *os << " cdrom = " << cdrom_q.ask() << ";\n";
}
- if (type_q.getAnswer() == "file")
+ if (type_q.getAnswer() == "file" && cdrom_q.getAnswer() != "true")
{
/* For a file, we need to know whether to create
* it when it doesn't exist or not.
@@ -140,6 +151,8 @@ void add_disks(ShrinkingChoiceQuestion * disk_q, ostream * os)
create_q.setExplanation("The file will be created the first time the emulator runs.");
create_q.addAnswer("no","no","Don't create this file");
create_q.addAnswer("yes","yes","Create this file");
+ create_q.setDefault("yes");
+ create_q.ask();
if (create_q.getAnswer() == "yes")
{
/* If we should create the file, we need to
@@ -185,17 +198,6 @@ void add_disks(ShrinkingChoiceQuestion * disk_q, ostream * os)
*os << " size = \"" << size_q.getAnswer() << unit_q.getAnswer() << "\";\n";
}
- /* We need to know whether to emulate this as
- * a cd-rom, or as a hard-disk.
- */
- MultipleChoiceQuestion cdrom_q;
- cdrom_q.setQuestion("Should " + disk_q->getAnswer() + " be a disk or a cd-rom device?");
- cdrom_q.setExplanation("Do you want the OS to see this " + type_q.getAnswer() + " as a hard-disk, or as a cd-rom?");
- cdrom_q.addAnswer("disk","false","Hard-disk");
- cdrom_q.addAnswer("cd-rom","true","CD-ROM drive");
- cdrom_q.setDefault("disk");
- *os << " cdrom = " << cdrom_q.getAnswer() << ";\n";
-
/* We also need to know whether this is a
* writeable or a read-only device.
*/
@@ -206,7 +208,7 @@ void add_disks(ShrinkingChoiceQuestion * disk_q, ostream * os)
ro_q.addAnswer("yes","true","read-only");
ro_q.setDefault("no");
- if (cdrom_q.ask() == "true")
+ if (cdrom_q.getAnswer() == "true")
{
/* CD-ROMs are always read-only.
*/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.