2021-08-02.log

- RobDangerous (QUIT: Ping timeout: 272 seconds) (~Thunderbi@p200300ec8f3e1c00b9351d3d111d691f.dip0.t-ipconnect.de)00:35
_BnuJust remember that you also need an LSEG loader if you're going to do it on the 68k side.00:40
_BnuOtherwise you can never really boot from anything but DOS0/1 partitions00:40
_Bnu(And the file sytems also need to be relocated after allocating memoyr for them and loading them.)00:41
mntmnblergh01:10
_BnuBut that's why I sent over the ancient Apollo (not that one) boot ROM sources.01:13
_BnuThey have all this stuff, including code how to properly set up a DosNode and Enqueue it and schtonks.01:14
_BnuI just can't read much of the code, so I only picked out the parts I could understand.01:15
mntmnok cool i will need to log into discords tomorrow01:16
mntmni made a bunch of progress of remembering and refamiliarizing today01:17
mntmnit's baffling that all kind of disk expansion vendors must have written all this redundant code 01:17
mntmnand super baffling that you can't just call into kickstart for these things01:18
_BnuWhy would anyone want to use anything but scsi.device, anyway... it is superior...01:20
_BnuTechnically, you're choosing to rewrite all this redundant code again, hahah. So that's probably what everyone did, since they got paid for it anyway.01:21
_BnuI had no motivation to do such things, so I did it... my waaaay.01:21
mntmnfascinating 02:08
mntmnalso i just watched the ds9 episode where quark and his brother and nephew are the aliens from roswell02:08
_BnuAnd then they are attacked by barbarians.02:22
- xet7 (QUIT: Remote host closed the connection) (~xet7@user/xet7)05:36
+ xet7 (~xet7@user/xet7)05:37
- xet7 (QUIT: Remote host closed the connection) (~xet7@user/xet7)05:55
+ xet7 (~xet7@user/xet7)05:56
+ RobDangerous (~Thunderbi@p200300ec8f3e1c00e588fff41585aac2.dip0.t-ipconnect.de)08:32
+ isoriano (~isoriano@5.147.209.166)11:41
+ isoriano_ (~isoriano@5.147.209.166)11:41
isoriano_Terve :-)11:48
mntmn> Happy end at file position = 285214:49
mntmni added some serial print debug functions to zz9000 firmware15:15
mntmnso i can poke characters to card base + 0xf0 and get them over the zz9000 uart15:17
mntmnor a word to 0xf2 and get that printed as hex 15:17
pasikthose sound useful :)15:21
mntmnespecially during diag/boot time...15:26
_BnuWhat I did was add a bunch of "debug registers" to the PiSCSI portion.15:56
_BnuAnd have it print debug messages based on a message code and the data I had written to it, like longwords, words and crap...15:56
_BnuBecause kprintf had a tendency to corrupt random memory if I wasn't careful.15:57
mntmnah oh http://68k.hax.com/SWAP16:22
mntmn_Bnu: yeah, so that's similar, just a bit more minimal on my end16:23
mntmn(so far)16:23
mntmnit's even kind of working...16:37
_BnuI am the king of working.17:30
mntmnthe wor-king17:59
Claudeis the a ammx swap too? swaps 2 times in one clock cycle ? 18:14
mntmnwat wat?18:33
mntmnin any case, the hunk parser seems to do the right thing...18:33
mntmnaccording to my tracing of it18:33
+ RobDangerous1 (~Thunderbi@p200300ec8f3e1c00e588fff41585aac2.dip0.t-ipconnect.de)19:12
- RobDangerous (QUIT: Ping timeout: 272 seconds) (~Thunderbi@p200300ec8f3e1c00e588fff41585aac2.dip0.t-ipconnect.de)19:13
* RobDangerous1 -> RobDangerous19:13
- isoriano_ (QUIT: Quit: Leaving) (~isoriano@5.147.209.166)19:16
- isoriano (QUIT: Quit: Leaving) (~isoriano@5.147.209.166)19:16
_BnuHank purser.19:21
mntmnhehe19:34
mntmni have a new question.19:34
mntmnkickstart copies the bootrom to some kind of place in ram and gives me the address, right19:34
mntmndoes this ram stay allocated or not?19:34
mntmnit feels like in-place relocation (mutating the copy in ram) is maybe not what they intended???19:35
mntmni'm gonna look at the french files19:38
mntmn> Routine de comparaison des noms de partition19:39
_BnuI mean, how should I know, lol.19:39
_BnuIt's the example boot ROM.19:39
_BnuIf it's not doing it right, you'll have to ask Commodore why they did that.19:40
mntmn> On saute la zone des Hunks19:40
_Bnuhttp://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node0594.html19:42
mntmnhaha they have a tiny LoadSeg19:42
mntmn(in the french code)19:42
mntmnbut that would work only with 1 segment19:44
mntmnand my device has 319:44
mntmncode, data, bss19:45
mntmnand relocations are going to all of them19:45
mntmni need to find the offsets of these segments in the binary, so i can add them to the relocation targets19:45
mntmnat the beginning of the binary, there is a list of the 3 segment sizes19:46
mntmnbut these sizes are a bit too smol19:46
mntmn(i know i have to x4 them, but still too smol)19:46
mntmnmy guess is that this is the size i should allocate, so other tables at the end etc are not copied, so everything shrinks after allocating+copying19:47
_BnuDidn't you find a relocator thing already?19:47
mntmnbut i don't wanna do that, i want to relocate everything in place19:47
_BnuIt seemed to allocate memory on its own.19:47
mntmnyes19:47
mntmni am patching that one19:47
mntmnit does the parsing fine19:47
mntmnbut i disabled the allocations in it19:47
mntmnbecause why should i allocate again and copy again19:48
mntmnif kickstart already copied the binary for me19:48
mntmnthe problem is that they get their segment addresses from the allocator19:48
mntmnbut instead i need to find the segment addresses in the .device blob19:48
mntmnin my old broken code i did 2 passes because of this19:49
mntmnfirst pass to find the addresses and second pass to patch19:49
mntmnbut i can't believe i have to do that...19:49
mntmnthere must be some trick19:49
_BnuYeah sorry, no idea. As far as I can tell, the copy of my PiSCSI boot ROM does not remain in RAM after booting.19:49
mntmnok?19:49
mntmnthat's bad then.19:49
_BnuThat's why I load the driver as resident.19:50
_BnuOtherwise it can't persist across reboots.19:50
mntmnwell yeah i would InitResident it then19:50
mntmnbut i thought i could patch the binary (do the relocations), and then hand that directly to InitResident19:50
mntmnbut what you say sounds like the area passed to InitResident would disappear?19:50
mntmnor will InitResident protect it, or copy it?19:50
mntmn(who is responsible for that memory?)19:51
_BnuMaybe you can, I don't know. I just allocated memory for it and copied it there because I didn't want to spend 200 years figuring out what might be going wrong.19:51
mntmnyeah i'm in the middle of those 200 years obviously19:51
_BnuI'm not a real Amiga person, so I feel that spending 16 or 18KB of memory on a storage device driver doesn't really matter, haha.19:52
_BnuIt works fine on an A500 with 512KB of RAM, so it's probably okay. I don't much care for the 256KB Chip machines.19:53
mntmntrue19:54
mntmni will try to use exec AllocMem in there19:54
mntmni do not believe in custom allocation routines in my bootrom :3319:54
_BnuOh, wasn't that relocator using AllocMem?19:56
_BnuIt looked like it was just allocating memory for the hunks when I looked at it briefly.19:56
mntmnthey have their own AllocMem19:58
mntmnhere https://github.com/cahirwpz/demoscene/blob/master/bootloader.asm#L35019:58
mntmnbut it takes the same arguments as the exec one19:59
_BnuWeird.19:59
mntmnthey also have their own CopyMem, but that one works differently20:01
mntmnso i took it... it's also only 2 or 3 lines20:01
mntmnrelocations look sane...20:09
- RobDangerous (QUIT: Ping timeout: 272 seconds) (~Thunderbi@p200300ec8f3e1c00e588fff41585aac2.dip0.t-ipconnect.de)20:12
mntmnhmm, initresident did not crash for the first time...20:34
_BnuACTION downloads20:34
mntmnok zzusb.device is in the devices list!!20:35
mntmn(mon -> vd)20:35
mntmn_Bnu: https://twitter.com/mntmn/status/142226498317860044820:36
mntmnnot sure why it is "43.0"20:36
mntmnthe revision i mean...20:36
mntmnthe code i stole from you says:20:37
mntmn#define DEVICE_VERSION 4320:37
mntmn#define DEVICE_REVISION 2020:37
mntmnso the 43 is ok...20:37
_BnuUhh, not sure. I think I checked using Scout and it did say what it was supposed to...20:41
mntmnmountdos list zzusb.device works :0 :0 :0 :020:41
_BnuMaybe it only takes one digit, and it only reads the 0?20:41
mntmnhaha this could be20:41
mntmnmaximum haxxor feelings20:43
mntmnhttps://twitter.com/mntmn/status/1422266925489573893/photo/120:44
mntmnnow we just need mountdos in the rom...20:44
mntmnInitResidentEvil20:44
mntmntheoretically all that partition / or at least boot node stuff could live in the device itself, no?20:45
mntmnNootBode20:46
mntmnbizarrely, the device is functional20:47
mntmni hadn't tested it after applying the changes to make it compile without -ramiga-dev20:47
_BnuNo, I do not think it can live in the device itself.20:50
_BnuBecause it needs to be done at Diag time.20:50
_BnuAlso, -ramiga-dev doesn't actually do anything useful for creating a device driver...20:51
_BnuAlso, you most likely don't have to care about the AddDosNode/Enqueue stuff.20:52
_BnuIt's only requires for Kickstart 1.3 because it doesn't have AddBootNode.20:53
_BnuWith 2.0+, it's infinitely easier because you can just MakeDosNode and AddBootNode if it's bootable or AddDosNode if it's not.20:53
mntmnwell, i mean i have the fully loaded and relocated device at diag time, i think i could jump into a routine of it...20:57
mntmn_Bnu: lets say my USB stick was formatted with RDB partition table, could i make amigaos discover the partitions or do i need a partition parser in any case?20:58
mntmnlooking at http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_2._guide/node03AE.html again...21:00
mntmnMakeDosNode has to be done for each partition, right...21:01
_BnuYou can not make AmigaOS discover the partitions as far as I know, no.21:05
_BnuYou need to parse the RDB yourself and add them.21:05
_BnuBut yeah, if you can figure out how to jump into the C code of the device somehow, then you can do all the RDB parsing and Dos/BootNode setup there.21:06
mntmnok21:11
mntmnyeah yeah21:11
mntmni want to have a very simple working thing first though, so i might do something like parse MBR and add the first FFS formatted partition only.21:11
mntmnfrom there, you can load moar file systems and advanced magic...21:11
mntmnalso i wonder if FFS works on MBR but why not...21:12
_BnuUhhh21:12
_BnuI know that RDB can coexist with MBR, somehow.21:12
_BnuBut I've never seen anyone do it.21:12
_BnuBecause RDB doesn't have to be the first block on the drive, it searches up until block... 256? I forget.21:13
_BnuBut if the blocks are being read back properly, you should be able to use HDToolBox or GiggleDisk with it.21:13
mntmni don't think i ~need~ RDB if i have to parse the partition table anyway... just amiga's toolbox thingie won't work21:13
_BnuJust edit the tooltype for HDToolBox to use zzusb.device instead.21:14
mntmntyletoop21:14
_Bnu('A`)21:14
mntmni mean, i'm thinking more about partitioning the stuff on a linux machine...21:14
mntmnto be able to get files on and off there quick21:14
_BnuSounds weird, but sure. You don't need any of that then.21:15
_BnuYou can just ignore it all and construct your own BootNodes.21:15
mntmnexactly21:15
mntmnweird in terms of non-amiga-like, but not weird in terms of comfort perhaps...21:15
_BnuI dunno, sounds completely unusable to me, hahah. But I'm on Windows.21:16
mntmn:(21:20
mntmn_Bnu: what would be comfy for you?21:26
mntmnah, people on windows mostly use UAE to access amiga formatted disks, right?21:28
_BnuIt's the only way to do it on Windows, really.21:29
_BnuUsing UAE as an intermediary to mount the entire disk as a "hardfile", since UAE supports RDB as well as its single partition hardfiles.21:29
mntmni see.21:30
mntmnalso i see that fat95 is lgpl and even comes with source and also is written in assembler.21:30
_BnuI think not supporting RDB either for the full disk or using a disk image on the USB device would limit the usability of it quite a bit.21:30
_BnuI mean, unless I'm the only Windows user, then you can just ignore me honestly.21:31
mntmn26kB though21:31
mntmnyeah, a disk image could be interesting as well21:31
mntmnnaja naja21:32
mntmnenough for today perhaps21:38
mntmnmm flavor > The partition data includes the start, length, filesystem, boot priority, buffer memory type and "flavor", though the latter was never used21:40
mntmn_Bnu: i'm reading your codez to understand RDB21:52
+ RobDangerous (~Thunderbi@p200300ec8f3e1c00e588fff41585aac2.dip0.t-ipconnect.de)22:01
_BnuThere are structures available for RDB in the NDK include files, so it's not very hard to deal with. Very simple setup, otherwise I wouldn't have been able to do much with it.22:06
_BnuBasically just block types and pointers to the next block (if any).22:06
_BnuThe LSEG things are just single blocks with some identifier stuff and then sequential data as well.22:07
_BnuMost of the data needed to make the DosNode is available in each partition block as well.22:16
_BnuAll that's missing is a -1 or whatever it is for the GlobalVec and a pointer to the loaded/reloced file system (if any).22:16
_BnuIf the pointer is null, it'll try to use the default file system on Kick 2.0+, typically DOS/1.22:16
_BnuOn Kick 1.3, I have no idea, I can't get it to work.22:16
mntmnthat is cool, thanks22:29
mntmni put some test code in the device to find an RDB, but now my relocator fails with the new binary :322:29
mntmnpatches the wrong locations... 22:29
mntmnso it added 2x an offset to the romtag itself lol22:29
mntmnoh yeah how weird, there are relocation table offsets of zero... and those get added to the romtag :022:40
_BnuGood, good...22:40
mntmnbut according to hunktool, these entries are not zero.22:43
mntmnso a few entries are borked22:43
mntmnthe table is like 2, 0, 80, 0, c0, 57c, 814, ea, 21e, 29c, f2, ...22:44
mntmnbut it should be 2, 6, e, 12, 16, 57c, 814, ea, 21e, 29c, f2, ...22:45
mntmnso a portion of the table is overwritten with 0, 80, 0, c22:45
_BnuEveryone needs a bit of $0C008000 in their lives.22:47
mntmnhehe22:47
mntmnwell, it's more like 00000000 00000080 00000000 000000c022:47
mntmn:322:48
mntmnso either it is not copied out of the "rom" cleanly, or clobbered afterwards...22:48
mntmnoh yeah i'm dumb22:49
mntmnhaha22:49
mntmnthe boot rom has swollen into zz9000s network structures22:49
mntmnbecause i put it at 0x3fcff00022:50
mntmnthere's only 4k space but we require 8k22:50
_BnuAh yeah, I made that mistake with my boot ROM originally, it's better to give it 16KB just in case.22:50
mntmn:33322:51
mntmnoh man without some hex tracing code in place i would be extremely lost now22:51
_BnuWithout being unable to step through the boot ROM code in real time, I would never have gotten it to work. :D22:52
_Bnu*Without being able22:52
_Bnu(Because on the PiStorm I could just halt CPU emulation and step through it.)22:53
_BnuThat's how I found out about vasm misaligning all its generated code at certain points.22:53
mntmnoop22:53
mntmninit_device!23:06
mntmnzz9k found!23:06
mntmnHello from parse_rdb!23:06
mntmnRDB not found!23:06
mntmnok ok23:06
mntmnlets hdtoolbox it...23:06
mntmninterestingly the disk is shown as kinda 16GB23:09
mntmnHello from parse_rdb!23:10
mntmnRDB found at block:     000023:10
mntmnCylinders:      ce8023:10
mntmnHeads:  ce8023:10
mntmnSectors:        ce8023:10
mntmnBlockBytes:     020023:10
mntmnPartitionList:  000123:10
mntmnok this worked immediately23:10
mntmnexcept those cyl/had/sector numbers are too smol or something weird23:10
mntmnok, this is pretty cool, enough for today!23:11
_BnuAh yeah, isn't your CHS stuff like hard coded or something?23:18
_BnuI changed it around quite a bit for PiSCSI, also added proper support for SCSI_READ10 and TD_GETGEOMETRY and some other stuff.23:18
_BnuYou kind of need TD64 support for large disks, or support for block sizes other than 512 bytes... SCSI_READ10 also works, but it's slower than TD64.23:19
_BnuAnd of course the TD64 commands are off in some 3.5/3.9 include file on the Amiga Developer CD.23:21
- RobDangerous (QUIT: Ping timeout: 240 seconds) (~Thunderbi@p200300ec8f3e1c00e588fff41585aac2.dip0.t-ipconnect.de)23:29
+ RobDangerous (~Thunderbi@p200300ec8f3e1c00e588fff41585aac2.dip0.t-ipconnect.de)23:30

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!