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)


Linker output summary:
******************************************************************************
*                      S E C T I O N      S U M M A R Y                      *
******************************************************************************
*    Section Name                  Start      End         Description        *
******************************************************************************
* ATABIOS                          000000    00005B   STRUCT                 *
* CODE                             F8FE00    F8FF1D                          *
* CODEF8                           F82A10    F86C91   Segment F8             *
* CODEF9                           F90000    F92CD5   Segment F9             *
* CODEFA                           FA0000    FA0001   Segment FA             *
* CODEFB                           FB0000    FB0001   Segment FB             *
* CODEFC                           FC0000    FC0001   Segment FC             *
* CODEFD                           FD0000    FD0001   Segment FD             *
* CODEFE                           FE0000    FE0001   Segment FE             *
* CODEFF                           FF0000    FF0142   Segment FF             *
* DIRP00                           000000    00008A   Direct-Page 00         *
* DIRP01                           000000    0000F1   Direct-Page 01         *
* DIRP02                           000000    0000CB   Direct-Page 02         *
* DIRP03                           000000    0000FD   Direct-Page 03         *
* DIRP04                           000000    0000F8   Direct-Page 04         *
* DIRP05                           000000    00008F   Direct-Page 05         *
* FAT12D                           000000    000017   STRUCT                 *
* FATCM                            000000    000009   STRUCT                 *
* FATD                             000000    000025   STRUCT                 *
* JMPTF8                           F82A00    F82A0F   Jmp-Table $F8          *
* SYSCODE                          F8F000    F8F356   System                 *
* SYSVECTRS                        F8FFE0    F8FFFF   Vectors                *
* VDCFONT                          F80000    F829FF   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             F8FF1D       00011E   *
*   -DIRP00                         000000             00008A       00008B   *
*   -DIRP01                         000000             0000F1       0000F2   *
*    SYSVECTRS                      F8FFE0             F8FFFF       000020   *
* obj\F8\font.obj                                                            *
*    VDCFONT                        F80000             F829FF       002A00   *
* obj\F8\lcd.obj                                                             *
*    CODEF8                         F82A10             F82C57       000248   *
*   -DIRP01                         000000             0000F1       0000F2   *
* obj\F8\reset.obj                                                           *
*   -ATABIOS                        000000             00005B       00005C   *
*    CODEF8                         F82C58             F83542       0008EB   *
*   -DIRP00                         000000             00008A       00008B   *
*   -DIRP01                         000000             0000F1       0000F2   *
* obj\F8\monitor.obj                                                         *
*    CODEF8                         F83543             F8457C       00103A   *
*   -DIRP00                         000000             00008A       00008B   *
*   -DIRP01                         000000             0000F1       0000F2   *
* obj\F8\mondiag.obj                                                         *
*    CODEF8                         F8457D             F84D12       000796   *
*   -DIRP00                         000000             00008A       00008B   *
*   -DIRP01                         000000             0000F1       0000F2   *
*   -ATABIOS                        000000             00005B       00005C   *
* obj\F8\vprint.obj                                                          *
*    JMPTF8                         F82A00             F82A03       000004   *
*                                   F82A08             F82A0B       000004   *
*                                   F82A04             F82A07       000004   *
*                                   F82A0C             F82A0F       000004   *
*    CODEF8                         F84D13             F853BC       0006AA   *
*   -DIRP02                         000000             0000CB       0000CC   *
* obj\F8\intp.obj                                                            *
*    CODEF8                         F853BD             F85E36       000A7A   *
*   -DIRP02                         000000             0000CB       0000CC   *
* obj\F8\fpuemu.obj                                                          *
*    CODEF8                         F85E37             F86C91       000E5B   *
*   -DIRP02                         000000             0000CB       0000CC   *
* obj\F9\jmptbl.obj                                                          *
*    CODEF9                         F90000             F90264       000265   *
*   -DIRP01                         000000             0000F1       0000F2   *
* obj\F9\biosmem.obj                                                         *
*    CODEF9                         F90265             F9038A       000126   *
*   -DIRP00                         000000             00008A       00008B   *
* obj\F9\vdc.obj                                                             *
*    CODEF9                         F9038B             F91078       000CEE   *
*   -DIRP01                         000000             0000F1       0000F2   *
* obj\F9\acia.obj                                                            *
*    CODEF9                         F91079             F9127E       000206   *
*   -DIRP00                         000000             00008A       00008B   *
* obj\F9\fdc.obj                                                             *
*    CODEF9                         F9127F             F91AD2       000854   *
*   -DIRP00                         000000             00008A       00008B   *
* obj\F9\ata.obj                                                             *
*   -FATCM                          000000             000009       00000A   *
*                                   000000             000025       000026   *
*                                   000000             000017       000018   *
*                                   000000             000023       000024   *
*                                   000000             00002B       00002C   *
*    CODEF9                         F91AD3             F9255C       000A8A   *
*   -DIRP00                         000000             00008A       00008B   *
*   -DIRP03                         000000             0000FD       0000FE   *
*   -DIRP04                         000000             0000F8       0000F9   *
*   -DIRP05                         000000             00008F       000090   *
*   -ATABIOS                        000000             00005B       00005C   *
* obj\F9\fat.obj                                                             *
*    CODEF9                         F9255D             F92CD5       000779   *
*   -DIRP03                         000000             0000FD       0000FE   *
*   -DIRP04                         000000             0000F8       0000F9   *
*   -DIRP05                         000000             00008F       000090   *
*   -ATABIOS                        000000             00005B       00005C   *
*                                   000000             000009       00000A   *
*                                   000000             000025       000026   *
*                                   000000             000017       000018   *
*                                   000000             000023       000024   *
*                                   000000             00002B       00002C   *
* 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   *
* obj\FE\dummy.obj                                                           *
*    CODEFE                         FE0000             FE0001       000002   *
* obj\FF\reset.obj                                                           *
*    CODEFF                         FF0000             FF0142       000143   *
******************************************************************************