Implement hcs_$proc_info() as no-op and sys_info$service_system as true flag
authorNick Downing <nick@ndcode.org>
Thu, 24 Oct 2019 13:55:12 +0000 (00:55 +1100)
committerNick Downing <nick@ndcode.org>
Thu, 24 Oct 2019 13:55:53 +0000 (00:55 +1100)
dps8/dps8_cpu.c
dps8/dps8_ins.c
multics_sim.c

index 784ebe3..456e702 100644 (file)
@@ -3167,7 +3167,7 @@ int32 core_read (/*word24*/word36 addr, word36 *data, const char * ctx)
 #else
 #ifndef LOCKLESS
  //fprintf(stderr, "addr %012llo\n", addr);
- fprintf(stderr, "addr %012llo word %012llo\n", addr, M[(addr >> 18) & 077777][addr & 0777777]);
//fprintf(stderr, "addr %012llo word %012llo\n", addr, M[(addr >> 18) & 077777][addr & 0777777]);
     if (M[(addr >> 18) & 077777][addr & 0777777] & MEM_UNINITIALIZED)
       {
         sim_debug (DBG_WARN, & cpu_dev,
index 209bca7..ea53504 100644 (file)
@@ -9694,6 +9694,12 @@ static int emCall (void)
    void emcall_make_ptr(void);
    emcall_make_ptr();
   }
+  break;
+ case 030:
+  {
+   void emcall_proc_info(void);
+   emcall_proc_info();
+  }
   break;
 
     }
index 1300f0b..327bee2 100644 (file)
@@ -185,7 +185,7 @@ const char *xlate_segname(const char *name) {
 
 struct known_segment *make_known(const char *name) {
   name = xlate_segname(name);
+
   // see if already loaded
   for (int i = 0; i < n_known_segment; ++i)
     if (strcmp(known_segment[i].name, name) == 0)
@@ -371,6 +371,12 @@ struct its_pointer find_definition(
   if (strcmp(p->name, "hcs_") == 0) {
     if (strcmp(name, "make_ptr") == 0)
       return its_pointer(linkage_segment, emcall_stubs_offset);
+    if (strcmp(name, "proc_info") == 0)
+      return its_pointer(linkage_segment, emcall_stubs_offset + 3);
+  }
+  else if (strcmp(p->name, "sys_info") == 0) {
+    if (strcmp(name, "service_system") == 0)
+      return its_pointer(linkage_segment, emcall_stubs_offset + 6);
   }
 
   struct object_map *object_map = get_object_map(p);
@@ -626,7 +632,6 @@ void emcall_make_ptr(void) {
 
   char entry_point_name_buf[NAME_LEN + 1];
   get_string_rstrip(entry_point_name_buf, entry_point_name, NAME_LEN);
- printf("%s:%s\n", entryname_buf, entry_point_name_buf);
 
   *ref_pointer =
     entry_point_name_buf[0] ?
@@ -650,6 +655,9 @@ void emcall_make_ptr(void) {
   *code = 0;
 }
 
+void emcall_proc_info(void) {
+}
+
 int main(int argc, char **argv) {
   bool af = false;
   if (argc >= 2 && strcmp(argv[1], "--af") == 0) {
@@ -678,7 +686,7 @@ int main(int argc, char **argv) {
   // initialize CPU
   sim_deb = stderr;
   cpu_dev.dctrl =
-    DBG_TRACE |
+    //DBG_TRACE |
     //DBG_MSG |
     //DBG_REGDUMPAQI |
     //DBG_REGDUMPIDX |
@@ -856,13 +864,17 @@ int main(int argc, char **argv) {
   );
 
   // create emcall stubs
-  emcall_stubs_offset = allocate_linkage(3, 1);
+  emcall_stubs_offset = allocate_linkage(7, 1);
   uint64_t *emcall_stubs = (uint64_t *)(
     M[linkage_segment] + emcall_stubs_offset
   );
   emcall_stubs[0] = 0700046272120L; // tsp2 pr7|46,n* alm_entry
   emcall_stubs[1] = 0000027420400L; // emcall make_ptr
   emcall_stubs[2] = 0700044710120L; // tra pr7|44,n* alm_return_no_pop
+  emcall_stubs[3] = 0700046272120L; // tsp2 pr7|46,n* alm_entry
+  emcall_stubs[4] = 0000030420400L; // emcall proc_info
+  emcall_stubs[5] = 0700044710120L; // tra pr7|44,n* alm_return_no_pop
+  emcall_stubs[6] = 0400000000000L; // bit(1) indicating system is up
 
   // create calling stub
   int calling_stub_offset = allocate_linkage(2, 1);