Jump to content
IGNORED

Why the "k" on boot?


Steve Mynott

Recommended Posts

  • 1 year later...

 

Sad to hear that. I hope the source is out there.

As someone who is in the middle of designing my own SIO2SD Atari 8bit Disk Drive emulator based on Teensy 3.5 MCU I was able to dig some information about the K Boot loader.

// The KBoot loader was written by Ken Siders (atari@columbus.rr.com)
// RIP. Ken; you'll always be remembered in the community; thanks for everything. Condolences to your family.
// Obituary page where condolences can be posted: Kenneth Lee Siders (February 12, 1968 - August 12, 2017):
// http://www.boydbornfuneralhome.com/obituaries/Kenneth-Siders/
//                                  ,,,,,
//                             #WWWWWWWWWWWWW*
//                         ,WWWWWWWWWWWWWWWWWWWW:
//                       *WWWWWWWWWW+,    .*WWWWWW#
//                     +WWWWWWWW+           W  :WWWW.
//                    WWWWWWWW                    WWWW
//                  :WWWWWWW,                W      WWW
//                 WWWWWWW#                  :W      :WW
//                WWWWWWW,                   , W       WW
//               @WWWWWW                       .#       WW
//              :WWWWWW                      *  *.       WW
//              WWWWWW,                      *   W        W#
//             WWWWWW#                                     W
//            ,WWWWWW                       .     ,        #W
//            WWWWWW,                             .         W.
//            WWWWWW                              ,         +W
//           :WWWWW:                                         W
//           WWWWWW                                          W#
//           WWWWWW                                          :W
//           WWWWW+                                           W
//           WWWWW+                                           W
//           WWWWW+     .......,       ****+   WWWWWW*,       W
//           WWWWW+      #WW   WW       WW,     WW   @WW      W
//           WWWWW+       W@    WW      WW      WW    WW      W
//           WWWWW+       W@    WW      WW      WW    WW:     W
//           WWWWW+       W@    WW      WW      WW    WW,     W
//           WWWWW+       W@    WW      WW      WW    WW      W
//           WWWWW+       W@   WW       WW      WW   WW       W
//           WWWWW+       WWWWW,        WW      WW**W@        W
//           WWWWW+       WW  ,W+       WW      WW            W
//           WWWWW+       WW   WW       WW      WW            W
//           WWWWW+       WW   :WW      WW      WW            W
//           WWWWW+       WW    WW,     WW      WW            W
//           WWWWW+       WW    *WW     WW,     WW            W
//    .:     WWWWW+      WWW*    @WWW  WWWWW   WWWWW          W
//     @:    WWWWW+                                           W
//      W    WWWWW+                                           W
//      :W   WWWWW+                                           W
//       W:  WWWWW+                                           W   +      W
//       +W  WWWWW+                                           W   #     W,
//        W, WWWWW+                                           W  ,,    W+
//        WW WWWWW+                                           W  W    :W
//    *.  ,W WWWWW+                                           W  W W  W
//     .W  W.WWWWW+                                           W  W+  W,
//      ## WWWWWWW+                                           W  *W +W
//       W,:WWWWWW+                                           W ++. W
//       ,W WWWWWW+                                           W WW WW
//        WWWWWWWW+                   :WW*                    W WW,W
//        ,W@WWWWW+                 #WWWWWW                   W W.WW
//         WWWWWWW+               .WWW    WW                  W W*W
//         *WWWWWW+              WWW      +W.                 W,WWW
//          WWWWWW+             WW*        WW         .**,    W+WW
//           WWWWW+           *WW           WWW:#WWWWWWWWWW   W@WW
//             WWW+          WWW             WWWWWW:      W,  WWW
//               @@WWWWWW  #WW,                           .W  WWW
//              *W      WWWW@                              WWWWW,
//             W          .                                 +WWWWW+
//  Disk Formats Explained, By Ken Siders -  http://atari.fox-1.nl/disk-formats-explained/#vtoc1
//  K_Boot Disk Loader:
// Only single density disks (128 byte sectors) are supported.
//   Sector Ranges
// Sectors    Function
// 1 to 3    Boot Sectors
// 4 to ???  Data Sectors
//   Boot Sectors
// Sectors 1 to 3 contain necessary information to boot the disk and load the executable file located at sector 4 and above.
// The function of the first 13 bytes of sector one is indicated in the table, the remaining bytes of sector one,
// as well as sectors two and three contain the code to load the file.
//
// Byte Offset  Function
// 0 Unused. Usually 0.
// 1 Number of sectors to initially boot.  This is set to three
// which is enough to get the loader into memory
// 2 to 3  Boot Load Address. 1792 ($700)
// 4 to 5  Initialization Address. Called after booting requested number of sectors.
// 6 to 8  JMP to Boot Continuation Address. This is a 6502 jump
// instruction (76/$4C) followed by the address to jump to after
// booting the requested number of sectors. This routine will then
// load the actual file which is located at sectors 4 and above
// 9 to 11 Number of bytes to load (number of bytes in original
// executable)  This is a three byte value.  The least significant byte is stored first.
// 12  Unused.  Set to 0
//
//  Data Sectors
// Each sector holds a full 128 bytes of
// data — there is no sector link information stored in a sector. The
// file contains all of the bytes verbatim from the original file
// including the $FF $FF header, multiple load segments, initialization,
// and run addresses.  The file should be processed exactly as it
// would be by Dos.  The last sector may only be partially filled
// and may be padded with random data.  The length to load is
// determined from sector 1 (the KBoot), bytes 9 to 11.  Extracting the
// original file is easy.  If processing from an ATR file read and
// verify the 16 byte ATR header.  Read the first three sectors
// (384 bytes).  Get the length from bytes 9 to 11.  Read that
// many bytes from the KBoot file and write to the output file.
// Done.

byte KBOOT_LOADER[] = {
  0x00, 0x03, 0x00, 0x07, 0x14, 0x07, 0x4c, 0x14, 0x07, 0xAA, 0xBB, 0xCC, 0x00, 0xa9, 0x46, 0x8d, 0xc6, 0x02, 0xd0, 0xfe, 0xa0, 0x00, 0xa9, 0x6b,
  0x91, 0x58, 0x20, 0xd9, 0x07, 0xb0, 0xee, 0x20, 0xc4, 0x07, 0xad, 0x7a, 0x08, 0x0d, 0x76, 0x08, 0xd0, 0xe3, 0xa5, 0x80, 0x8d, 0xe0, 0x02, 0xa5,
  0x81, 0x8d, 0xe1, 0x02, 0xa9, 0x00, 0x8d, 0xe2, 0x02, 0x8d, 0xe3, 0x02, 0x20, 0xeb, 0x07, 0xb0, 0xcc, 0xa0, 0x00, 0x91, 0x80, 0xa5, 0x80, 0xc5,
  0x82, 0xd0, 0x06, 0xa5, 0x81, 0xc5, 0x83, 0xf0, 0x08, 0xe6, 0x80, 0xd0, 0x02, 0xe6, 0x81, 0xd0, 0xe3, 0xad, 0x76, 0x08, 0xd0, 0xaf, 0xad, 0xe2,
  0x02, 0x8d, 0x70, 0x07, 0x0d, 0xe3, 0x02, 0xf0, 0x0e, 0xad, 0xe3, 0x02, 0x8d, 0x71, 0x07, 0x20, 0xff, 0xff, 0xad, 0x7a, 0x08, 0xd0, 0x13, 0xa9,
  0x00, 0x8d, 0xe2, 0x02, 0x8d, 0xe3, 0x02, 0x20, 0xae, 0x07, 0xad, 0x7a, 0x08, 0xd0, 0x03, 0x4c, 0x3c, 0x07, 0xa9, 0x00, 0x85, 0x80, 0x85, 0x81,
  0x85, 0x82, 0x85, 0x83, 0xad, 0xe0, 0x02, 0x85, 0x0a, 0x85, 0x0c, 0xad, 0xe1, 0x02, 0x85, 0x0b, 0x85, 0x0d, 0xa9, 0x01, 0x85, 0x09, 0xa9, 0x00,
  0x8d, 0x44, 0x02, 0x6c, 0xe0, 0x02, 0x20, 0xeb, 0x07, 0x85, 0x80, 0x20, 0xeb, 0x07, 0x85, 0x81, 0xa5, 0x80, 0xc9, 0xff, 0xd0, 0x10, 0xa5, 0x81,
  0xc9, 0xff, 0xd0, 0x0a, 0x20, 0xeb, 0x07, 0x85, 0x80, 0x20, 0xeb, 0x07, 0x85, 0x81, 0x20, 0xeb, 0x07, 0x85, 0x82, 0x20, 0xeb, 0x07, 0x85, 0x83,
  0x60, 0x20, 0xeb, 0x07, 0xc9, 0xff, 0xd0, 0x09, 0x20, 0xeb, 0x07, 0xc9, 0xff, 0xd0, 0x02, 0x18, 0x60, 0x38, 0x60, 0xad, 0x09, 0x07, 0x0d, 0x0a,
  0x07, 0x0d, 0x0b, 0x07, 0xf0, 0x79, 0xac, 0x79, 0x08, 0x10, 0x50, 0xee, 0x77, 0x08, 0xd0, 0x03, 0xee, 0x78, 0x08, 0xa9, 0x31, 0x8d, 0x00, 0x03,
  0xa9, 0x01, 0x8d, 0x01, 0x03, 0xa9, 0x52, 0x8d, 0x02, 0x03, 0xa9, 0x40, 0x8d, 0x03, 0x03, 0xa9, 0x80, 0x8d, 0x04, 0x03, 0xa9, 0x08, 0x8d, 0x05,
  0x03, 0xa9, 0x1f, 0x8d, 0x06, 0x03, 0xa9, 0x80, 0x8d, 0x08, 0x03, 0xa9, 0x00, 0x8d, 0x09, 0x03, 0xad, 0x77, 0x08, 0x8d, 0x0a, 0x03, 0xad, 0x78,
  0x08, 0x8d, 0x0b, 0x03, 0x20, 0x59, 0xe4, 0xad, 0x03, 0x03, 0xc9, 0x02, 0xb0, 0x22, 0xa0, 0x00, 0x8c, 0x79, 0x08, 0xb9, 0x80, 0x08, 0xaa, 0xad,
  0x09, 0x07, 0xd0, 0x0b, 0xad, 0x0a, 0x07, 0xd0, 0x03, 0xce, 0x0b, 0x07, 0xce, 0x0a, 0x07, 0xce, 0x09, 0x07, 0xee, 0x79, 0x08, 0x8a, 0x18, 0x60,
  0xa0, 0x01, 0x8c, 0x76, 0x08, 0x38, 0x60, 0xa0, 0x01, 0x8c, 0x7a, 0x08, 0x38, 0x60, 0x00, 0x03, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...