Re: [hatari-devel] MODE SENSE patch

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 15.3.2022 22.43, Uwe Seimet wrote:
Obviously you are familiar with some rather exotic DISKUS functionality :-):

I stumbled upon the missing MODE SENSE support for 0x3f when extending my
SCSI Driver tests, but these tests do not request individual pages. This is
why I did not look into the details of the existing code for a single page.
On first sight I agree with what you say. To fix this one can probably just
call HDC_CmdModeSense0x04 with an offset of 4, similar to how I did it for
0x3f.

The current code also does not check the DBD field, which means that more
changes would be required in order to be compatible at least with SCSI-2.
On the other hand, Hatari claims to be compatible with SCSI-1 CCS, for which
I don't have a reliable specification. But from my experience with real
SCSI-1 drives there is hardly any difference compared to SCSI-2.

But before applying more changes I would like to learn more on how to
reproduce what Eero reported:

HDC: REQUEST SENSE (SCSI, t=0, lun=0, cdb=03:00:00:00:60:00).
WARN : HDC: *** Strange REQUEST SENSE ***!

@Eero Can you please provide instructions on how to reproduce this,

Uh, that's a bit involved, as it was from m68k Linux.  Quick instructions...


First build latest Linux version for m68k (on Debian, which has m68k ELF cross-compiler):

1. Install build deps:
   $ sudo apt install bc bison flex install gcc-m68k-linux-gnu

2. Get latest upstream kernel release sources (without history):
   $ git clone --depth 1 --branch v5.16 \
     git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
   $ cd linux

3. Use Hatari compatible configuration:
   $ cp /path/to/hatari/tools/linux/kernel.config .config

4. Compile configured kernel:
   $ ARCH=m68k CROSS_COMPILE=m68k-linux-gnu- make -j4 vmlinux

(Build could be in a container, if you do not have Debian installed. Or if you'll just want a Linux binary image, I can send that privately.)


Hatari config for booting that Linux version:
  $ cat > lilo.cnf
[LILO]
Kernel = vmlinux
Symbols = System.map
Args = video=atafb:sthigh console=tty
KernelToFastRam = FALSE
Ramdisk =
^D


Create empty[1] 4 MB EXT2 HD image:
   $ mkdir disk/
   $ /sbin/mkfs.ext2 -t ext2 -L DISK -d disk/ root.img 4M

[1] Because SCSI mount fails, image content does not matter. More instructions are in:
https://hatari.tuxfamily.org/doc/m68k-linux.t


Then run Hatari with these under TT emulation:
$ hatari --trace scsi_cmd --timer-d on --machine tt --vme none --cpu-exact off --compatible off --mmu on -s 14 --ttram 64 --addr24 off -c lilo.cfg --natfeats on --scsi 0=root.img --lilo "debug=nfcon root=/dev/sda ro init=/init"


NOTEs:

* Hatari's dummy VME emulation needs to be disabled, otherwise Linux tries to actually use it, which would obviously fail

* It's better to disable 030 cache & prefetch emulation, they do not work well enough with MMU + fast-RAM, for Linux user-space <-> kernel transition to work properly (i.e. after init gets booted from root FS)

* If you want to test Linux more, Hatari's tools/linux/ dir has couple of useful patches to Linux sources:
  https://git.tuxfamily.org/hatari/hatari.git/tree/tools/linux



and the Hatari commit ID that is affected?

It was the Hatari git HEAD (commit 418b6bb0a I think) i.e. with your patches that Nicolas had pushed to the repo at that time.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/