Software



At this time i have only software for a minimal bootstrap of the computer with 65C816 CPU. All I/O port work, the keyboard and video (either onboard or with optional video board) are managed near to full, serial port handled in full (with a test for communicate vith a PC or another mainboard).
FDC controller work fine, and i provide basic function for read,write and format a floppy (also in CBM 1581 format). Now i'm able to read and write to ATA device, detect them, and detect the file system. The driver for FAT is under development.
After the boot the machine start a sytem monitor (to view memory, register, fill memory and do some test, as full memory test). I'm working also to write a small assembler/disassembler tu use in monitor.
Some pieces of software are complete (and seem to work fine):
- the mult/div operation for integer (either signed and unsigned) up to 64 bit and conversion from string to integer and from integer to decimal/hex string (see intp.asm source code).
- the four basic operations with float point number (15bit exponent, 64bit mantissa, significant digits 19/20, as the extended real in 80x87 FPU) and conversion from string to float and from float string (see fpuemu.asm source code). Planning for the future: implementation of the sqrt(), ln(), exp(), sin(), cos(), tan().
- the vprinter family of functions for format string as done by sprintf() family functions in C. I attempted to replicate as near possible the C-function and result seem to good (see vprint.asm source code). Also exist a function that print in the screen as the C-style printf() function.

The purpose is to write a complete BIOS and a mini operating system that can be stored in flash memory, that can handle the FAT file system, and with the support for long file names (LFN). System calls are not managed by COP instruction (an idea that I had initially) but through long jump to subroutine (JSL).

I use the assembler/linker from Avocet, but i think that the source code can be assembled with other tools also. The format for object files is motorola s26 and at end of linking the binary file (to put in flash/emulator) is created by hexform.exe utility. For build all i use an old dos utility (make.exe) from Borland.

The source code is free and anyone can use it (no warranty!) without limitation; i appreciate if someone would exchange her impression and suggestion about this code.


   Zipped Source code (65C816)


The firmware for keyboard controller (PIC18F4420). This was developed with MPLAB IDE (from microchip). Debugging & uploading firmware into PIC made by ICD3 MPLAB in-circuit debugger and programmer.
   Zipped firmware source code (PIC18F4420)


NOTE: look at SRC\FE for source code of the p-code interpreter, at SRC\FF for a simple monitor with native assembler/disassembler, at SRC\F8 for startup code and system calls.

Linker output summary:
******************************************************************************
*                      S E C T I O N      S U M M A R Y                      *
******************************************************************************
*    Section Name                  Start      End         Description        *
******************************************************************************
* ATABIOS                          000000    000067   STRUCT                 *
* CBMHIM                           000000    0000FF    CBM text work area    *
* CBMHIV                           000000    0000FF    CBM var/p-code area   *
* CBMJMP                           FEFF00    FEFFFB   CBM Jmp-Table $FE      *
* CODE                             F8FE00    F8FF60                          *
* CODEF8                           F80200    F85F1A   Segment F8             *
* CODEF9                           F90000    F9075A   Segment F9             *
* CODEFA                           FA0000    FA0001   Segment FA             *
* CODEFB                           FB0000    FB0001   Segment FB             *
* CODEFC                           FC0000    FC0001   Segment FC             *
* CODEFD                           FD0000    FD0001   Segment FD             *
* CODEFE                           FE0000    FE9746   Segment FE             *
* CODEFF                           FF000E    FF2967   Segment FF             *
* DIRP00                           000000    0000A1   Direct-Page 00         *
* DIRP01                           000000    0000F7   Direct-Page 01         *
* DIRP02                           000000    0000CB   Direct-Page 02         *
* DIRP03                           000000    0000FF   Direct-Page 03         *
* DIRP04                           000000    0000F8   Direct-Page 04         *
* DIRP05                           000000    000068   Direct-Page 05         *
* DPCBM                            000000    0000E3   CBM Direct-Page        *
* FAT12D                           000000    000017   STRUCT                 *
* FATCM                            000000    000009   STRUCT                 *
* FATD                             000000    000025   STRUCT                 *
* LIBCODE                          F80000    F8000B   Library Jump Table     *
* MONSEG                           FF0000    FF000D   Start Monitor          *
* SYSCODE                          F8F000    F8F356   System                 *
* SYSTBLE                          F8FA00    F8FDFF   Sys Funcs Table        *
* SYSVECTRS                        F8FFE0    F8FFFF   Vectors                *
* VDCFONT                          FFF800    FFFFFF   VDC Font               *
* XFAT32                           000000    00002B   STRUCT                 *
* XFATD                            000000    000023   STRUCT                 *
******************************************************************************



******************************************************************************
*                             L O A D      M A P                             *
******************************************************************************
*    Section Name              Starting Address    Ending Address    Size    *
******************************************************************************
* obj\F8\start.obj                                                           *
*    SYSCODE                        F8F000             F8F356       000357   *
*    CODE                           F8FE00             F8FF60       000161   *
*   -DIRP00                         000000             0000A1       0000A2   *
*   -DIRP01                         000000             0000F7       0000F8   *
*    SYSVECTRS                      F8FFE0             F8FFFF       000020   *
* obj\F8\systble.obj                                                         *
*    SYSTBLE                        F8FA00             F8FDFF       000400   *
* obj\F8\sysf8.obj                                                           *
*    CODEF8                         F80200             F803F8       0001F9   *
*   -DIRP00                         000000             0000A1       0000A2   *
*   -DIRP01                         000000             0000F7       0000F8   *
* obj\F8\lcd.obj                                                             *
*    CODEF8                         F803F9             F80640       000248   *
*   -DIRP01                         000000             0000F7       0000F8   *
* obj\F8\reset.obj                                                           *
*   -ATABIOS                        000000             000067       000068   *
*    CODEF8                         F80641             F81169       000B29   *
*   -DIRP00                         000000             0000A1       0000A2   *
*   -DIRP01                         000000             0000F7       0000F8   *
* obj\F8\vprint.obj                                                          *
*    CODEF8                         F8116A             F817F1       000688   *
*   -DIRP02                         000000             0000CB       0000CC   *
* obj\F8\intp.obj                                                            *
*    CODEF8                         F817F2             F8226B       000A7A   *
*   -DIRP02                         000000             0000CB       0000CC   *
* obj\F8\fpuemu.obj                                                          *
*    CODEF8                         F8226C             F830C6       000E5B   *
*   -DIRP02                         000000             0000CB       0000CC   *
* obj\F8\ata.obj                                                             *
*    LIBCODE                        F80000             F7FFFF       000000   *
*                                   000000             000009       00000A   *
*                                   000000             000025       000026   *
*                                   000000             000017       000018   *
*                                   000000             000023       000024   *
*                                   000000             00002B       00002C   *
*                                   F80000             F7FFFF       000000   *
*                                   F80010             F8001B       00000C   *
*    CODEF8                         F830C7             F83FF9       000F33   *
*   -DIRP00                         000000             0000A1       0000A2   *
*   -DIRP03                         000000             0000FF       000100   *
*   -DIRP04                         000000             0000F8       0000F9   *
*   -DIRP05                         000000             000068       000069   *
*   -ATABIOS                        000000             000067       000068   *
* obj\F8\fdc.obj                                                             *
*    CODEF8                         F83FFA             F8519E       0011A5   *
*   -DIRP00                         000000             0000A1       0000A2   *
* obj\F8\vdc.obj                                                             *
*    CODEF8                         F8519F             F85F1A       000D7C   *
*   -DIRP00                         000000             0000A1       0000A2   *
*   -DIRP01                         000000             0000F7       0000F8   *
* obj\F9\sysf9.obj                                                           *
*    CODEF9                         F90000             F9002E       00002F   *
*   -DIRP03                         000000             0000FF       000100   *
*   -DIRP04                         000000             0000F8       0000F9   *
*   -DIRP05                         000000             000068       000069   *
*   -ATABIOS                        000000             000067       000068   *
*                                   000000             000009       00000A   *
*                                   000000             000025       000026   *
*                                   000000             000017       000018   *
*                                   000000             000023       000024   *
*                                   000000             00002B       00002C   *
* obj\F9\biosmem.obj                                                         *
*    CODEF9                         F9002F             F90154       000126   *
*   -DIRP00                         000000             0000A1       0000A2   *
* obj\F9\acia.obj                                                            *
*    CODEF9                         F90155             F9035A       000206   *
*   -DIRP00                         000000             0000A1       0000A2   *
* obj\F9\fat.obj                                                             *
*    CODEF9                         F9035B             F9075A       000400   *
*   -DIRP03                         000000             0000FF       000100   *
*   -DIRP04                         000000             0000F8       0000F9   *
*   -DIRP05                         000000             000068       000069   *
*   -ATABIOS                        000000             000067       000068   *
*                                   000000             000009       00000A   *
*                                   000000             000025       000026   *
*                                   000000             000017       000018   *
*                                   000000             000023       000024   *
*                                   000000             00002B       00002C   *
* obj\FE\main.obj                                                            *
*    CODEFE                         FE0000             FE0D9D       000D9E   *
*   -DPCBM                          000000             0000E3       0000E4   *
*   -CBMHIM                         000000             FFFFFF       000000   *
*                                   00FF00             00FFC7       0000C8   *
*                                   00FFF8             00FFFF       000008   *
*                                   000000             FFFFFF       000000   *
*                                   00FF00             00FFFF       000100   *
* obj\FE\float.obj                                                           *
*    CODEFE                         FE0D9E             FE17BB       000A1E   *
*   -DPCBM                          000000             0000E3       0000E4   *
*   -CBMHIM                         000000             FFFFFF       000000   *
*                                   00FF00             00FFC7       0000C8   *
*                                   00FFF8             00FFFF       000008   *
*                                   000000             FFFFFF       000000   *
*                                   00FF00             00FFFF       000100   *
* obj\FE\pcode.obj                                                           *
*    CODEFE                         FE17BC             FE3E0A       00264F   *
*   -DPCBM                          000000             0000E3       0000E4   *
*   -CBMHIM                         000000             FFFFFF       000000   *
*                                   00FF00             00FFC7       0000C8   *
*                                   00FFF8             00FFFF       000008   *
*                                   000000             FFFFFF       000000   *
*                                   00FF00             00FFFF       000100   *
* obj\FE\pcstd.obj                                                           *
*    CODEFE                         FE3E0B             FE459F       000795   *
* obj\FE\pcerr.obj                                                           *
*    CODEFE                         FE45A0             FE5647       0010A8   *
* obj\FE\pcc.obj                                                             *
*    CODEFE                         FE5648             FE9057       003A10   *
* obj\FE\kcbm.obj                                                            *
*    CODEFE                         FE9058             FE9746       0006EF   *
*    CBMJMP                         FEFF00             FEFF05       000006   *
*                                   FEFF30             FEFF4D       00001E   *
*                                   FEFF7A             FEFFFB       000082   *
*   -DIRP00                         000000             0000A1       0000A2   *
*   -DPCBM                          000000             0000E3       0000E4   *
*   -CBMHIM                         000000             FFFFFF       000000   *
*                                   00FF00             00FFC7       0000C8   *
*                                   00FFF8             00FFFF       000008   *
*                                   000000             FFFFFF       000000   *
*                                   00FF00             00FFFF       000100   *
* obj\FF\monitor.obj                                                         *
*    MONSEG                         FF0000             FF000D       00000E   *
*    CODEFF                         FF000E             FF1231       001224   *
*   -DIRP00                         000000             0000A1       0000A2   *
*   -DIRP01                         000000             0000F7       0000F8   *
* obj\FF\masmx.obj                                                           *
*    CODEFF                         FF1232             FF1B2A       0008F9   *
*   -DIRP01                         000000             0000F7       0000F8   *
* obj\FF\mond.obj                                                            *
*    CODEFF                         FF1B2B             FF2967       000E3D   *
*   -DIRP00                         000000             0000A1       0000A2   *
*   -DIRP01                         000000             0000F7       0000F8   *
*   -ATABIOS                        000000             000067       000068   *
* obj\FF\font.obj                                                            *
*    VDCFONT                        FFF800             FFFFFF       000800   *
* obj\FA\dummy.obj                                                           *
*    CODEFA                         FA0000             FA0001       000002   *
* obj\FB\dummy.obj                                                           *
*    CODEFB                         FB0000             FB0001       000002   *
* obj\FC\dummy.obj                                                           *
*    CODEFC                         FC0000             FC0001       000002   *
* obj\FD\dummy.obj                                                           *
*    CODEFD                         FD0000             FD0001       000002   *
******************************************************************************