BootLoader Problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
wererabit
Posts: 11
Joined: Tue Feb 24, 2009 2:04 pm

BootLoader Problem

Post 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.
Attachments
Boot4.zip
(3.96 KiB) Downloaded 82 times
sebihepp
Member
Member
Posts: 195
Joined: Tue Aug 26, 2008 11:24 am
GitHub: https://github.com/sebihepp

Re: BootLoader Problem

Post 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
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: BootLoader Problem

Post 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
Last edited by Firestryke31 on Wed Mar 25, 2009 3:01 pm, edited 1 time in total.
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
wererabit
Posts: 11
Joined: Tue Feb 24, 2009 2:04 pm

Re: BootLoader Problem

Post by wererabit »

thanks so much guy, will try it at home
Post Reply