Yes, I'll have a go at that with one change at a time. All this talk of pulls, branches, forks, sounds like whoever devised it was a keen gardener!
A couple of things in the meantime...
I was hindered a bit yesterday as the debug kernel doesn't seem to be working. ADFS never mounts and eventually times out with "Drive not ready" and the serial debug goes into a fairly slow loop of "Unable to open LUN file" type messages. Can anybody see if they can get the debug kernel working from the latest master?
Secondly - although this may not matter so much now as I think I have got 22 and 24 byte .dsc files working - when I have a file open, how can I get the length of the file? This bit from filesystem.c will open a LUN's descriptor file:
FIL fileObject;
// Check if the LUN descriptor file (.dsc) is present
sprintf(fileName, "/BeebSCSI%d/scsi%d.dsc", filesystemState.lunDirectory, lunNumber);
if (debugFlag_filesystem) debugStringInt16_P(PSTR("File system: filesystemCheckLunImage(): Checking for (.dsc) LUN descriptor "), (uint16_t)lunNumber, 1);
fsResult = f_open(&fileObject, fileName, FA_READ);
How then do I get the length of the file into a variable? This suggested itself to me on a search, but I couldn't adapt it to work with the existing file opening code:
BeebMaster wrote: ↑Mon Jul 18, 2022 3:49 pm
Can anybody see if they can get the debug kernel working from the latest master?
I can try, once the Beeb-Room has dropped a couple of degrees.
BeebMaster wrote: ↑Mon Jul 18, 2022 3:49 pm
Secondly - although this may not matter so much now as I think I have got 22 and 24 byte .dsc files working - when I have a file open, how can I get the length of the file?
The BeebSCSI code uses the FATFS library to access files on the SD Card. The f_stat function will give you the size of a file in bytes:
Strange. My commit id 380d686 appears to work. I've just pushed a very minor change to arm-start.S which also appears to work for me. I've test PizeroW and Pizero2W. Are you both using the Pi firmware from the firmware directory ?
dp11 wrote: ↑Mon Jul 18, 2022 5:46 pm
Strange. My commit id 380d686 appears to work. I've just pushed a very minor change to arm-start.S which also appears to work for me. I've test PizeroW and Pizero2W. Are you both using the Pi firmware from the firmware directory ?
No, we are both building our own kernels.
I suspect what's happening here is there is a buffer somewhere that needs to be zero'd, and as of this commit no longer is. And the inconsistent results is down to compiler version we are each using.
dp11 wrote: ↑Mon Jul 18, 2022 5:11 pm
Did you build the debug version ?
configure_rpi.sh -DDEBUG=1
make
Ah. No. Just used release.sh and then re-instated the debug line in config.txt. Doing the above doesn't seem to work either, so it must be what Hoglet said.
In view of my muddying the waters on an earlier occasion concerning the versions of ARM/GCC/AA/RAC/BBC/ITV I am running, I decline to comment further.
release.sh is fine just builds four kernels. So build is over four times longer. Using configure once and make when you make changes is significantly quicker.
dp11 wrote: ↑Wed Jul 20, 2022 11:56 pm
Could you possibly do it as two separate requests ( one for each fix).
So what's most important here is each fix is a seperate commit, which is the case here. That really helps when bisecting to find a bug. It also makes it easy to revert a change. It should go without saying that no commit should break the build, because that makes bisecting a real pain.
I'm interested in what you see as the benefit of seperate pull requests? Once merged, the end result is the same.
It's well worth learning how to merge manually using the git command-line, rather than by pushing buttons on github. Then you don't even need a pull request to be able to incorporate commits from a remote repository. And you can merge/test them one at a time if that's what you want to do.
I wonder if git best practice would be a good topic for discussion at tonight's ABUG Dev Night? I'm far from an expert (and especially hate merge conflicts) but I've been actively using it for 14 years now, so I know it pretty well. Even if you are the only person working on a private projest, there are very good reasons for using source code control like git.
I think I did it wrong at first, I made a fork, then some changes to that (the "verify forever" fix), and then made a new branch from there for the read capacity fix, then sent a pull request for that.
So probably I should have made a branch straight after my own fork before doing anything else, and have a new branch for each individual fix.
I can start again if that will sort it out.
So far these changes are independent of each other but I am not sure what will happen if I make more changes which are dependent on earlier changes.
As an observation, if you edit a file on github, in the web interface, it'll make a new branch on your fork just for that change, and once it's merged, prompts you to delete it. So, a branch (a feature branch, we might say) can be a short-lived thing, to be used for a single purpose and to be the source of a pull request, and to be deleted after it's been merged upstream.
It might well be, though, that Dave can explain his workflow which might be better than mine!
Dave, I wonder if you could start a thread on git practices? I have various links, and ideas, but here's probably not the place.
BeebMaster wrote: ↑Thu Jul 21, 2022 11:14 am
I think I did it wrong at first, I made a fork, then some changes to that (the "verify forever" fix), and then made a new branch from there for the read capacity fix, then sent a pull request for that.
So probably I should have made a branch straight after my own fork before doing anything else, and have a new branch for each individual fix.
I can start again if that will sort it out.
So far these changes are independent of each other but I am not sure what will happen if I make more changes which are dependent on earlier changes.
If the change is to different files, you can go back and check out the original main/master/dev/whatever branch and then checkout individual files from your mistaken branch (e.g. "git checkout main; git checkout -b verifyfix; git checkout main -- src/editedfile.c") and then commit and push, so you don't have to necessarily throw everything away. (Of course, you could just copy the file somewhere else, or paste bits in, if you want to do it separately.)
If the changes are dependent on one another, I think it would probably be worth making separate branches for each but with the second change downstream of the first change's branch. You can then make pull requests for each branch separately. If they're to different files, then it's not an issue; if they're to different parts of the same file but can be made independently, git is pretty good about working out how to combine them.
The important thing is what sweh said: git branches are not heavyweight entire copies of the repository but just a pointer to a particular commit that can move along and references all the same files. This makes creating, rebasing, merging, destroying them all very easy and disposable. Don't be afraid of making lots of them.
I'm personally a big fan of rebasing: at work, for the past few months I've been working on a new network configuration for our border in a branch. When my colleagues make changes to the live network master branch I can just rebase my branch on top of theirs and pick up all the other changes and fix up any clashes offline. When we went live with the new border configuration I just merged the 'border' branch into 'master' to make it live (and, of course, the three of us hefting the new routers into the racks which, unfortunately, git can't do itself).
BBC Master— PiTube 3A+ PiVDU, PicoTube, Pi1MHz, MMFS, ANFS, MultiOS
BBC B — Integra ß, PiTube Zero 2W, Pi1MHz, MMFS, DFS, ADFS, ANFS
Electron — Plus 1 w/ AP6 2V2, AP5, PiTube 3A+, Pi1MHz, PRES AP3+4, Elkeconet or ATI/ABR, ElkSD 64/Plus 1
Random thought... has there been any interest in emulating BeebSID? It is already supported in one of the Beeb emulators.
Electron,+1,+3
BBC B,GoTek,Boobip 64k SRAM + 64k EEPROM,Speech, BeebSID,VideoNula,Pi Copro
BBC Master,BeebSCSI,UPUSFS,MultiOS,GoTek,DS12887 RTC,VideoNula,Pi Corpo,Mouse,MasterSD,User Port x2
A3000,GoTek,4MB,Watford IDE,CF HD
A5000 Alpha,4MB,CF HD