Browse Source

Add sectorlisp and sectorforth

Fabian 2 years ago
parent
commit
5877d36bf5
3 changed files with 27 additions and 2 deletions
  1. 3 1
      index.html
  2. 20 0
      src/browser/main.js
  3. 4 1
      src/floppy.js

+ 3 - 1
index.html

@@ -55,8 +55,10 @@
             A homebrew operating system from scratch, written in assembly language</td></tr>
             <tr id="start_solos"><td><a href="?profile=solos">Solar OS</a> <small>0.3 MB</small></td><td>
             Simple graphical OS</td></tr>
-            <tr id="start_bootchess"><td><a href="?profile=bootchess">Bootchess</a> <small>0.1 MB</small></td><td>
+            <tr id="start_bootchess"><td><a href="?profile=bootchess">Bootchess</a> <small>512 B</small></td><td>
             A tiny chess program written in the boot sector</td></tr>
+            <tr id="start_sectorlisp"><td><a href="?profile=sectorlisp">SectorLISP</a> <small>512 B</small></td><td>
+            A LISP interpreter that fits into the boot sector</td></tr>
         </table>
 
         <hr>

+ 20 - 0
src/browser/main.js

@@ -402,6 +402,26 @@
                 name: "bootBASIC",
                 homepage: "https://github.com/nanochess/bootBASIC",
             },
+            {
+                id: "sectorlisp",
+                fda: {
+                    "url": HOST + "sectorlisp.img",
+                    "async": false,
+                    "size": 512,
+                },
+                name: "SectorLISP",
+                homepage: "https://justine.lol/sectorlisp/",
+            },
+            {
+                id: "sectorforth",
+                fda: {
+                    "url": HOST + "sectorforth.img",
+                    "async": false,
+                    "size": 512,
+                },
+                name: "sectorforth",
+                homepage: "https://github.com/cesarblum/sectorforth",
+            },
             {
                 id: "floppybird",
                 fda: {

+ 4 - 1
src/floppy.js

@@ -73,6 +73,9 @@ function FloppyController(cpu, fda_image, fdb_image)
             1440 : { type: 4, tracks: 80, sectors: 18, heads: 2 },
             1722 : { type: 5, tracks: 82, sectors: 21, heads: 2 },
             2880 : { type: 5, tracks: 80, sectors: 36, heads: 2 },
+
+            // not a real floppy type, used to support sectorlisp and friends
+            0    : { type: 1, tracks: 1, sectors: 1, heads: 1 },
         };
 
         var number_of_cylinders,
@@ -80,7 +83,7 @@ function FloppyController(cpu, fda_image, fdb_image)
             number_of_heads,
             floppy_type = floppy_types[this.floppy_size >> 10];
 
-        if(floppy_type && (this.floppy_size & 0x3FF) === 0)
+        if(floppy_type && ((this.floppy_size & 0x3FF) === 0 || this.floppy_size === 512))
         {
             cpu.devices.rtc.cmos_write(CMOS_FLOPPY_DRIVE_TYPE, floppy_type.type << 4);