BBC - can somebody explain the rationale around using a separate SD card?

Time to talk about what other machines can run on the Next hardware!
Camel
Posts: 37
Joined: Thu Feb 27, 2020 8:59 pm

BBC - can somebody explain the rationale around using a separate SD card?

Postby Camel » Tue Mar 17, 2020 4:42 pm

In the notes for the BBC core, the recommendation is to use a separate SD card as the MMB file needs to be one of the first 16 files on the card.

https://github.com/hoglet67/BeebFpga/wi ... ile-system

Would a second SD card not still need the same Spectrum Next files on though? What is the advantage of using another card? Or is the idea that you swap SD cards once the Beeb core is running? Can you swap SD cards while the Spectrum Next is on?

Thanks.

biged
Posts: 9
Joined: Fri Dec 08, 2017 11:33 am

Re: BBC - can somebody explain the rationale around using a separate SD card?

Postby biged » Tue Mar 17, 2020 4:55 pm

As you note, there's no necessity to use a separate card, but out of two different kinds of minor inconvenience it might be the better choice. That's a judgement, which depends on how you view the various steps.

With a single card, to get the MMB file into the first few slots, you pretty much have to format the card, add your MMB file, then unpack the Next distribution. Then you're good to go.

With two cards, you can leave your Next distribution exactly as it is, which may feel a bit safer and easier. You'll use that to boot the Next and swap into the Beeb core with a REG command or short Basic program. Then, with the Beeb core running, you insert your favourite MMB-containing card and do your Beeb things. When you want to swap back to Spectrum-like cores, you'll need the Next card back in.

(If the FAT-reading code on the Beeb, the MMFS, had room for a little more generality so it could find and read the MMB file in all cases, this would be easier. But that's extra complexity, which needs time and energy, and space in the ROM. It's long been an idea for improvement. If the official Next SD card shipped with an MMB file already in the first few slots, that would also be great, but would require some time travel.)

User avatar
SevenFFF
Posts: 565
Joined: Mon Jun 05, 2017 5:30 pm
Location: USA

Re: BBC - can somebody explain the rationale around using a separate SD card?

Postby SevenFFF » Tue Mar 17, 2020 4:59 pm

It's because the FAT code in the core is a cutdown/simplified version, and it only looks at the first few contiguous sectors in the disk. It's not in the control of the Next team. That's a choice made by the people who wrote the BBC core. In principle it could be changed, but they have limited space to work with to store the code inside the FPGA or FLASH memory, so it might not be possible to change without completely changing the way the core works.

From the start, the Next team tried to develop their core so as little as possible of the critical code was stored inside the FPGA and FLASH. This allows more flexibility in dealing with situations like this. Even so, people complain that the Next needs an SD card at all, as they are used to dealing with other machines and cores that store everything in the FPGA and FLASH.

There are some restrictions even in the Next core though - the TBBLUE.TBU and TBBLUE.FW are in the root of the card precisely because the initial boot code doesn't have access to subdirectories due to the compact nature of the code. We think that in the future it might be possible to micro-optimise the FAT code to allow more functionality in the same space.

/edit oops, crossed with BigEd's reply.
Last edited by SevenFFF on Tue Mar 17, 2020 5:09 pm, edited 5 times in total.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins

User avatar
SevenFFF
Posts: 565
Joined: Mon Jun 05, 2017 5:30 pm
Location: USA

Re: BBC - can somebody explain the rationale around using a separate SD card?

Postby SevenFFF » Tue Mar 17, 2020 5:05 pm

It's worth noting that you only need to prep your card once to get it to be beeb-friendly and Next-friendly. The MMB files is a fixed size, so once it has been copied into place as the first file on the card, it will continue to occupy those unfragmented first few blocks. We've had a fair few people reformat their cards already anyway, so it's not necessarily a huge ask for people who are already adventurous enough to explore alternate cores.

The official guidelines for alternate Next cores will encourage core devs to store as many files as possible inside machines/<YourCoreName>, and over time a common infrastructure will be developed (for example a micro OSD component that can be included in core designs for a common file selection experience). But they also recognise that some things have hard limitations that aren't easy to change, such as the initial boot file needing to be in the root of the card because simplified FAT code is used.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins

Camel
Posts: 37
Joined: Thu Feb 27, 2020 8:59 pm

Re: BBC - can somebody explain the rationale around using a separate SD card?

Postby Camel » Tue Mar 17, 2020 5:22 pm

Thanks for the replies. I'm in no way criticising the need for the file to be in a particular part of the card; just confused about how a second card would help. So I can safely remove the SD card and insert another with the Next running?

biged
Posts: 9
Joined: Fri Dec 08, 2017 11:33 am

Re: BBC - can somebody explain the rationale around using a separate SD card?

Postby biged » Tue Mar 17, 2020 5:25 pm

Yes, I think that's the idea, although I haven't tried the two-card shuffle myself.

User avatar
SevenFFF
Posts: 565
Joined: Mon Jun 05, 2017 5:30 pm
Location: USA

Re: BBC - can somebody explain the rationale around using a separate SD card?

Postby SevenFFF » Tue Mar 17, 2020 6:11 pm

I want to try the two-card shuffle myself now! I am looking forward to trying hoglet's core soon. I used to use it on my Uno although I haven't for quite a while.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins

chris
Posts: 93
Joined: Tue May 30, 2017 9:28 am
Contact:

Re: BBC - can somebody explain the rationale around using a separate SD card?

Postby chris » Wed Mar 18, 2020 9:55 am

biged wrote:
Tue Mar 17, 2020 5:25 pm
Yes, I think that's the idea, although I haven't tried the two-card shuffle myself.
The Next tends to get quite upset when the SD card is removed. In Next mode it notices even if you don't do anything between removal and reinsertion, and it has to be remounted. I was playing with the new Intellivision core yesterday, trying to get it to load something, and as a result I was shuffling the card back and forth adding games to it. Every time it was removed I had to completely power off the Next and then boot back into the core to get it to read the card again (even "Reset Intellivision" didn't work). I haven't tried this in BBC mode, but, I'd be (pleasantly) surprised if it works.

biged
Posts: 9
Joined: Fri Dec 08, 2017 11:33 am

Re: BBC - can somebody explain the rationale around using a separate SD card?

Postby biged » Thu Mar 19, 2020 1:34 pm

chris wrote:
Wed Mar 18, 2020 9:55 am
biged wrote:
Tue Mar 17, 2020 5:25 pm
Yes, I think that's the idea, although I haven't tried the two-card shuffle myself.
The Next tends to get quite upset when the SD card is removed. In Next mode it notices even if you don't do anything between removal and reinsertion, and it has to be remounted. I was playing with the new Intellivision core yesterday, trying to get it to load something, and as a result I was shuffling the card back and forth adding games to it. Every time it was removed I had to completely power off the Next and then boot back into the core to get it to read the card again (even "Reset Intellivision" didn't work). I haven't tried this in BBC mode, but, I'd be (pleasantly) surprised if it works.
Thanks Chris, interesting observation. All might be well though: I think one would normally switch to the Beeb with the Next card still in place. Then the card-swapping would happen within the world of Beeb, where I believe it's fine, and normal. One would put the Next card back in before switching back to the Next core.

I say all this without trying it - Dave has my Next on loan, so he can pursue this adventure of building the Beeb core. He tells me that if the Beeb running MMFS boots with the Next card in, without an MMB file, you'll see an "Image not found!" error. And also: "Hot-swapping SD cards in the Beeb Core should be OK, as long as you do a Ctrl-BREAK afterwards (Ctrl-GRAPH on the membrane keyboard). If you don't do a Ctrl-BREAK, you get a Wrong card! error."

User avatar
SevenFFF
Posts: 565
Joined: Mon Jun 05, 2017 5:30 pm
Location: USA

Re: BBC - can somebody explain the rationale around using a separate SD card?

Postby SevenFFF » Thu Mar 19, 2020 2:18 pm

Yes, that should be fine.

The reason the Next gets upset is that NextZXOS pages ROM overlays in from SD card during normal operation. the 64KB +3 ROM space and the allotted Multiface/DivMMC RAM banks are not nearly enough space for all that new functionality, sadly ;)

The classic Spectrum personalities don't do this, only the Next personality does. And of course alternate cores probably don't either.

The classic personalities use esxDOS, which has a remount feature (you hold SPACE down while doing a soft reset). Remounting in NextZXOS is done from the browser itself, by pressing the M key.

Having tried reformatting my card and copying on BEEB.MMB first, it's really not that difficult, and you should only ever need to do it once. I tend to think it will be easier in the long run than running with two cards. Particularly when we get the new multicore menu system released, and people will be able to configure booting straight into alt cores like BeebFPGA.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins


Who is online

Users browsing this forum: No registered users and 2 guests