Page 1 of 1

BootLoader Problem

Posted: Wed Mar 25, 2009 2:53 am
by wererabit
Hi,

I got a problem with my bootloader problem. I am trying to load a 2nd stage bootloader. However, it seems that it only works if the size of 2nd stage boot loader in less than 512. So basically it just load 1 sector. I couldnt find where it goes wrong, maybe you could help out.

Re: BootLoader Problem

Posted: Wed Mar 25, 2009 5:58 am
by sebihepp
Hi,

I see one mistake:

Code: Select all

   .EVEN_CLUSTER:	

	add dx, 0000111111111111b			 ; remove the top 4 bits (significant)
	jmp .NEXT_CLUSTER
Use "and" instead of "add".

Greetings Sebihepp

Re: BootLoader Problem

Posted: Wed Mar 25, 2009 9:03 am
by Firestryke31
Just from seeing that I can offer a quick and simple optimization:

Code: Select all

.EVEN_CLUSTER:
;; remove top four bits by shifting them out
  shl dx, 4
;; fall through to the odd cluster code, which
;; unshifts the above and by itself handles
;; the odd clusters. Saves a jump!
.ODD_CLUSTER:
  shr dx, 4

Re: BootLoader Problem

Posted: Wed Mar 25, 2009 2:33 pm
by wererabit
thanks so much guy, will try it at home