Code Monkey home page Code Monkey logo

toyos's Introduction

image

FREE Reverse Engineering Self-Study Course HERE


ToyOS

ToyOS is a simple x86 OS that only accepts numeric values into the input stream and returns them to a standard out console.

STEP 1: Code

mov bp, 0xffff						; set the stack base
mov sp, bp						; set the top of the stack to base

call set_video_mode
call get_char_input

jmp $

set_video_mode:
	mov al, 0x03					; 80x25 8x8 640x200 16 gray
	mov ah 0x00
	int 0x10
	ret

get_char_input:						    
	xor ah, ah                  			; wait for a numeric char
	int 0x16            
	cmp al, 0x30					; compare if numeric 0
	jl get_char_input				; jmp if less than and restart loop
	cmp al, 0x39					; compare if numeric 9
	jg get_char_input				; jmp if greater than and restart loop
	mov ah, 0x0e
	int 0x10
	jmp get_char_input				; re-start internal subroutine

times 0x1fe-($-$$) db 0
dw 0xaa55

STEP 2: Run

sudo apt-get install nasm
sudo apt-get install qemu-system-x86_64
nasm bootsector.asm -f bin -o bootsector.bin
qemu-system-x86_64 bootsector.bin

License

Apache License, Version 2.0

toyos's People

Contributors

mytechnotalent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.