技术控

    今日:17| 主题:51231
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] Tetros: Tetris that fits into the 512 byte MBR

[复制链接]
心控2star 发表于 2016-10-5 22:09:39
195 5

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
TetrOS

   TetrOS is a small feature rich Tetris clone which is written in Assembly. It fits completely into a 512 byte boot sector as it requires only 446 bytes (which is the maximum allowed size of the first stage boot loader in the master boot record (MBR) of a drive) and is executed during the boot sequence before any operating system is loaded. Actually, it does not need any existing operating system. TetrOS is an operating system, hence the suffix OS in its name.
  Video that shows TetrOS in action:
   
Tetros: Tetris that fits into the 512 byte MBR-1 (completely,existing,sequence,Running,machine)

  And this is the complete machine code:

Tetros: Tetris that fits into the 512 byte MBR-2 (completely,existing,sequence,Running,machine)

  Running TetrOS

  There are two options to run TetrOS. Either in an emulator like qemu or via an installation of TetrOS in the boot sector of a real disk, USB stick or some other media.
  Running via qemu

   Simply run make run . This will execute qemu with the right parameters to run TetrOS. If you're using Ubuntu and qemu is not intalled on your system you can install it via sudo apt-get install qemu .
  Running via an USB stick

   First, copy the image to an USB stick. For example, if your USB stick is on /dev/sde use the following command to overwrite the first sector of the USB stick with the TetrOS image:
  sudo dd if=tetros.img of=/dev/sde
  After that you should be able to boot the stick to play TetrOS.
  Features

  
       
  • Each brick shape has a unique color.   
  • Blinking cursor is not visible.   
  • Left and right arrow to move a brick.   
  • Up arrow to rotate a brick.   
  • Down arrow to drop a brick.   
  • Game over detection. It stops if a new brick could not be placed.   
  • Selects the next brick at random via a linear congruential generator.   
  • Nice playing field.  
  Features missing due to size limits

  
       
  • Scores and highscores.   
  • Intro.   
  • Game over message and restart without rebooting.   
  • Show next brick.   
  • Increase speed.  
  Compiling the sources

   The repository already contains an image which you can use for testing. However, if you want to compile the image from the sources you need nasm, a general prupose x86 assembler to be installed on your system. On Ubuntu you can can install it via the command sudo apt-get install nasm .
   If nasm is installed you can compile the sources by executing make . This will create the image tetros.img . After that you can run the image via qemu or you can copy the image via dd on an USB disk or a disk (see above).
  I have tested it with nasm 2.11.08 on Ubuntu 16.04.
  Similar projects

  
       
  • https://github.com/dbittman/bootris   
  • https://github.com/Shikhin/tetranglix   
  • http://olivier.poudade.free.fr/src/BootChess.asm  

友荐云推荐




上一篇:Dividing React Work Between Designers and Developers
下一篇:MariaDB High Availability: Replication Manager
酷辣虫提示酷辣虫禁止发表任何与中华人民共和国法律有抵触的内容!所有内容由用户发布,并不代表酷辣虫的观点,酷辣虫无法对用户发布内容真实性提供任何的保证,请自行验证并承担风险与后果。如您有版权、违规等问题,请通过"联系我们"或"违规举报"告知我们处理。

MymasterisTS 发表于 2016-10-6 19:51:03
不要为那些不愿在你身上花费时间的人而浪费你的时间.
回复 支持 反对

使用道具 举报

終究還是敷衍 发表于 2016-10-10 03:18:01
经验之谈,谢谢心控2star了,请继续努力
回复 支持 反对

使用道具 举报

再見了人身 发表于 2016-11-8 23:23:54
楼猪V5啊
回复 支持 反对

使用道具 举报

何永豪 发表于 2016-11-11 19:18:48
楼下的小伙伴,速度跟上!
回复 支持 反对

使用道具 举报

64220305 发表于 2016-11-21 13:46:44
咨询心控2star一个非技术性问题
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读

扫码访问 @iTTTTT瑞翔 的微博
回页顶回复上一篇下一篇回列表手机版
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )|网站地图 酷辣虫

© 2001-2017 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表