kickstart.a65:2498: Could not read diskmenu_c000.bin
1 error
make: *** [Makefile:48: kickstart65gs.bin] Error 1# diskmenu_c000.bin yet b0rken kickstart65gs.bin: $(KICKSTARTSRCS) Makefile diskchooser version.a65 diskmenu_c000.bin ../Ophis/bin/ophis -4 kickstart.a65 -l kickstart.list
../Ophis/bin/ophis -4 diskmenuc000.a65 -l diskmenuc000.list
diskmenuc000.a65:19: Unmatched .scope .org $c000
.scope
.include "diskmenu.a65"
.scendmake: *** No rule to make target 'ghdl_ram8x32k.vhdl', needed by 'simulate'. Stop.debugtools.vhdl:26:9:@183100ns:(assertion error): HWRITE Error: Trying to read vector with an odd (non multiple of 4) length
./cpu_test:error: NULL access dereferenced
./cpu_test:error: simulation failedSo unfortunately, still experiencing this prob on the latest code on hyperinterruptdebug branch.
Gurce
PS. If the tweaks/workarounds are worth preserving (do others experience similar probs?), then should I try commit these changes to the github repo? If the probs are unique to me and my cygwin setup, I can hold back.
commit f5f87fbf42e23a26c9119e4a1c680ac06212806d
Author: Ben-401 <-------@flinders.edu.au>
Date: Thu May 12 15:45:57 2016 +0930
--
You received this message because you are subscribed to the Google Groups "C65GS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to c65gs-developm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

MEGA65 KICKSTART V00.04
GIT COMMIT: D793FF9E9BDED8E*+DIRTY
LOOKING FOR SDCARD...
FOUND AND RESET SDCARD
MOUNTED 01 PARTITIONS
RUNNING KICKED HYPERVISOR
MEGA65.D81 SUCCESSFULLY MOUNTED
ROM CHECKSUM FAIL - LOADING ROM
LOADED CHARROM.M65 (0010 PAGES)
Hmm, that "checksum fail" line looks worrying...
I then see the c65 startup screen, but it jumps to the monitor straight away. If I try exit, it just returns to the monitor again


Ah well, it's my first time doing this bitstream stuff, so perhaps I've screwed up somewhere. I kinda thought I did everything right with the sc-card preparations, but who knows, maybe I overlooked something there too. I'll look over it all with fresher eyes tomorrow.
Oh, I also took a look at the auto-generated "iomap.txt" file, it still didn't make a mention of the $D700 for dma. There's probably some internals I need to grasp to figure out why on that one. No worries, a step at a time.
Gurce
Well done! You have almost everything working correctly.
The break to monitor thing is, if I remember correctly, a result of a subtle bug in the VFAT driver in the Hypervisor. If you look through $20000 - $3FFFF using the serial monitor interface, i.e., connecting to the 2nd serial port that the USB cable to the NExys4 purports to provide at 230400bps, you will see a simple debug/control interface for the MEGA65 that is VERY useful. Check all memory in that 128KB range, and you will probably find that there is a blank 8KB section or two -- this is a sign that the bug has happened. Solution: Delete the ROM file from the SD card. Copy some arbitrary file of at least 128KB on, then copy the ROM back on. Rinse repeat, until it works. The bug is a mis-calculation in sector numbers from cluster numbers in the VFAT code. You are welcome to debug that and fix the problem at your leisure! ;)
In kickstart.a65 you can tell it to include diskchooser instead of diskmenu. That will get you a more useful SYS49152 function, until such time as Ben and I debug the Hypervisor trap bug that is causing diskmenu to fail to detect that it is on a MEGA65 (it uses a Hypervisor trap to do so).
We can try to track down the absence of $D700 from the IOMAP.TXT file. You could search for it in the VHDL files directly as well (this is how IOMAP.TXT gets generated). It is probably just missing the @:65 or similar prefix in the comment that is used to tell the generator script which comments are IO location documentation.
Paul.
--

txt_c65gsrom: .byte "MEGA65.ROM",0,0...
loadc65rom:
ldx #<txt_c65gsrom
ldy #>txt_c65gsrom
jsr dos_setname
; Prepare 32-bit pointer for loading whole ROM ($0020000)
lda #$00
sta <dos_file_loadaddress+0
sta <dos_file_loadaddress+1
sta <dos_file_loadaddress+3
lda #$02
sta <dos_file_loadaddress+2
jsr dos_readfileintomemory
bcs loadedok--
|
--
8E2E AE F5 BC LDX $BCF5
8E31 BD C1 BC LDA $BCC1, X
8E34 18 CLC
8E35 69 02 ADC #$02
8E37 9D C1 BC STA $BCC1, X
8E3A 90 08 BCC $0044
8E3C FE C2 BC INC $BCC2, X Thanks Paul. I was wondering, if I was to add extra jsr checkpoint calls to help debug, then I'd need to re-build the bitstream. I was a little hesitant to re-do it at this stage, since my first successful build/synthesis took about 2hours to complete on my vbox.So just wondering, if my sole modification since that prior build was to tweak .a65 source files (and not .vhdl files), would the re-build/re-synthesis be any quicker? (a bit like in the c/makefile world, how "make all" will be faster than "make clean all"?). Or is vhdl-world a bit more unforgiving? :)
Awesome, the breakpoint hit :) After reading Ben's monitor docs, I learnt that the ENTER key can act as a step-instruction command, awesome.- I see kickstart restart and freeze after the line "MOUNTED 01 PARTITION"- I pressed RESTORE for 3 seconds on my USB keyboardOh wait, to answer my own question, I seem to have handled it this way.- I started up the nexys board- in remote monitor, I typed "b8e35" to set the breakpoint
Part of me is itching to write a c-app to massage the remote-monitor serial input so that shows disassembled output too (I'm guessing it'd be a waste of space to add logic like that into vhdl, as the FPGA resources can probaby be spared for better things). But maybe that'd be quite a detour/distraction from the task at hand, so I might keep the idea on the backburner for now, and just manually follow the PC alongside the .a65/.list source for now :)
--
--
GurceHi Paul,Thanks for the info, will chase these up too. I'm presently studying how to make use of the readline library within the app. Thought it might be nice to have a history of past commands and all that CTRL-R reverse-search stuff at our fingers tips too :)
Hi Paul,
Ok, I'm having a read around gs4510.vhdl at present.
I also observed there was a "dis4510.c" file in the project too, I'm wondering, if this in good working condition, maybe I can draw some copy/paste inspiration from it.
I noticed it references a "64net.opc" file to parse in the cpu opcodes, is this instruction set we need?
Gurce
--
You received this message because you are subscribed to the Google Groups "C65GS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to c65gs-development+unsubscribe@googlegroups.com.
m65dbg - v1.00 ====== - Type 'h' for help <dbg>n PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO E167 01 DB 01 08 00 01D9 82A0 B300 29 01 64 00 .VE..I... ..P 11 -00 -- $E167 M_rr:1 F0 0C BEQ $E075 <dbg> PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO E169 01 DB 01 08 00 01D9 82A0 B300 F0 0C 64 00 .VE..I... ..P 11 -00 -- $E169 M_nnnn:2 20 2D E6 JSR $E62D <dbg> PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO E62D 01 DB 01 08 00 01D7 82A0 B300 20 2D E6 64 00 .VE..I... ..P 11 -00 -- $E62D M_nnnn:2 AD 28 11 LDA $1128 <dbg> PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO E630 00 DB 01 08 00 01D7 82A0 B300 AD 28 11 66 00 .VE..IZ.. ..P 11 -00 -- $E630 M_immnn:1 89 C0 BIT #$C0 <dbg> PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO E632 00 DB 01 08 00 01D7 82A0 B300 89 C0 E6 00 NVE..IZ.. ..P 11 -00 -- $E632 M_rr:1 F0 54 BEQ $E588 <dbg> PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO E688 00 DB 01 08 00 01D7 82A0 B300 F0 54 E6 00 NVE..IZ.. ..P 11 -00 -- $E688 M_impl:0 60 RTSSomething seems a bit screwy with the relative maths of the beq call, I'll look into soon.
--
../Ophis/bin/ophis -4 kickstart.a65 -l kickstart.list -m kickstart.map
8E2B 4C 6A 96 JMP $966A | /home/vets/mega65/kickstart_dos.a65:1927 8E2E AE F5 BC LDX $BCF5 | /home/vets/mega65/kickstart_dos.a65:1932 8E31 BD C1 BC LDA $BCC1, X | /home/vets/mega65/kickstart_dos.a65:1934 8E34 18 CLC | /home/vets/mega65/kickstart_dos.a65:1935 8E35 69 02 ADC #$02 | /home/vets/mega65/kickstart_dos.a65:1936 8E37 9D C1 BC STA $BCC1, X | /home/vets/mega65/kickstart_dos.a65:1937 8E3A 90 08 BCC $0044 | /home/vets/mega65/kickstart_dos.a65:1938 8E3C FE C2 BC INC $BCC2, X | /home/vets/mega65/kickstart_dos.a65:1939 8E3F D0 03 BNE $0044 | /home/vets/mega65/kickstart_dos.a65:1940
m65dbg - v1.00 ====== - Type 'h' for help |
Loading "diskchooser.list"... Loading "diskmenuc000.list"... Loading "kickstart.list"... <dbg>dis > /home/vets/mega65/kickstart_dos.a65:1937 $8E37 M_nnnnX:2 9D C1 BC STA $BCC1,X <dbg>n PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO 8E3A 02 00 0A 00 BF BEFB 4000 3F00 9D C1 BC 24 00 ..E..I... ..P 11 -00 H- > /home/vets/mega65/kickstart_dos.a65:1938 $8E3A M_rr:1 90 08 BCC $8E44 <dbg>n PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO 8E44 02 00 0A 00 BF BEFB 4000 3F00 90 08 24 00 ..E..I... ..P 11 R00 H- > /home/vets/mega65/kickstart_dos.a65:1945 $8E44 M_nnnnX:2 FE BE BC INC $BCBE,X <dbg>n PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO 8E47 02 00 0A 00 BF BEFB 4000 3F00 FE BE BC 24 00 ..E..I... ..P 11 -00 H- > /home/vets/mega65/kickstart_dos.a65:1946 $8E47 M_nnnnX:2 BD BE BC LDA $BCBE,X <dbg>n PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO 8E4A 01 00 0A 00 BF BEFB 4000 3F00 BD BE BC 24 00 ..E..I... ..P 11 R00 H- > /home/vets/mega65/kickstart_dos.a65:1947 $8E4A M_nnnn:2 AC 04 BC LDY $BC04 |
My next step will be to try read these lines out from the file:lineno reference. Deep down inside, I'm craving something like gdb's TUI window, ie, breaking out the console-screen into two viewports, the upper viewport containing the active source (with current line highlighted, which you can scroll up and down with the arrow keys), while the lower viewport being used for the typing of the monitor commands.
My gut says it's a fair bit of elbow-grease to get something like that, so I might have to hold off on that dream for a bit :)
Gurce
Cool. Do send a pull request against my Ophis fork so that we can merge that in.An interesting forward step would be to get to the point where we can show the source code +/- 25 lines with the current line highlighted etc, together with the stack trace. That would, I think, really help to advance the rate of progress.Paul.
--
Cool, now I've got the actual source-line contents showing as you step through :)
<dbg>n PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO 8E53 01 00 00 00 BF BEFB 4000 3F00 38 A5 00 N.E..I.C. ..P 11 R00 H- > /home/vets/mega65/kickstart_dos.a65:1953 > rts $8E53 M_impl:0 60 RTS <dbg> PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO 8FD7 01 00 00 00 BF BEFD 4000 3F00 60 A5 00 N.E..I.C. ..P 11 R00 H- > /home/vets/mega65/kickstart_dos.a65:2224 > bcc drfim_eof $8FD7 M_rr:1 90 14 BCC $8FED <dbg> PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO 8FD9 01 00 00 00 BF BEFD 4000 3F00 90 14 A5 00 N.E..I.C. ..P 11 R00 H- > /home/vets/mega65/kickstart_dos.a65:2231 > inw <dos_file_loadaddress+1 $8FD9 M_nn:1 E3 1A INW $1A <dbg> PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO 8FDB 01 00 00 00 BF BEFD 4000 3F00 E3 1A A5 00 N.E..I.C. ..P 11 -00 H- > /home/vets/mega65/kickstart_dos.a65:2234 > inc dos_sectorsread $8FDB M_nnnn:2 EE A9 BC INC $BCA9 <dbg> PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO 8FDE 01 00 00 00 BF BEFD 4000 3F00 EE A9 BC 25 00 ..E..I.C. ..P 11 -00 H- > /home/vets/mega65/kickstart_dos.a65:2235 > bne drfim_sector_loop $8FDE M_rr:1 D0 D4 BNE $8FB4 |
I'll get the Ophis fork and pull-request out of the way next.
<dbg>dump bc67 :777BC67 42 4F 4F 54 4C 4F 47 4F 2E 4D 36 35 00 53 41 42 | BOOTLOGO.M65.SAB
I've added a 2nd optional parameter to act as a count of bytes:
<dbg>dump bc67 50
:777BC67 42 4F 4F 54 4C 4F 47 4F 2E 4D 36 35 00 53 41 42 | BOOTLOGO.M65.SAB
:777BC77 41 20 4D 45 4C 4F 4E 20 50 52 4F 44 55 43 54 49 | A MELON PRODUCTI
:777BC87 4F 4E 20 53 54 41 54 49 53 54 49 43 53 20 28 32 | ON STATISTICS (2
:777BC97 30 30 37 2D 32 30 31 31 29 2E 54 58 54 20 20 20 | 007-2011).TXT
:777BCA7 20 20 01 00 CB 03 00 00 CD 03 00 00 00 00 00 CD | ..............
There's a "ps" print-string command to print out null-terminated string-values.
<dbg>ps bc67 BOOTLOGO.M65
--
To unsubscribe from this group and stop receiving emails from it, send an email to c65gs-developm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "C65GS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to c65gs-developm...@googlegroups.com.
m65dbg - v1.00 ====== - Type 'h' for help Loading "diskchooser.list"...
Loading "diskchooser.map"...Loading "diskmenuc000.list"... Loading "kickstart.list"...
Loading "kickstart.map"...
<dbg>ps dos_requested_filename dos_requested_filename: BOOTLOGO.M65
--
To unsubscribe from this group and stop receiving emails from it, send an email to c65gs-developm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "C65GS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to c65gs-developm...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "C65GS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to c65gs-developm...@googlegroups.com.
<dbg>n PC A X Y Z B SP MAPL MAPH LAST-OP P P-FLAGS RGP uS IO 8FCE 00 0D 0A 0D BF BEFD 4000 3F00 EA 27 00 ..E..IZC. ..P 11 R00 H- > /home/vets/mega65/kickstart_dos.a65:2218 > 2213: bne drfim_rr1 > 2214: inw <dos_file_loadaddress+1 > 2215: drfim_rr1b: > 2216: lda $df00,x > 2217: nop ; 32-bit pointer access follows > 2218: sta (<dos_file_loadaddress),z > 2219: inz > 2220: inx > 2221: bne drfim_rr1b > 2222: > 2223: jsr dos_file_advance_to_next_sector $8FCE M_nnnnY:2 92 19 1B STA ($19),Z