Author Topic: Max's Painter, a Boot Sector Program  (Read 14113 times)

Offline Max

  • Jr. Member
  • *
  • Posts: 7
  • Country: us
Max's Painter, a Boot Sector Program
« on: July 21, 2014, 08:22:01 AM »
It's been a quiet month in the Example Code section. Here's a little program I made (from various sources I tried to remember), where you can make images on the screen.
It runs in the boot sector, and is exactly 512 bytes in length.
Here I do not explicitly call bios interrupts, though I do patch one.
You can't save the image or print it, but who cares?  ;)


Instructions:
  • Move smoothly with WASD.
  • Move precisely with the ARROW KEYS.
  • Show a cursor by holding down E or RSHFT (hard/impossible to see with some colors).
  • Switch colors with LSHFT/SPACE or RCTRL/KEYPAD_0.




Source is attached.
Tested in Bochs and on hardware, not guaranteed to work with all hardware. Very probably could be optimized more.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Max's Painter, a Boot Sector Program
« Reply #1 on: July 21, 2014, 07:43:12 PM »
Kewl! I can confirm that it runs on my current hardware (valuable antique HP P4 - real floppy). If/when I get my "new" computer running again, I won't have the floppy... unless I migrate it - use a can-opener to make a place for it, I guess...

The only "sensible" thing for a boot sector to do is to load something else, of course, and you haven't left space for that. This might make a good "kernel" or part of a "kernel". Once we switch to pmode, none of this stuff will work, and a 16-bit "OS" hardly seems worth it, these days... Thanks, Max!

Best,
Frank


Offline Max

  • Jr. Member
  • *
  • Posts: 7
  • Country: us
Re: Max's Painter, a Boot Sector Program
« Reply #2 on: July 22, 2014, 07:03:54 AM »
Actually, I tested with a very small USB Storage Device. I just formatted the device and copied the flat binary into sector 1.