Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEXTSTEP bootloader doesn't like BlueSCSI default hard drive geometry. #242

Open
Spaceballs3000 opened this issue Jun 12, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@Spaceballs3000
Copy link

Spaceballs3000 commented Jun 12, 2023

On my HP 9000 712 I can install NEXTSTEP 3.3 to BlueSCSI drive at ID6 (via BlueSCSI cdrom ID3), but when it tries to boot from it (ID6). It will fail due to it's default hard drive geometry given by BlueSCSI, if i manually set it to 139 Sectors, and 4 heads (code below) it then will boot fine.

    case SCSI_SENSE_MODE_FORMAT_DEVICE:  //Drive parameters
      m_buf[a + 0] = SCSI_SENSE_MODE_FORMAT_DEVICE; //Page code
      m_buf[a + 1] = 0x16; // Page length
      if(pageControl != 1) {
        m_buf[a + 11] = 139;//Number of sectors / track
        m_buf[a + 12] = (byte)(dev->m_blocksize >> 8);
        m_buf[a + 13] = (byte)dev->m_blocksize;
        m_buf[a + 15] = 0x1; // Interleave
      }
      a += 0x18;
      if(pageCode != SCSI_SENSE_MODE_ALL) break;

    case SCSI_SENSE_MODE_DISK_GEOMETRY:  //Drive parameters
      m_buf[a + 0] = SCSI_SENSE_MODE_DISK_GEOMETRY; //Page code
      m_buf[a + 1] = 0x16; // Page length
      if(pageControl != 1) {
        unsigned cylinders = dev->m_blockcount / (4 * 139);
        m_buf[a + 2] = (byte)(cylinders >> 16); // Cylinders
        m_buf[a + 3] = (byte)(cylinders >> 8);
        m_buf[a + 4] = (byte)cylinders;
        m_buf[a + 5] = 4;   //Number of heads
      } else {
        m_buf[a + 2] = 0xFF; // Cylinder length
        m_buf[a + 3] = 0xFF;
        m_buf[a + 4] = 0xFF;
        m_buf[a + 5] = 4;   //Number of heads
      }
      a += 0x18;
      if(pageCode != SCSI_SENSE_MODE_ALL) break;
    case SCSI_SENSE_MODE_FLEXABLE_GEOMETRY:
      m_buf[a + 0] = SCSI_SENSE_MODE_FLEXABLE_GEOMETRY;
      m_buf[a + 1] = 0x1E;  // Page length
      if(pageControl != 1) {
        m_buf[a + 2] = 0x03; 
        m_buf[a + 3] = 0xE8; // Transfer rate 1 mbit/s
        m_buf[a + 4] = 4; // Number of heads
        m_buf[a + 5] = 139; // Sectors per track
        m_buf[a + 6] = (byte)dev->m_blocksize >> 8;
        m_buf[a + 7] = (byte)dev->m_blocksize & 0xff;  // Data bytes per sector
      }
@erichelgeson
Copy link
Owner

Thanks for the report and the solution! Having a geometry that works for every situation seems to be difficult as there are a lot of assumptions and restrictions depending on the OS. We can consider making this configurable now that we have an ini configuration file in main - or a "more right" default.

@erichelgeson erichelgeson added the help wanted Extra attention is needed label Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants