Minecraft

October 31, 2009

Minecraft is a multiplayer cooperative building game. In Minecraft you can build anything you want by adding and removing blocks of which there are a number of different styles, currently the game is in active development so there will be many changes coming in the future including additional game modes.

Minecraft Blocks
- Some of the blocks you can use in Minecraft.

Minecraft is free to play however by paying for it (~£10) you get access to a few other features such as custom skins, survival mode and probably much more in future. Overall MC is a pretty good game that still needs some work done to it.

The Good

  • Easy to play and fun
  • Java based so you can play it anywhere
  • Good community

The Bad

  • Still being worked on
  • Low resolution graphics and no full screen support
  • Limited music and SFX

My Rating: 75 / 100


Haven & Hearth

October 21, 2009

Haven & Hearth or HnH is a free online RPG that allows you to build your own farm and craft items which you can trade with other players for items you need, you can also claim your own plot of land in the game world, hunt animals, or a variety of other things.

Building a farm in HnH is pretty simple, you start off in the game with a few basic skills that allow you construct simple objects suck as baskets, constructing these or doing a number of other things earns you Learning Points (LP) which you can use to buy skills or improve your stats.

The Good

  • Decent graphics
  • Excellent gameplay
  • No pointless leveling system
  • Free

The Bad

  • Some bugs
  • Not many players (about 40 average)
  • Very little in the way of music and limited sfx

Here is a nice video of some of the gameplay:


Boot Loader

October 17, 2009

I’ve been busy writing my own boot loader for the past few days, it’s really quite simple to make a basic boot loader so I’m going to explain it a bit here.
What is a boot loader
A boot loader is a very small program (512 bytes) that is loaded by the BIOS when you turn on your computer, boot loaders can be placed on many forms of media, such as, hard drive disk, floppy disk, CD/DVD-ROM, flash memory and others.
The job of the boot loader is, in the most basic form, is the loading the kernel of whatever operating system you are using, such as Windows or Linux, more advanced boot loaders can do other stuff to prepare the system such as switching into Protected Memory mode.

While a very basic boot loader is very simple to make, in general you need to do a lot of work to make something that is functional, for example the size of the initial boot loader is extremely limited, 510 bytes is very very little space to work in so most of the code in this part is designed to load a additional boot loader in higher memory.
When the computer first boots it is placed in Real Mode, in this mode you can only use the 8 and 16 bit registers and you can only address memory up to the 1MB mark, so kernels larger that 1MB need to be loaded by using UnReal mode which allows access above the 1MB mark while not fully switching into Protected Mode.
Code Example

org 0x7C00
jmp 0x0:_start
_start:
push cs
pop ds
cli
hlt
times 510-($-$$) db 0
dw 0xAA55

org 0×0000

This is the code origin, the actual bootloader is loaded by the BIOS at 0x7C00 however the BIOS can place the address as 0×0000:7C00 or 0x07C0:0×0000 (CS:IP), the org 0x7C00 ensures IP = 0x7C00

jmp 0×0000:_start

This jumps to the _start label while also making sure CS = 0×0000

push cs
pop ds

This is just to make sure CS and DS are equal

cli
hlt

Disables interrupts and halts the processor, you would normally place your boot loader code before this.

times 510-($-$$) db 0

This zeros the remaining bytes up to the 510th byte.

dw 0xAA55

Boot signature, this two byte code at bytes 511 and 512 tells the BIOS that there is a boot loader and it should load the code into memory.

To compile and write the boot loader do the following:

nasm loader.asm -o loader.bin
dd if=loader.bin of=/dev/fd0 bs=512

Replace /dev/fd0 with the device you want to write to.


Assembly

October 15, 2009

Today has been quite a busy day, I’ve been playing around with the GNU AS assembler, it took me quite a while to figure it out as I’m not used to the AT&T syntax. Personally I prefer the Intel syntax over AT&T, but as the AT&T syntax is used in C inline it’s well worth learning.

Here is a simple ‘Hello World’ program written for GAS and Linux

.text
.global _start
_start:
nop # Breakpoint for GDB
movl $4,%eax
movl $1,%ebx
movl $msg,%ecx
movl $13,%edx
int $0x80
movl $0,%ebx
movl $1,%eax
int $0x80
ret
.data
msg:
.string "Hello World!\n"

EAX = 4 is the SYS_WRITE call, with EBX being STDIN, ECX being the memory address of msg, and finally EDX being the msg length.
EAX = 1 is SYS_EXIT, EBX being the return value.

Now here it is in Intel syntax using NASM, again for Linux.


section .text
global _start
_start:
nop
mov eax,0x4
mov ebx,0x1
mov ecx,msg
mov edx,len
int 0x80
mov eax,0x1
mov ebx,0x0
int 0x80
section .data
msg db 'Hello World!',0xA
len equ $-msg

Well that’s all for now, I’m going to work on a little boot loader now.


Follow

Get every new post delivered to your Inbox.