Skip to content

Instantly share code, notes, and snippets.

@nullnilaki
Created January 25, 2014 04:36
Show Gist options
  • Save nullnilaki/8611939 to your computer and use it in GitHub Desktop.
Save nullnilaki/8611939 to your computer and use it in GitHub Desktop.
つっこみ
There are a few problems with your code:
- you use WSDISPLAYIO_MODE_MAPPED, this is for mapping a known graphics chip's resources at their bus addresses,
what you want is probably more like WSDISPLAYIO_MODE_DUMBFB which lets you map the framebuffer at offset 0.
These have to be distinct in order to avoid overlap, for example Sun firmware likes to assign low addresses to PCI BARs,
not a problem per se since there is no overlap in terms of physical addresses ( unlike with i386 PCs or macppc boxes ).
Some drivers don't distinguish between _MAPPED and _DUMBFB but that's going to change.
- when switching back to terminal emulation just use WSDISPLAYIO_MODE_EMUL - avoids getting stuck in framebuffer mode.
- why do you call some ioctl()s on STDIN_FILENO and some on /dev/ttyE0? That may cause some strange problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment