14 May 2010, 08:09 | #1 |
(2b)||!(2b)
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
|
Coding a bootblock
Last night I disassembled the bootblock from one of my prods and kinda got the coding bug back.
I've forgotten so much! Just modified an XCopy bootblock (more text, slightly larger copperlist) and now it's ready to test on a bootblock but I'm having a bit of a problem. I've assembled to disk with all debug info off. Using TrackDOS to write the bootblock to disk (it calculates the checksum) skipping the first 32 bytes it seems to write the bootblock OK but it doesn't boot. I can't remember if I have to assemble as position dependent or absolute? Tried hunting in Google for a decent tutorial to revive the grey matter but I can't find anything! |
14 May 2010, 08:37 | #2 |
Registered User
Join Date: Jun 2008
Location: somewhere else
Posts: 525
|
The ROM just does an AllocMem in public memory, loads, checks and runs the bootblock directly if it's valid, so it have to be relocatable or you'll have to copy it manually at a suitable address (probably in chipmem if you've got a copperlist etc), a4 contains the address of the first byte of the code, a1 the trackdisk device and a6 contains execbase.
|
14 May 2010, 09:43 | #3 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Hey there Yesideez
You should definitely get back to coding. There's lots of stuff about a bootblocks in relation to a bootblock trackloader I made here: http://eab.abime.net/showthread.php?t=45654 there's some source codes in that thread I think... I use AsmOne to write code to bootblocks as required. Hope that helps. |
14 May 2010, 09:51 | #4 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Quote:
Just use ASM-One's "WS" (W.rite S.ector) command to write the bootblock followed by CC (C.alculate C.hecksum) which will calculate the bootblock checksum (which is required as otherwise the disk won't boot). Example: BOOT: dc.l "DOS"<<8 dc.l 0 dc.l 0 START: moveq #0,d0 ... To write this code to disk with ASM-One you'd use: WS RAM PTR>BOOT DISK PTR>0 LENGTH>2 ASM-One will now write the bootblock and then you'd just use CC to calculate the checksum and the disk will boot. Your code should be position independent as that's shorter. |
|
14 May 2010, 09:57 | #5 |
(2b)||!(2b)
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
|
Thanks for the replies.
I've found a bootblock writing tool I coded years and years ago so I've been using that. The reason for skipping the first 32 bytes is... Code:
dc.b 'dos',0 dc.l 0,$370 I'm using DevPac to write the code and my little tool bwrite to write to disk calculating the checksum as it goes. It assembles fine. If I comment out the first three longwords and add "move.l 4.w,a6" at the start and run my copperlist views perfectly fine but it doesn't work when applied as a bootblock. All I'm using is a ReSourced X-Copy bootblock which has been modified very slightly. Starting to pull hair out... |
14 May 2010, 10:03 | #6 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,865
|
Quote:
Also: Code:
dc.b 'dos',0 dc.l 0,$370 What does "doesn't work" mean here? Disk doesn't even boot or just no display/black screen? |
|
14 May 2010, 10:36 | #7 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
You're right Sting - Devpac won't write binary... Again Yesideez, AsmOne is your friend for that.
|
14 May 2010, 10:40 | #8 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
devpac should be able to output binary.
I'm sure it's in the options! |
14 May 2010, 11:17 | #9 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
@ bippym - if you find it, let me know cos I never have but would be happy if I could.
|
14 May 2010, 12:00 | #10 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
i'll look when my pc is back up and running. It's dead atm and i am stuck on a laptop.. Oh i'll reply to your email soon too bloody work has been hectic
|
14 May 2010, 13:02 | #11 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Sorry to hear about your PC...
Quote:
|
|
14 May 2010, 17:46 | #12 |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 43
Posts: 2,351
|
|
14 May 2010, 17:55 | #13 |
(2b)||!(2b)
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
|
Topic matter seems to have changed somewhat.
No need for me to relocate to another assembler, DevPac does me just fine. Doesn't matter if it doesn't create binary files because I have a little tool I wrote a long time ago to write the files to disk for me that takes care of everything. I assemble to disk, write the file and job done. I've got to the bottom of the problem - slightly mistake on my part. I set the bootpri of the hard drive too high as it was set to 5 instead of 0 so the floppy driver never got a look in. Turns out my bootblock works perfectly fine! @StingRay: The 'dos' thing was me typing when tired - I always use 'DOS' |
14 May 2010, 18:06 | #14 | |
(2b)||!(2b)
Join Date: Mar 2007
Location: Cranbrook, Devon, UK
Age: 50
Posts: 241
|
Quote:
I would attach it here or upload to The Zone but I can't figure out how to copy it to PC without it corrupting but you can download it from Aminet. http://aminet.net/search?query=ztls In that download you'll also find NewZAP - both tools were "fixed" by me to look right on Workbench 2+. I believe my BWrite tool is there (CLI & GUI versions as well as a BootKit for managing bootblocks) |
|
15 May 2010, 10:27 | #15 |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 43
Posts: 2,351
|
Thanks man I'm something of a dinosaur and always do everything long hand - including the longword at the end of the exe Devpac does me just fine too
|
23 May 2010, 00:13 | #16 |
Registered User
Join Date: May 2005
Location: Cheshire, UK
Age: 56
Posts: 322
|
I used to just load the exe (no matter what the assembler was) into Rossi Mon (either use relative code or fix it) and Rossi Mon can calc the checksum and write out the memory to disk blocks. Easy as that.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
bootblock | mai | support.Apps | 7 | 25 September 2012 11:28 |
Anyone like to help understanding this bootblock ??? | Joe Maroni | Coders. Tutorials | 2 | 15 February 2007 17:33 |
XCopy2 No virus Bootblock. | redblade | Coders. General | 3 | 08 May 2006 02:09 |
Bootblock checksum | -Rob- | Coders. General | 5 | 17 April 2006 15:49 |
ADF Bootblock installer | jjsmith | Coders. General | 6 | 30 November 2005 01:36 |
|
|