Usefull Code Snippets

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator: Moderators

Post Reply
michael
Posts: 29
Joined: Thu Nov 15, 2007 12:06 am

Usefull Code Snippets

Post by michael » Sat Jan 19, 2008 11:05 pm

Okay ive got 3 ive found that might be usefull to people..

Warm boot

Code: Select all

mov ax,40h
mov es,ax
mov ax,0
mov [es:72h],ax
Turn off floppy drive motors

Code: Select all

mov dx,3F2h
mov al,0
out dx,al

Switch to 256 colour mode (320x200)

This part is 16 bit ONLY
mov ah, 00h
mov al, 13h
int 10h

And then write to 0xA0000 , a 320x200 array of bytes, each representing the colour of each pixel

gzaloprgm
Posts: 15
Joined: Fri Jan 18, 2008 10:42 pm

Post by gzaloprgm » Sat Jan 19, 2008 11:13 pm

Thanks, I'll probably use the warm reboot in my next os.

Also, the

Code: Select all

mov ah, 00h
mov al, 13h
int 10h 
can be simplified using

Code: Select all

mov ax, 13h
int 10h

Post Reply