Bootstrap and boot blocks

Everything about programming, including VDP and Sound programming.
Post Reply
User avatar
Dave
Posts: 1278
Joined: 11 Aug 2012 18:16
Contact:

Re: Bootstrap and boot blocks

Post by Dave »

EtchedPixels wrote: 29 Jun 2019 21:56
@Dave: Mem and Swap blocks are 1Kbyte
Thanks Alan, I seem to be missing some memory.

On boot, my system shows 384k Total RAM, with 336k "available to processes"

I have a 64K MTX with one of Andy's memory cards installed. With the 64-512 PROM installed on the memory card and all jumpers set, there should be a total of 448k available, is the 384k reported by Fuzix a limit, or is the "missing" 64k reserved for something, perhaps, the kernel? Or is there some other limit in play?

regards
Dave
EtchedPixels
Posts: 31
Joined: 07 Feb 2019 01:12

Re: Bootstrap and boot blocks

Post by EtchedPixels »

Dave wrote: 30 Jun 2019 11:15
EtchedPixels wrote: 29 Jun 2019 21:56
@Dave: Mem and Swap blocks are 1Kbyte
Thanks Alan, I seem to be missing some memory.

On boot, my system shows 384k Total RAM, with 336k "available to processes"

I have a 64K MTX with one of Andy's memory cards installed. With the 64-512 PROM installed on the memory card and all jumpers set, there should be a total of 448k available, is the 384k reported by Fuzix a limit, or is the "missing" 64k reserved for something, perhaps, the kernel? Or is there some other limit in play?

regards
Dave
It should always report the true amount of memory available anyway. What the code does is to go through each setting from 0x80 to 0x8F and check if it can play with 0xBFFF until it finds a 48K that fails.

The kernel has the 64K taken from the 384K (ie there is 336K for user programs)


I think I have an off by one and some other oddments to look at there.

Alan
Martin A
Posts: 797
Joined: 09 Nov 2013 21:03

Re: Bootstrap and boot blocks

Post by Martin A »

I've finished wiring up a memory expansion with a full complement of RAM available in CPM mode. Which means Fuzix is now booting on my MTX512 :) There's none of the display issues seen on the MTXplus either.
Fuzix booting.jpg
Fuzix booting.jpg (526.45 KiB) Viewed 12793 times
It's only reporting 15 memory banks, so is seeing 720k, of which 672k is available for processes
free space.jpg
free space.jpg (359.37 KiB) Viewed 12793 times
The board has 2 512 SRAM chips on it, and a 22V10CPLD to map them in around the existing 64k. In the end, the most complex term, for the lower ram chip select, only needed 8 terms, so the logic would fit a 16V8
2 512k SRAMs.jpg
2 512k SRAMs.jpg (469.89 KiB) Viewed 12793 times
Eventually, I intend to add the CFX interface to the board too so there's extra hardware already in place, but that's not important here...
NB It makes 512k available for basic too
512k in basic too.jpg
512k in basic too.jpg (489.15 KiB) Viewed 12793 times
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: Bootstrap and boot blocks

Post by Bill B »

I am trying to make the CFX-II image work in MEMU.

At present it is failing because it thinks LBA addressing is not supported :( LBA is actually the only addressing mode currently supported by the emulation.
MEMU_Fuzix.png
MEMU_Fuzix.png (12.23 KiB) Viewed 12784 times
The CF emulation in MEMU is currently very minimal (just sufficient to support Martin's code). I know that the last thing Fuzix does before halting is to issue an "Identify" command. I am trying to work out what is the minimum amount of meaningful data I have to return in order to pass this test.

At present I have:

Code: Select all

static byte sector[LEN_SECTOR];
   :
   :
                    case CMD_IDENTIFY:
                        {
                        int nlb;
                        int card = 0;
                        if ( lbatop & LTOP_CARD ) card = 1;
                        nlb = (int) ( nCFSize[card] / LEN_SECTOR );
                        diag_message (DIAG_SDXFDC_HW, "CFX2 command: Identify");
                        command = value;
                        memset (sector, 0, LEN_SECTOR);
                        sector[99] = 0x02;
                        sector[120] = nlb & 0xFF;
                        sector[121] = ( nlb >> 8 ) & 0xFF;
                        sector[122] = ( nlb >> 16 ) & 0xFF;
                        sector[123] = ( nlb >> 24 ) & 0xFF;
                        count = 1;
                        addr = 0;
                        status |= STA_DRQ;
                        break;
                        }
I had a quick look through the code on GitHub, but was unable to identify where the test is performed
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: Bootstrap and boot blocks

Post by Bill B »

Stupidity in emulation of Identify command found :oops:

CFX Fuzix now running on MEMU :)
MEMU_Fuzix_2.png
MEMU_Fuzix_2.png (10.34 KiB) Viewed 12768 times
User avatar
Dave
Posts: 1278
Joined: 11 Aug 2012 18:16
Contact:

Re: Bootstrap and boot blocks

Post by Dave »

Hi Bill,

That’s neat!

How is it done?
Are there any changes in MEMU?
How did you get from Alan’s image file to a “special” CF image for MENU, or is it unchanged?

Regards
Dave
Martin A
Posts: 797
Joined: 09 Nov 2013 21:03

Re: Bootstrap and boot blocks

Post by Martin A »

Bill B wrote: 09 Jul 2019 09:25 CFX Fuzix now running on MEMU :)
Nice one!
Bill B
Posts: 590
Joined: 26 Jan 2014 16:31

Re: Bootstrap and boot blocks

Post by Bill B »

Dave,

Some changes to MEMU:
  • Mods to allow mounting Alan's image as an image of the whole card rather than just one CP/M partition.
  • As reported, fixes to the emulation of the CF Identify command.
I was just merging together these changes (done on Linux) with the Windows version to send to you, when I ran across an unrelated bug in the Windows version of memu-cfg.

Very frustrating: I know where it is failing, and what is failing, just not why :cry:

It is related to the Windows version of MEMU using two threads, one for the main MEMU code and a separate UI one to update the windows. It almost looks as though the UI thread is crashing for some reason.
User avatar
Dave
Posts: 1278
Joined: 11 Aug 2012 18:16
Contact:

Re: Bootstrap and boot blocks

Post by Dave »

Hi Bill,

thanks a lot, I'll look forward to getting it in due course :)

I'm sure you'll get to the bottom of the bug before too long

regards
Dave
EtchedPixels
Posts: 31
Joined: 07 Feb 2019 01:12

Re: Bootstrap and boot blocks

Post by EtchedPixels »

The VDP: ??? is a bit odd - is that repeatable and just a bug in your memu or something else I wonder. With the real machine it seems to detect reliably and also with the older Memu I am running ?

I've updated the image again. It now tries to do a few other things like detect and use the MTXplus turbo, and if miracles happen the RTC might work on MTXplus too 8)
Post Reply