Advertisement

Mode 13h

Started by July 27, 2005 05:53 AM
2 comments, last by CloudNine 19 years, 3 months ago
Is it possible to access mode 13h in linux console? e.g. would it be possible to make one of those neat 256b demos that go to mode 13h in linux.
Quote: Original post by Lode
Is it possible to access mode 13h in linux console?

e.g. would it be possible to make one of those neat 256b demos that go to mode 13h in linux.
With root priviligies, possibly..
A better bet is to check out svgalib or fbdev and let them handle a few of the compability issues for you.
After initializing svgalib you've pretty much got full access to the VGA registers and video memory, so there's no need to import further symbols just to set the palette for example.

Still, you'll have to waste a significant part of those 256 bytes on elf headers in your executable. LinuxAssembly.org has a tutorial on it.

Linking in SDL dynamically shouldn't be *that* bad either, it should be suitable for 4 kB demos at least.
Advertisement
Linux restricts access to supervisor mode, preventing your code from calling the VGA BIOS directly. You could, however, create a bare executable that can be run by any bootloader that can run without restrictions. Anyone with QEMU or Bochs could run the program without restarting.

Alternatively, you could settle for a semi-small executable (<100KB) and do some neat stuff with DirectFB, SDL, and/or GLX.
Free Mac Mini (I know, I'm a tool)
Try looking at sys_vm86. This will launch a 16-bit task where you can access all the ports and BIOS functions (IIRC, I've never tried this function). Perhaps you might also have to call sys_iopl.

This topic is closed to new replies.

Advertisement