top of page

Building a W65C265S Operating System (?)

  • Writer: rehsd
    rehsd
  • 20 hours ago
  • 2 min read

As my W65C265S hardware build is coming along well, I would like to develop an operating system (OS) for it. While I have done miscellaneous 65xxx development over the years, my code has always been a mishmash of routines. The closest I have come to better understanding operating systems is implementing FreeDOS on my 286/386 builds, where I was adding core BIOS routines to support FreeDOS. So, can I hack my way through this and develop and operating system? Time will tell.


So what is an operating system?

I am going to work off this definition: An operating system is the software layer that sits between programs and the hardware, providing the essential services, abstractions, and control needed to run code safely, consistently, and efficiently.


Three fundamentals of an operating system:

  1. Resource management: CPU, memory, I/O devices, storage.

  2. Hardware abstraction: read files, draw a shape, etc.

  3. Program execution environment: startup, system calls, memory layout, multitasking, error handling.



Roadmap

If I have any chance of success, I will need to continue to build my knowledge of 65816 development. I will also benefit from a plan of attack. Given that, I am thinking of working through OS development in the following general order (knowing that I will need to loop back at times as I learn).


  1. Foundations

    1. Reset, startup code

      1. Set CPU to native mode

      2. Configure M/X flags

      3. Initialize stack

      4. Set up Direct Page

      5. Configure memory map

      6. Initialize internal peripherals

    2. Console and video drivers (ILI LCD, VGA)

      1. TX/RX routines

      2. Video primitives (pixels, lines, rectangles, circles) and character support

    3. Basic interrupt handling

  2. Kernel core

    1. Timer driver

    2. Syscall mechanism

      1. COP handler

      2. Syscall table

    3. Memory management

      1. Static memory map

      2. Kernel heap

  3. Device abstraction

    1. Video functions

    2. Block devices

  4. Filesystem

    1. Program loader

    2. FAT16

  5. OS Tools

    1. Shell, monitor

    2. Libraries, runtime

  6. Multitasking

  7. Graphic user interface


As with most of my posts, this will be a 'living' post that I will continue to update as I learn and progress on a '265 OS. More to come!

 
 
 

Comments


bottom of page