Netbooting NetBSD in Previous

Started by cuby, January 08, 2023, 09:58:12 AM

Previous topic - Next topic

cuby

Quote from: andreas_g on January 09, 2023, 11:53:11 AMGreat! So next let's find out where in the NetBSD code this message is printed:
esp0: invalid state: 7 [intr 10, phase(c 3, p 3)]
Whoops, should've told you right away: in the ncr53c9x.c driver. State values are defined in ncr53c9xvar.h.

State 7 is NCR_CMDCOMPLETE (MSG_CMDCOMPLETE received).

I'll turn on debugging now to see a bit more...
[edit] log added, only one disk connected with ID0

Previous complains about "[DMA] Channel SCSI: Starting with 4 residual bytes in DMA buffer."

Screenshot 2023-01-09 at 20.50.40.png


cuby

Update:

It seems the condition in l. 2858 of ncr53c9x.c is triggered – if (NCRDMA_ISINTR(sc)) – the state machine starts from scratch and is then confused about the MSG_CMDCOMPLETE state.

andreas_g

The SCSI controller ist probably the most annoying part to simulate. I have read its datasheet about 100 times and still it fails the diagnostic tests (diagnostics utility). I'm not sure what might be wrong here. I'll have to investigate the sequence before it fails (enable all debugging in esp.c and dma.c and see what it does). The message about residual bytes inside the DMA channel is normally non-critical and just for information purpose. But I'll have a look at that one too.

ramalhais

I needed to do some small changes to get the standalone netbsd bootloader to work on turbos. Maybe this helps, sorry about the whitespace/formatting changes:

https://github.com/NetBSD/src/compare/trunk...ramalhais:netbsd-src:NeXT

ramalhais

main changes:

adding nitro and cube turbo on these kinds of IFs (search for NeXT_WARP9):
if (rom_machine_type == NeXT_WARP9 ||

and add the defines (IDs from testing with Previous):
#define NeXT_TURBO_MONO_40   6
#define NeXT_TURBO_COLOR_40   7
#define NeXT_CUBE_TURBO      8
#define NeXT_CUBE_TURBO_40   10


In sys/arch/next68k/include/loadfile_machdep.h fix macro ALIGNENTRY. This fixed SCSI/DMA:
// #define ALIGNENTRY(a)      0
#define   ALIGNENTRY(a)      ((u_long)(a))


andreas_g

Great work, thank you for sharing! May I suggest you also post this to the NetBSD next68k mailing list? Mr. Tsutsui has been working on NeXT-specific changes recently. He also helped debugging some things in Previous. Maybe there are some synergies and double work can be avoided.

ramalhais

Quote from: andreas_g on February 26, 2023, 11:51:55 PMGreat work, thank you for sharing! May I suggest you also post this to the NetBSD next68k mailing list? Mr. Tsutsui has been working on NeXT-specific changes recently. He also helped debugging some things in Previous. Maybe there are some synergies and double work can be avoided.

Thanks for pointing that out!
I was a bit afraid that trying to make work-arounds for netbsd in Previous would possibly make it break on my linux port, but it seems like it fixed some issues i was having.
The netbsd bootloader now seems to work on all 040s where before it only worked on turbos.
Somewhere along the changes also got my hanging issues fixed.
But it's hard to keep track of all these issues