realemu 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. .TH REALEMU 8
  2. .SH NAME
  3. realemu \- software emulation of /dev/realmode
  4. .SH SYNOPSIS
  5. .B aux/realemu
  6. [
  7. .B -Dpt
  8. ] [
  9. .B -s
  10. .I srvname
  11. ] [
  12. .B -m
  13. .I mntpt
  14. ]
  15. .SH DESCRIPTION
  16. .PP
  17. Originally, the kernel provided
  18. .B /dev/realmode
  19. and
  20. .B /dev/realmodemem
  21. files via
  22. .IR arch (3) .
  23. These devices provided access
  24. to real mode memory and
  25. .SM BIOS
  26. calls.
  27. .PP
  28. Interrupts were disabled and the processor switched to
  29. 16-bit "real mode" to fit the
  30. .SM BIOS
  31. api.
  32. If
  33. .SM BIOS
  34. reprograms hardware in use or reenables interrupts or
  35. crashes, the system may freeze or reboot with little ability
  36. for diagnosis or recovery. To avoid this,
  37. .I realemu
  38. emulates
  39. .SM BIOS
  40. by interpreting the code intercepting
  41. dangerous actions that could compromise the system.
  42. .PP
  43. With no arguments,
  44. .I realemu
  45. mounts itself before
  46. .B /dev
  47. and
  48. serves
  49. .BR /dev/realmode .
  50. Flag
  51. .B D
  52. will enable 9P debugging; flag
  53. .B p
  54. traces i/o port access;
  55. .B t
  56. traces instructions.
  57. The -s flag causes
  58. .I realemu
  59. to post its channel on
  60. .BI /srv/ mntpt
  61. and the default
  62. .I mntpt
  63. is ignored.
  64. If
  65. .I mntpt
  66. is given before
  67. .I srvname
  68. argument then it is ignored, otherwise it will be used.
  69. .SH EXAMPLES
  70. .I Realemu
  71. is only needed when accessing
  72. .B /dev/realmode.
  73. To invoke a subshell so that
  74. .I realemu
  75. exits normally after
  76. .B aux/vga
  77. completes:
  78. .IP
  79. .EX
  80. ; @{rfork n; aux/realemu; aux/vga -m vesa -l $vgasize}
  81. .EE
  82. .SH SOURCE
  83. .B /sys/src/cmd/aux/realemu
  84. .SH "SEE ALSO"
  85. .IR vga (8),
  86. .IR arch (3)
  87. .TH REALEMU 8
  88. .SH NAME
  89. realemu \- software emulation of /dev/realmode
  90. .SH SYNOPSIS
  91. .B aux/realemu
  92. [
  93. .B -Dpt
  94. ] [
  95. .B -s
  96. .I srvname
  97. ] [
  98. .B -m
  99. .I mountpoint
  100. ]
  101. .SH DESCRIPTION
  102. .PP
  103. Originally, kernel provided
  104. .B /dev/realmode
  105. files with the
  106. .IR arch (3)
  107. device to access and call the
  108. .SM BIOS.
  109. .PP
  110. Interrupts had to be disabled and the processor was switched in the
  111. legacy 16-bit
  112. .SM realmode
  113. with memory protection disabled to execute
  114. .SM BIOS
  115. code.
  116. .PP
  117. This is problematic in case the
  118. .SM BIOS
  119. reprograms hardware currently
  120. used by the operating system or when it reenables interrupts or just
  121. crashes. This will freeze or reboot the machine with no way to
  122. recover or diagnose the problem.
  123. .PP
  124. To avoid this,
  125. .I realemu
  126. is used to emulate the execution of the
  127. .SM BIOS
  128. routines by interpreting the machine instructions and intercepting
  129. dangerous actions that would compromise the systems stability.
  130. .PP
  131. Running
  132. .I realemu
  133. with no arguments, it mounts itself before
  134. .B /dev
  135. and
  136. replaces the original
  137. .B /dev/realmode
  138. file in the current namespace.
  139. .PP
  140. Then programs like
  141. .IR vga (8)
  142. can use it to make ther
  143. .SM BIOS
  144. calls.
  145. .PP
  146. The
  147. .B D
  148. flag will enable debug messages for 9P. The
  149. .B p
  150. and
  151. .B t
  152. flags
  153. control tracing of i/o port access and cpu instructions to
  154. stderr (fd 2).
  155. .PP
  156. When a
  157. .I srvname
  158. is given with the
  159. .B s
  160. argument, the default
  161. .I mountpoint
  162. is ignored and a
  163. .SM 9P
  164. channel is created in
  165. .B /srv
  166. that can be used to mount
  167. the filesystem from another namespace. If a
  168. .I mountpoint
  169. is given before
  170. the
  171. .I srvname
  172. argument then it is ignored, otherwise it will be used.
  173. .SH EXAMPLES
  174. The
  175. .I realemu
  176. process is only needed when accessing
  177. .B /dev/realmode.
  178. To invoke a subshell so that
  179. .I realemu
  180. exits normally after
  181. .B aux/vga
  182. completes:
  183. .IP
  184. .EX
  185. % @{rfork n; aux/realemu; aux/vga -m vesa -l $vgasize}
  186. .EE
  187. .SH SOURCE
  188. .B /sys/src/cmd/aux/realemu
  189. .SH "SEE ALSO"
  190. .IR vga (8),
  191. .IR arch (3)
  192. .TH REALEMU 8
  193. .SH NAME
  194. realemu \- software emulation of /dev/realmode
  195. .SH SYNOPSIS
  196. .B aux/realemu
  197. [
  198. .B -Dpt
  199. ] [
  200. .B -s
  201. .I srvname
  202. ] [
  203. .B -m
  204. .I mntpt
  205. ]
  206. .SH DESCRIPTION
  207. .PP
  208. Originally, the kernel provided
  209. .B /dev/realmode
  210. and
  211. .B /dev/realmodemem
  212. files via
  213. .IR arch (3) .
  214. These devices provided access
  215. to real mode memory and
  216. .SM BIOS
  217. calls.
  218. .PP
  219. Interrupts were disabled and the processor switched to
  220. 16-bit "real mode" to fit the
  221. .SM BIOS
  222. api.
  223. If
  224. .SM BIOS
  225. reprograms hardware in use or reenables interrupts or
  226. crashes, the system may freeze or reboot with little ability
  227. for diagnosis or recovery. To avoid this,
  228. .I realemu
  229. emulates
  230. .SM BIOS
  231. by interpreting the code intercepting
  232. dangerous actions that could compromise the system.
  233. .PP
  234. With no arguments,
  235. .I realemu
  236. mounts itself before
  237. .B /dev
  238. and
  239. serves
  240. .BR /dev/realmode .
  241. Flag
  242. .B D
  243. will enable 9P debugging; flag
  244. .B p
  245. traces i/o port access;
  246. .B t
  247. traces instructions.
  248. The -s flag causes
  249. .I realemu
  250. to post its channel on
  251. .BI /srv/ mntpt
  252. and the default
  253. .I mntpt
  254. is ignored.
  255. If
  256. .I mntpt
  257. is given before
  258. .I srvname
  259. argument then it is ignored, otherwise it will be used.
  260. .SH EXAMPLES
  261. .I Realemu
  262. is only needed when accessing
  263. .B /dev/realmode.
  264. To invoke a subshell so that
  265. .I realemu
  266. exits normally after
  267. .B aux/vga
  268. completes:
  269. .IP
  270. .EX
  271. ; @{rfork n; aux/realemu; aux/vga -m vesa -l $vgasize}
  272. .EE
  273. .SH SOURCE
  274. .B /sys/src/cmd/aux/realemu
  275. .SH "SEE ALSO"
  276. .IR vga (8),
  277. .IR arch (3)