README 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. Linux for the Q40
  2. =================
  3. You may try http://www.geocities.com/SiliconValley/Bay/2602/ for
  4. some up to date information. Booter and other tools will be also
  5. available from this place or http://ftp.uni-erlangen.de/pub/unix/Linux/680x0/q40/
  6. and mirrors.
  7. Hints to documentation usually refer to the linux source tree in
  8. /usr/src/linux/Documentation unless URL given.
  9. It seems IRQ unmasking can't be safely done on a Q40. IRQ probing
  10. is not implemented - do not try it! (See below)
  11. For a list of kernel command-line options read the documentation for the
  12. particular device drivers.
  13. The floppy imposes a very high interrupt load on the CPU, approx 30K/s.
  14. When something blocks interrupts (HD) it will lose some of them, so far
  15. this is not known to have caused any data loss. On highly loaded systems
  16. it can make the floppy very slow or practically stop. Other Q40 OS' simply
  17. poll the floppy for this reason - something that can't be done in Linux.
  18. Only possible cure is getting a 82072 controller with fifo instead of
  19. the 8272A.
  20. drivers used by the Q40, apart from the very obvious (console etc.):
  21. drivers/char/q40_keyb.c # use PC keymaps for national keyboards
  22. serial.c # normal PC driver - any speed
  23. lp.c # printer driver
  24. genrtc.c # RTC
  25. char/joystick/* # most of this should work, not
  26. # in default config.in
  27. block/q40ide.c # startup for ide
  28. ide* # see Documentation/ide/ide.txt
  29. floppy.c # normal PC driver, DMA emu in asm/floppy.h
  30. # and arch/m68k/kernel/entry.S
  31. # see drivers/block/README.fd
  32. net/ne.c
  33. video/q40fb.c
  34. parport/*
  35. sound/dmasound_core.c
  36. dmasound_q40.c
  37. Various other PC drivers can be enabled simply by adding them to
  38. arch/m68k/config.in, especially 8 bit devices should be without any
  39. problems. For cards using 16bit io/mem more care is required, like
  40. checking byte order issues, hacking memcpy_*_io etc.
  41. Debugging
  42. =========
  43. Upon startup the kernel will usually output "ABCQGHIJ" into the SRAM,
  44. preceded by the booter signature. This is a trace just in case something
  45. went wrong during earliest setup stages of head.S.
  46. **Changed** to preserve SRAM contents by default, this is only done when
  47. requested - SRAM must start with '%LX$' signature to do this. '-d' option
  48. to 'lxx' loader enables this.
  49. SRAM can also be used as additional console device, use debug=mem.
  50. This will save kernel startup msgs into SRAM, the screen will display
  51. only the penguin - and shell prompt if it gets that far..
  52. Unfortunately only 2000 bytes are available.
  53. Serial console works and can also be used for debugging, see loader_txt
  54. Most problems seem to be caused by fawlty or badly configured io-cards or
  55. hard drives anyway.
  56. Make sure to configure the parallel port as SPP and remove IRQ/DMA jumpers
  57. for first testing. The Q40 does not support DMA and may have trouble with
  58. parallel ports version of interrupts.
  59. Q40 Hardware Description
  60. ========================
  61. This is just an overview, see asm-m68k/* for details ask if you have any
  62. questions.
  63. The Q40 consists of a 68040@40 MHz, 1MB video RAM, up to 32MB RAM, AT-style
  64. keyboard interface, 1 Programmable LED, 2x8bit DACs and up to 1MB ROM, 1MB
  65. shadow ROM.
  66. The Q60 has any of 68060 or 68LC060 and up to 128 MB RAM.
  67. Most interfacing like floppy, IDE, serial and parallel ports is done via ISA
  68. slots. The ISA io and mem range is mapped (sparse&byteswapped!) into separate
  69. regions of the memory.
  70. The main interrupt register IIRQ_REG will indicate whether an IRQ was internal
  71. or from some ISA devices, EIRQ_REG can distinguish up to 8 ISA IRQs.
  72. The Q40 custom chip is programmable to provide 2 periodic timers:
  73. - 50 or 200 Hz - level 2, !!THIS CAN'T BE DISABLED!!
  74. - 10 or 20 KHz - level 4, used for dma-sound
  75. Linux uses the 200 Hz interrupt for timer and beep by default.
  76. Interrupts
  77. ==========
  78. q40 master chip handles only a subset of level triggered interrupts.
  79. Linux has some requirements wrt interrupt architecture, these are
  80. to my knowledge:
  81. (a) interrupt handler must not be reentered even when sti() is called
  82. from within handler
  83. (b) working enable/disable_irq
  84. Luckily these requirements are only important for drivers shared
  85. with other architectures - ide,serial,parallel, ethernet.
  86. q40ints.c now contains a trivial hack for (a), (b) is more difficult
  87. because only irq's 4-15 can be disabled - and only all of them at once.
  88. Thus disable_irq() can effectively block the machine if the driver goes
  89. asleep.
  90. One thing to keep in mind when hacking around the interrupt code is
  91. that there is no way to find out which IRQ caused a request, [EI]IRQ_REG
  92. displays current state of the various IRQ lines.
  93. Keyboard
  94. ========
  95. q40 receives AT make/break codes from the keyboard, these are translated to
  96. the PC scancodes x86 Linux uses. So by theory every national keyboard should
  97. work just by loading the appropriate x86 keytable - see any national-HOWTO.
  98. Unfortunately the AT->PC translation isn't quite trivial and even worse, my
  99. documentation of it is absolutely minimal - thus some exotic keys may not
  100. behave exactly as expected.
  101. There is still hope that it can be fixed completely though. If you encounter
  102. problems, email me ideally this:
  103. - exact keypress/release sequence
  104. - 'showkey -s' run on q40, non-X session
  105. - 'showkey -s' run on a PC, non-X session
  106. - AT codes as displayed by the q40 debugging ROM
  107. btw if the showkey output from PC and Q40 doesn't differ then you have some
  108. classic configuration problem - don't send me anything in this case