tvman.5 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. TRIVIA Hacker's Manual
  2. -or-
  3. Learning to Frob Obscurely
  4. I. On the Road to the ASYLUM.
  5. All high-quality TRIVIA maintainers must have a small but
  6. finite knowledge of the workings of ASYLUMs (refer to MARC;ASYLUM >).
  7. Asylums have the following obscure features:
  8. Page 0 - MFD page / Octal Words to the Wise
  9. 0. Unused
  10. 1&2. Disk format date/time for lock hacking
  11. 3. Unused
  12. 4. Allocator Lock
  13. 5. Unused/used horribly
  14. 6. Highest legal address for data
  15. 7&10. Unused
  16. 11. Pointer to free block chain
  17. 12. First of Directory Pointers
  18. 77. Last Directory Pointer
  19. 100. First Page Lock (each locks 3 pages)
  20. 1777. Last Page Lock
  21. Page 1 - ALLOCATOR page / More gems of trivial knowledge
  22. 0. AOBJN pointer to Top of the Allocator (good for dinner, too)
  23. 1. Highest ID used + 1
  24. 2. SETZ n /or 0 -- where n is a pointer to start of free ID chain
  25. 3-1777. Allocation table entries (length/start of block)
  26. Directories are hidden at the top end of the file and grow towards the
  27. middle. The data area starts at 4000 (octal) and also grows to the middle
  28. of the file. When they meet, run for cover!
  29. A directory is made up of 4 word blocks whose meanings are as follows:
  30. 1. Lock word (-1 ==> free 0 ==> locked)
  31. 2. Pointer to Block that data calls home.
  32. 3. Length of that block if positive
  33. -or-
  34. Pointer to next free ID on free ID chain (if 4.9 bit set)
  35. 4. Data word (for DATA-PRINTW, etc)
  36. A data block is made up of a 5 word header followed by the data itself.
  37. The words of the header are:
  38. 1. Use word (+ number of people reading this block)
  39. 2. Unused
  40. 3. Chain pointer to next free data block if N==? 0
  41. 4. Unused
  42. 5. Length of block INCLUDING header
  43. In addition to the data block header, insane MANIACS created in MADMAN
  44. spaces use an additional 6 words of header but their meaning in obscure and
  45. their value is left for philosophers to decide. No person in his right mind
  46. attempts to grok this.
  47. The following magic incantations may be useful to a fifth-level magic user.
  48. 1. <DATA-FIND <asylum> <id number>>
  49. returns the directory block for that ID
  50. 2. <DATA-OPEN <mode> ; "PRINT" "READ" or "PRINTW"
  51. <id number> ; -1 for a brand new ID if in PRINT mode
  52. <asylum>>
  53. returns a MANIAC or FALSE
  54. 3. <DATA-BLOCK <maniac>
  55. <asylum>
  56. <length of block>>
  57. returns the location of the allocated block or FALSE
  58. 4. <DATA-CLOSE <maniac> <asylum>>
  59. returns the MANIAC
  60. 5. <DATA-APRINT <asylum> <id number> <space> <object>>
  61. returns the MANIAC created
  62. 6. <DATA-IPRINT <maniac> <asylum> <space> <object>>
  63. is like DATA-APRINT with a DATA-OPEN done previously
  64. 7. <DATA-AREAD <asylum> <id number> <space>>
  65. returns the object.
  66. 8. <DATA-IREAD <maniac> <asylum> <space>>
  67. is the analog of DATA-IREAD.
  68. 9. <DATA-PRINTW <id number> <asylum> <primtype word>>
  69. returns the MANIAC
  70. 10. <DATA-READW <id number> <asylum>>
  71. returns a <primtype word>
  72. 11. <DIR-FIND <asylum> <id number>>
  73. returns the page number in core of the directory on which <id number>
  74. lives. It obviously maps the page in, if it wasn't already.
  75. 12. <OPEN-DATA-FILE <file name>>
  76. opens an ASYLUM. There are some optional arguments which are not
  77. really necessary to grok.
  78. 13. <DATA-PUT <asylum> <id number> <uvector [dir header]>>
  79. BE CAREFUL!
  80. 14. <DATA-DELETE <id number> <asylum>>
  81. deletes this item
  82. 15. <DATA-BLOCK-FREE <asylum> <location of start of block>>
  83. deallocates that block
  84. 16. <NAME-BLOCK-FREE <id number> <asylum>>
  85. deallocates the name area for <id number>
  86. 17. <DATA-RENAME <id number> <asylum> <id number>>
  87. the obvious. May not be debugged totally.
  88.