diff --git a/一些非必要的资料/linux-0.11-quickstart.rar b/一些非必要的资料/linux-0.11-quickstart.rar new file mode 100644 index 0000000..23f8bb7 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart.rar differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.1.1.exe b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.1.1.exe deleted file mode 100644 index fd66d6d..0000000 Binary files a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.1.1.exe and /dev/null differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/BIOS-bochs-latest b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/BIOS-bochs-latest new file mode 100644 index 0000000..55180f2 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/BIOS-bochs-latest differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/BIOS-bochs-legacy b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/BIOS-bochs-legacy new file mode 100644 index 0000000..fb27f42 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/BIOS-bochs-legacy differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/CHANGES.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/CHANGES.txt new file mode 100644 index 0000000..b72c7e6 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/CHANGES.txt @@ -0,0 +1,2709 @@ +Changes in 2.3.6 (December 24, 2007): + +Brief summary : + ++ More than 25% emulation speedup vs Bochs 2.3.5 release! + + - Thanks to Darek Mihocka (http://www.emulators.com) + for providing patches and ideas that made the + speedup possible! + ++ Up to 40% speedup vs Bochs 2.3.5 release with trace cache optimization! + +- Lots of bugfixes in CPU emulation +- Bochs benchmarking support +- Added emulation of Intel SSE4.2 instruction set + +Detailed change log : + +- CPU + - Added emulation of SSE4.2 instruction set, to enable use + --enable-sse=4 --enable-sse-extension configure options + to enable POPCNT instruction only use configure option + --enable-popcnt + - Implemented MTRR emulation, to enable use --enable-mtrr configure + option. MTRRs is enabled by default when cpu-level >= 6. + - Implemented experimental MONITOR/MWAIT support including optimized + MWAIT CPU state and hardware monitoring of physical address range, + to enable use --enable-monitor-mwait configure option. + - Removed hostasm optimizations, after Bochs rebenchmarking it was found + that the feature bringing no speedup or even sometimes slows down + emulation! + - Merged trace cache optimization patch, the trace cache optimization + is enabled by default when configure with --enable-all-optimizations + option, to disable trace cache optimization configure with + --disable-trace-cache + - Many minor bugfixes in CPU emulation (both ia32 and x86-64) + - Updated CPU instrumentation callbacks + +- Bochs Internal Debugger and Disassembler + - Many fixes in Bochs internal debugger and disassembler, some debugger + interfaces significantly changed due transition to the param tree + architecture + - Added support for restoring of the CPU state from external file + directly from Bochs debugger + +- Configure and compile + - Renamed configure option --enable-4meg-pages to --enable-large-pages. + The option enables page size extensions (PSE) which refers to 2M pages + as well. + - Removed --enable-save-restore configure option, save/restore feature + changed to be one of the basic Bochs features and compiled by default + for all configurations. + - Added new Bochs benchmark mode. To run Bochs in benchmark mode execute + it with new command line option 'bochs -benchmark time'. The emulation + will be automatically stopped after 'time' millions of emulation + cycles executed. + - Another very useful option for benchmarking of Bochs could be enabled + using new 'print_timestamps' directive from .bochsrc: + print_timestamps: enable=1 + - Added --enable-show-ips option to all configuration scripts used to + build release binaries, so all future releases will enjoy IPS display. + - Enable alignment check in the CPU and #AC exception by default for + --cpu-level >= 4 (like in real hardware) + +- SF patches applied + [1857149] Define some IPL values by Sebastian + [1850183] Get memory access mode in BX_INSTR_LIN_READ by Lluis Vilanova + [1841421] pic: keep slave_pic.INT and master_pic.IRQ_in bit 2 in sync by Russ Cox + [1841420] give segment numbers in exception logs by Russ Cox + [1801696] Allow Intel builds on Mac OS X + [1830658] Fix >32GB disk banner by Samuel Thibault + [1813314] Move #define IPL_* and typedef ipl_entry by Sebastian + [1809001] Save PnP Option ROM Product Name string in IPL Boot Table by Sebastian + [1821242] Fix for #1801285, Niclist.exe broken by Sebastian + [1819567] Code warning cleanup + [1816162] Update comment on bios_printf() by Sebastian + [1811139] Trivial Fix when BX_PCIBIOS and BX_ROMBIOS32 not defined by Myles Watson + [1811190] Improve HD recognition and CD boot by Myles Watson + [1811860] Implement %X in bios_printf by Sebastian + [1809649] printf %lx %ld %lu by Myles Watson + [1809651] move BX_SUPPORT_FLOPPY by Myles Watson + [1809652] dpte and Int13DPT fixes by Myles Watson + [1809669] clip cylinders to 16383 in hard drive by Myles Watson + [1799903] Build BIOS on amd64 by Robert Millan + [1799877] Fix for parallel build (make -j2) by Robert Millan + +- these S.F. bugs were closed + [1837354] website bug: View the Source link broken + [1801268] Reset from real mode no longer working + [1843250] Using forward slashes gives invalid filename + [1823446] BIOS bug, local APIC #0 not detected + [1801285] Niclist.exe broken + [1364472] breakpoints sometimes don't work + [994451] breakpoint bug + [1801295] NSIS installer vs Windows Notepad + [1715328] Unreal mode quirk + [1503972] debugger doesn't debug first instruction on exception + [1069071] div al, byte ptr [ds:0x7c18] fails to execute + [1800080] Wrong "BX_MAX_SMP_THREADS_SUPPORTED" assertion + +------------------------------------------------------------------------- +Changes in 2.3.5 (September 16, 2007): + +Brief summary : +- Critical problems fixed for x86-64 support in CPU and Bochs internal debugger +- ACPI support +- The release compiled with x86-64 and ACPI +- Hard disk emulation supports ATA-6 (LBA48 addressing, UDMA modes) +- Added emulation of Intel SSE4.1 instruction set + +Detailed change log : + +- CPU + - Fixed critical bug with 0x90 opcode (NOP) handling in x86-64 mode + - implied stack references where the stack address is not in canonical form + should causes a stack exception (#SS) + - Added emulation of SSE4.1 instruction set (Stanislav) + - Do not save and restore XMM8-XMM15 registers when not in x86-64 mode + - Fixed zero upper 32-bit part of GPR in x86-64 mode + - CMOV_GdEd should zero upper 32-bit part of GPR register even if the + 'cmov' condition was false ! + - Implemented CLFLUSH instruction, report non-zero cache size in CPUID + - Fixed PUSHA/POPA instructions behavior in real mode + - Fixed detection of inexact result by FPU + - Fixed denormals-are-zero (DAZ) handling by SSE convert instructions + - Implemented Misaligned Exception Mask support for SSE (MXCSR[17]) + - Implemented Alignment Check in the CPU and #AC exception, to enable + use --enable-alignment-check configure option + +- General + - 2nd simulation support in wxBochs now almost usable (simulation cleanup + code added and memory leaks fixed) + +- Configure and compile + - several fixes for MacOSX, OpenBSD and Solaris 10 + - enable save/restore feature by default for all configurations + - reorganized SSE configure options to match Intel(R) Programming + Reference Manual, new option introduced for SSE extensions enabling. + To enable Intel Core Duo 2 new instructions use + --enable-sse=3 --enable-sse-extension + enabling of SSE4.1 (--enable-sse=4) will enable SSE3 extensions as well + - removed old PIT, always use new PIT written by Greg Alexander, + removed configure option --enable-new-pit + +- I/O devices (Volker) + - Floppy + - partial non-DMA mode support (patch by John Comeau) + - Hard drive / cdrom + - hard disk emulation now supports ATA-6 (LBA48 addressing, UDMA modes) + - VMWare version 4 disk image support added (patch by Sharvil Nanavati) + - PCI + - initial support for the PIIX4 ACPI controller + - Serial + - added support for 3-button mouse with Mousesystems protocol + - USB + - experimental USB device change support added + - rewrite of the existing USB devices code + - new USB devices 'disk' and 'tablet' (ported from the Qemu project) + +- Bochs internal debugger + - fixed broken debugger "rc file" option (execute debugger command from file) + - implementation of a gui frontend ("windebug") for win32 started + - gdbstub now accepts connection from any host + - several documentation updates + - a lot of disasm and internal debugger x86_64 support fixes + +- Configuration interface + - fixes and improvements to the save state dialog handling + +- Display libraries + - text mode color handling improved in some guis + - win32 fullscreen mode (patch by John Comeau) + +- System BIOS (Volker) + - 32-bit PM BIOS init code for ACPI, PCI, SMP and SMM (initial patches by + Fabrice Bellard) + - PCI BIOS function "find class code" implemented + +- SF patches applied + [1791000] 15h 8600h is reading the wrong stack frame by Sebastian + [1791016] rombios32.c, ram_probe(), BX_INFO missing value by Sebastian + [1786429] typo in bochsrc.5 by Sebastian + [1785204] Extend acpi_build_table_header to accept a revision number by Sebastian + [1766536] Partial Patch for Bug Report 1549873 by Ben Lunt + [1763578] ACPI Table Revision 0 -> 1 + [1642490] implement alignment check and #AC exception by Stanislav Shwartsman + [1695652] [PATCH] .pcap pktlog and vnet PXE boot by Duane Voth + [1741153] Add expansion-ROM boot support to the ROMBIOS + [1734159] Implemented INT15h, fn 0xC2 (mouse), subfn 3, set resolution + [1712970] bios_printf %s fix + [1573297] PUSHA/POPA real mode fix by Stanislav Shwartsman + [1641816] partial support for non-DMA access to floppy by John Comeau + [1624032] shows where write outside of memory occurred by John Comeau + [1607793] allow fullscreen when app requests it by John Comeau + [1603013] Bugfix for major NOP problem on x64 by mvysin + [1600178] Make tap and tuntap compile on OpenBSD by Jonathan Gray + [1149659] improve gdbstub network efficiency by Avi Kivity + [1554502] Trivial FPU exception handling fix + +- these S.F. bugs were closed + [1316008] Double faults when it shouldn't - gcc 4.0.2 + [1787289] broken ABI for redolog class when enable-compressed-hd + [1787500] tftp_send_optack not 64bit clean + [1264540] Security issue with Bochs website + [1767217] Debugger Faults including ud2 + [1729822] Various security issues in io device emulation + [1675202] mptable hosed (bad entry count in header) + [1197141] 'make install' installs to bad location + [1157623] x86Solaris10 cannot recoginize ACPI RSD PTR + [1768254] large HDD in Bochs/bximage + [1496157] Windows Vista Beta2 dosn't boot + [1755915] Illegal Hard Disk Signature Output + [1717790] info gdt and info idt scrolls away, too long result + [1726640] Debugger displays incorrect segment for mov instruction + [1719156] Typo in misc_mem.cpp + [1715270] Debugger broken in/beyond 2.3 + [1689107] v8086 mode priviledge check failed + [1704484] A few checks when CPU_LEVEL < 4 + [1678395] Problem with zero sector... + [876990] SA-RTL OS fails on PIC configuration + [1673582] save/restore didn't restore simulation correctly + [1586662] EDD int 13h bug, modify eax + [666618] POP_A Panic in DOS EMU + [1001485] panic: not enough bytes on stack + [1667336] delay times an order of magnitude slow + [1665601] crash disassembling bootcode + [1657065] CVS sources won't compile + [1653805] bochs's gdbstub uses incorrect protocol + [1640737] ASM sti command frezzes guest OS + [1636439] latest CVS sources don't compile under Cygwin + [1634357] disasm incorrect (no sign ext) displacement in 64-bit mode + [1376453] pcidev segfaults bochs + [1180890] IOAPIC in BOCHS - WinXP 64 in MP version + [1597528] 2.3 fails to compile on amd64 + [1526255] FLD1 broken when compaling with gcc 4.0.x + [1597451] eth_fbsd is broken under FreeBSD + [1571949] Bochs will not compile under Solaris + [1500216] Bochs fails to boot BeOs CD + [1458339] bochs-2.2.6 WinXP Binary ACPI error installing FreeBSD 6.0 + [1440011] patches needed for FreeBSD 6.0 to compile Bochs + [431674] some devices don't have a prefix + [458150] QNX demo disk crashes with new pit + [818322] Bochs 2.1 cvs: OS/2 - read verify on non disk + [906840] KBD: bogus scan codes generated in set 3 + [1005053] No keyboard codes translation + [1109374] Problem with Scancodeset 2 + [1572345] Bochs won't continue + [1568153] Bochs looks for (and loads?) unspecified display libraries + [1563462] Errors in /iodev/harddrv.h + [1562172] TLB_init() fails to initialize priv_check array if USE_TLB 0 + [1385303] debugger crashes after panic + [1438227] crc.cpp missing in bx_debug version 2.2.6 + [1501825] debugger crashes on to high input + [1420959] Memory leak + buffer overflow in Bochs debugger + [1553289] Error in Dis-assembler + [542464] I cannot use FLAT + [1548270] Bochs won't die with its pseudo terminal + [1545588] roundAndPackFloatx80 does not detect round up correctly + +------------------------------------------------------------------------- +Changes in 2.3 (August 27, 2006): + +Brief summary : +- limited save/restore support added (config + log options, hardware state) +- configuration parameter handling rewritten to a parameter tree +- lots of cpu and internal debugger fixes +- hard disk geometry autodetection now supported by most of the image types +- hard disk emulation now supports ATA-3 (multiple sector transfers) +- VBE memory size increased to 8MB and several VGA/VBE fixes +- updated LGPL'd VGABIOS to version 0.6a + +Detailed change log : + +- CPU and internal debugger fixes + - Fixed bug in FSTENV instruction (Stanislav Shwartsman) + - Recognize #XF exception (19) when SSE is enabled + - Fixed bug in PSRAW/PSRAD MMX and SSE instructions + - Save and restore RIP/RSP only for FAULT-type exceptions, not for traps + - Correctly decode, disassemble and execute multi-byte NOP '0F F1' opcode + - Raise A20 line after system reset (Stanislav Shwartsman) + - Implemented SMI and NMI delivery (APIC) and handling in CPU (Stanislav) + - Experimental implementation of System Management Mode (Stanislav) + - Added emulation of SSE3E instructions (Stanislav Shwarstman) + - Save and restore FPU opcode, FIP and FDP in FXSAVE/FRSTOR instructions + - Fixed bug in MOVD_EdVd opcode (always generated #UD exception) + - Fixed critical issue, Bochs was not supporting > 16 bit LDT.LIMIT values + - Many fixes in Bochs internal debugger and disassembler + +- CPU x86-64 fixes + - Fixed SYSRET instruction implementation + - Fixed bug in CALL/JMP far through 64-bit callgate in x86-64 mode + - Correctly decode, disassemble and execute 'XCHG R8, rAX' instruction + - Correctly decode and execute 'BSWAP R8-R15' instructions + - Fixed ENTER and LEAVE instructions in x86-64 mode (Stanislav) + - Fixed CR4 exception condition (No Name) + - Fixed x86 debugger to support x86-64 mode (Stanislav) + +- APIC and SMP + - Support for Dual Core and Intel(R) HyperThreading Technology. Now you + could choose amount of cores per processor and amount of HT threads per + core from .bochsrc for SMP simulation (Stanislav Shwartsman) + - Allow to control SMP quantum value through .bochsrc CPU + option parameter. Previous Bochs versions used hardcoded quantum=5 + value. + - Fixed interrupt priority bug in service_local_apic() + - Fixed again reading of APIC IRR/ISR/TMR registers. Finally it becomes + fully correct :-) + +- Configure and compile + - Moved configure time --enable-reset-on-triple-fault option to runtime, + the 'cpu' option in .bochsrc is extended and the old configure option + is deprecated (Stanislav Shwartsman) + - Removed --enable-pni configure option, to compile with PNI use + --enable-sse=3 instead (Stanislav Shwartsman) + - enable SEP (SYSENTER/SYSEXIT) support by default for Penitum II+ + processor emulation (i.e. if cpu-level >= 6 and MMX is enabled) + +- general + - Limited save/restore support added. The state of CPU, memory and all + devices can be saved now (state of harddisk images not handled yet). + - Fixed several memory leaks + +- configuration interface + - Configuration parameter handling rewritten to a parameter tree. This is + required for dynamic menus/dialogs, user-defined options and save/restore. + - Support for user-defined bochsrc options added + - help support at the parameter prompt in textconfig added + +- I/O devices (Volker) + - Floppy + - partial sector transfers fixed + - Hard drive / cdrom + - several fixes to the IDE register behaviour (e.g. in case of a channel + with only one drive connected) + - fixed data alignment of 'growing' hard drive images (sharing images + between Windows and Linux now possible) + - disk geometry autodetection now supported by most of the image types + (unsupported: external, dll and compressed modes) + - multi sector read/write commands implemented + - hard disk now reporting ATA-3 supported + - ATAPI 'inquiry' now returns a unique device name + - Keyboard + - reset sent to keyboard has no effect on the 8042 (scancode translation) + - PCI + - forward PIRQ register changes to the I/O APIC (if present) + - attempt to fix and update the emulation part of 'pcidev' (untested) + - VGA + - VBE memory size increased to 8MB and several VBE fixes + - VGA memory read access fixed (bit plane access and read mode) + - VGA memory is now a part of the common video memory + +- System BIOS (Volker) + - enable interrupts before executing INT 19h + - fixed ATA device detection in case of one drive only connected to controller + - improved INT 15h function AX=E820h + - real mode PCI BIOS now returns IRQ routing information (function 0Eh) + - keyboard LED flags handling fixed and improved + - fixed handling of extended keys in INT 09h + - Updated LGPL'd VGABIOS to version 0.6a + +- SF patches applied + [1340111] fixes and updates to usb support by Ben Lunt + [1539420] minor addition to pci_usb code by Ben Lunt + [1455958] call/jmp through call gate in 64-bit mode + [1433107] PATCH: fix compile with wxwindows 2.6 (unicode / utf8) by jwrdegoede + [1386671] Combined dual core and hyper-threading patch + +- these S.F. bugs were closed + [833927] TTD: System Error TNT.40025: Unexpected processor exception + [789230] Sending code that shows lock up when setting idt + [909670] Problems with Symantec Ghost + [1540241] include missing in osdep.cc + [1539373] Incorrect disasm for "mov moffset,bla" in 64bit + [1538419] incorrect disassembly of [rip+disp] with rex.b + [1535432] shift+cursor key maps to a digit + [1504891] Knoopix 5.0.1 error + [1424355] bochs-2.2.6 ata failure in windoze 98se + [1533979] wrong disassembly of IN instruction + [620059] paste won't stop + [1164904] status bar doesn't show num/caps/scroll lock status + [1061720] ATA Support level for HD + [1522196] Broken CHANGES link in main page + [1438415] crash if screen scrolled downwards + [778441] Shouldn't interrupts be enable after BIOS? + [1514949] I got a problem with the 8253 timer + [1513544] disasm of 0xec (in AL,DX) returns ilen of 2 instead of 1 + [1508947] APIC interrupt priority checking and interrupt delivery + [766286] Debugger halts after any GPF exception + [639143] va_list is not a pointer on linuxppc + [1501815] debugger examines memory over page-boundary wrong + [1503978] movsb/w/d doesn't work when direction is stored + [1499405] WinPCap has changed URL hosting + [1498519] APIC IRR bits not set while interrupts disabled + [1498193] Bochs segfaults on LTR instruction + [787140] Guest2HostTLB optimization bug + [1492070] instrument stop + [1487772] No SEP on P4 + [1488335] Growing hard disk images severe interoperability errors! + [1076312] Shadow RAM and TLB + [1282249] The real i440FX chipset Award bios hangs + [1479763] mistake "mov ax,[es:di]" for "mov ax,[ds:di]" + [1453575] Misconfigured floppy DMA transfers do not terminate. + [1460068] Incorrect handling for the Options Menu Item + [910203] bochs-2.1.1 wx.lo failed + [1438654] PANIC when trying to run install-amd64-minimal-2005.0.iso + [1458320] compile hdimage.h fails + [1455880] bochs-2.2.6,2: make error on FreeBSD + [696890] Network wouldn't run under W2k hosting MSDOS + [673391] SMP timer problems + [1291059] wxWindows GUI on non-windows/configure issue + [1356450] bochs 2.2.1 errors-omittions + [1178017] Win98 guest cannot receive network packets from host + [1076315] a20_mask after restarting + [1436323] real hw does not panic when bad Ib in CMPSS_VssWssIb + [1435269] cdrom_amigaos is not compilable + [1433314] disasm issues + [1170614] relative jumps/calls wrong in debugger + [758121] user might get confused when interrupt handler invoked + [1170622] You cannot toggle OFF "show" flags + [1406387] JMP instruction should display absolute address + [1428813] PANIC: ROM address space out of range + [1426288] DR-DOSs EMM386 problem + [1412036] Bochs cannot recognize PCI NIC correctly + [435115] dbg: modebp broken and no docs + [1419366] disasm cs:eip does not work anymore + [1419393] SSE's #XF exception -> "exception(19): bad vector" + [1419429] disassembly of "260f6f00" show DS: instead of ES: prefix + [1417583] Interrupt behaviour changed from 2.2.1 to 2.2.5 + [1418281] 'push' (6A) incorrectly disassembled + [1417791] FLDENV generating exception when real hw does not. + [1264583] OS/2 1.1 doesn't run + +------------------------------------------------------------------------- +Changes in 2.2.6 (January 29, 2006): + +- First major SMP release ! + - several APIC and I/O APIC fixes make SMP Bochs booting Windows NT4.0 + or Knoppix 4.0.2 without noapic kernel option in SMP configuration. + - critical APIC timer bug fixed + - obsolete SMP BIOS images removed (MP tables created dynamicaly) + - determine number of processors in SMP configuration through .bochsrc + new .bochsrc option 'CPU' allows to choose number of processors to emulate + - new configure option --enable-smp to configure Bochs for SMP support, + the old --enable-processors=N option is deprecated +- CPU and internal debugger fixes + - enabled #PCE bit in CR4 register, previosly setting of this bit + generated #GP(0) fault + - enabled LAHF/SAHF instructions in x86-64 mode + - fixed bug in PMULUDQ SSE2 instruction + - fixes in Bochs debugger +- Configure and compile + - enable VME (virtual 8086 mode extensions) by default if cpu-level >= 5 + - enable Bochs disassembler by default for all configurations + - win32 installer script improvements + - ips parameter moved to new 'CPU' option + - show IPS value in status bar if BX_SHOW_IPS is enabled +- Other + - several fixes in the hard drive, keyboard, timer, usb and vga code + - new user button shortcut "bksl" (backslash) + - updated Bochs instrumentation examples + - user and development documentation improved + +------------------------------------------------------------------------- +Changes in 2.2.5 (December 30, 2005): + +Brief summary : +- added virtual 8086 mode extensions (VME) implementation +- several fixes/improvements in x86-64 emulation, debugger and disassembler +- new serial mode 'socket' connects a network socket +- IDE busmaster DMA feature for harddisks and cdroms completed and enabled +- many improvements in Bochs emulated I/O devices (e.g. floppy, cdrom) +- Updated LGPL'd VGABIOS to version 0.5d + +Detailed change log : + +- CPU + - fixed XMM registers restore in FXRSTOR instruction (Andrej Palkovsky) + - print registers dump to the log if tripple fault occured + - fixed PANIC in LTR instruction (Stanislav) + - added virtual 8086 mode extensions (VME) implementation, to enable + configure with --enable-vme (Stanislav) + - flush caches and TLBs when executing WBINVD and INVD instructions + - do not modify segment limit and AR bytes when modifying segment + register in real mode (support for unreal mode) + - fixed init/reset values for LDTR and TR registers + - reimplemented hardware task switching mechanism (Stanislav) + - generate #GP(0) when fetching instruction cross segment boundary + +- CPU (x86-64) (Stanislav Shwartsman) + - implemented call_far/ret_far/jmp_far instructions in long mode + - fixed IRET operation in long mode + - fixed bug prevented setting of NXE/FFXSR bits in MSR.EFER register + - implemented RDTSCP instruction + - do not check CS.limit when prefetching instructions in long mode + - fixed masked write instructions (MASKMOVQ/MASKMOVDQU) in long mode + - fetchdecode fixes for x86-64 + +- APIC + - Fixed bug in changing local APIC id (Stanislav) + - Fixed reading of IRR/ISR/TMR registers (patch by wmrieker) + - Implemented spurious interrupt register (Stanislav, patch by wmrieker) + - Fixed interrupt delivery bug (anonymous #SF patch) + - Correctly implemented ESR APIC register (Stanislav) + +- Bochs debugger + - Fixed bug in bochs debugger caused breakpoints doesn't fire sometimes + (Alexander Krisak) + - watchpoints in device memory fixed (Nickolai Zeldovich) + - new debug interface to access Bochs CPU general purpose registers + with support for x86-64 + +- Disassembler (Stanislav Shwartsman) + - Fixed disassembly for FCOMI/FUCOMI instructions + - Full x86-64 support in disassembler. The disassembler module extended + to support x86-64 extensions. Still limited by Bochs debugger which + is not supporting x86-64 at all ;( + +- I/O devices (Volker) + - general + - memory management prepared for large BIOS images (up to 512k) + - slowdown timer sleep rate fixed (now using 1 msec on all platforms) + - some device specific parameter handlers moved into the device code + - serial + - new serial mode 'socket' connects a network socket (#SF patch by Andrew Backer) + - hard drive / cdrom + - assign a unique serial number to each drive (fixes harddrive detection + problems with Linux kernels 2.6.x: "ignoring undecoded slave") + - geometry autodetection for 'flat' hard disk images added. Works with + images created with bximage (heads = 16, sectors per track = 63) + - ATAPI command 'read cd' implemented, some other commands improved + - cdrom read block function now tries up to 3 times before giving up + - emulation of raw cdrom reads added, some other lowlevel cdrom fixes + - IDE busmaster DMA feature for harddisks and cdroms completed and enabled + - disk image size limit changed from 32 to 127 GB + - split ATA/ATAPI emulation code and image handling code + - floppy + - fixes for OS/2 (patch by Robin Kay) + - disk change line behaviour fixed (initial patch by Ben Lunt) + - end-of-track (EOT) condition handling implemented + - more accurate timing for read/write data and format track commands using + a motor speed of 300 RPM + - timing of recalibrate and seek commands now depends on the step rate, + date rate and the steps to do + - floppy controller type changed to 82077AA + - cmos + - RTC 12-hour and binary mode implemented + - number of CMOS registers changed from 64 to 128 + - bochsrc option 'cmosimage' improved + - save cmos image on exit if enabled + - speaker + - simple speaker support for OS X added (patch by brianonn@telus.net) + - pci + - BeOS boot failure fix in the PCI IDE code + - don't register i/o and memory regions during PCI probe + - vga + - memory allocation for vga extensions fixed + - usb + - some bugfixes by Ben Lunt (mouse and keypad are usable now) + - networking modules + - VDE networking module now enabled on Linux + +- display libraries + - general + - new syntax for the userbutton shortcut string and more keys supported + - win32 + - fixed keycode generation for right alt/ctrl/shift keys + - runtime dialog is now a property sheet + - x11 + - simple dialog boxes for the "ask" and "user shortcut" feature implemented + - Slovenian keymap added (contributed by Mitja Ursic) + +- configuration interface + - ask dialog is now enabled by default for win32, wx and x display libraries + - bochsrc option floppy_command_delay is obsolete now (floppy timing now based + on hardware specs) + - floppy image size detection now available in the whole config interface + - some device specific parameter handlers moved into the device code + - calculate BIOS ROM start address from image if not specified + +- System BIOS (Volker) + - PCI i/o and memory base address initialization added + - several keyboard interrupt handler fixes (e.g. patch by japheth) + - several floppy fixes (e.g. OS/2 works with patch by Robin Kay) + - some more APM functions added + - Updated LGPL'd VGABIOS to version 0.5d + - generate SMP specific tables dynamicly by the Bochs memory init code + +- SF patches applied + [1389776] Disk sizes over 64 Gbytes by Andrzej Zaborowski + [1359162] disasm support for x86-64 by Stanislav Shwartsman + [857235] task priority and other APIC bugs, etc by wmrieker + [1359011] build breaks for 386 + debugger + disasm by shirokuma + [1352761] Infinite loop when trying to debug a triple exception + [1311170] small APIC bug fix (interrupt sent to the wrong CPU) + [1309763] Watchpoints don't work in device memory by Nickolai Zeldovich + [1294930] change line status on floppy by Ben Lunt + [1282033] SSE FXRESTORE not working correctly by Ondrej Palkovsky + [816979] wget generalizations by Lyndon Nerenberg + [1214886] No more pageWriteStamp / unified icache by H. Johansson + [1107945] com->socket redirection support by Andrew Backer + +- these S.F. bugs were closed + [669180] win95 install : unknown SET FEATURES subcommand 0x03 + [1346692] bochs 2.2.1 VGA BIOS error + [1354963] floppy in KolibriOS + [1378204] error: bochs-2.2.1, --enable-sb16, --disable-gameport + [1368412] VDE problems in BOCHS + [533446] CPU and APIC devices appear twice + [1000796] bximage fails to create image of specified size + [1170793] Quarterdeck QEMM doesn't work + [923704] Multiple opcode prefixes don't reflect Trap 13 + [1166392] DocBook/documentation issues + [1368239] broken grater than 4GB size of sparse type hd image + [1365830] i386 compile breaks on paging + [427550] Incomplete IRETD implementation + [1215081] MSVC workspace STILL not fixed + [736279] Jump to Task + [1356488] FD change fail & occur error + [957615] [CPU ] prefetch: RIP > CS.limit + [1353866] not booting linux-2.6.14 + [1351667] load32bitOSImage does not work with --enable-x86-debugger + [1217476] Incorrect (?) handling of segment registers in real mode + [1184711] OS2 DOS crash [2.2.pre2] + [624330] support for disks > 32GiB + [1348368] bochs 2.2.1 bximage error + [1342081] Configuration Menu option failed + [1138616] OS/2 Warp 4 hangs when booting + [1049840] mouse and video conflict + [1164570] Unable to perform Fedora Core 4 test 1 installation + [1183201] Windows 2000 (MSDN build 2150?) does not completely install + [1194284] Can't boot from CD-ROM (Windows NT) + [962969] Windows NT crashes while trying to intall them. + [1054594] WinXP install halts (redo) + [1153107] Windows XP fails with BSOD on 'vga' + [938518] Win XP installation fails + [645420] getHostMemAddr vetoed direct read + [1179985] MS XENIX: >>PANIC<< VGABIOS panic at vgabios.c, line 0 + [1329600] WBINVD and INVD should flush caches and TLB + [638924] eliminate BX_USE_CONFIG_INTERFACE + [1048711] Funny behaviour with CTRL + [1288450] keyboard BIOS error + [1310706] Keyboard - about key SHIFT + [1295981] Ubuntu 5.04 Live-CD won't boot in Bochs + [879047] APIC timer behavior different before reset and after + [1188506] I still can't install the german Windows XP! + [1301847] Windows XP dosn't boot - FXRSTOR problem ? + [661259] does not boot QNX under WinX + [924412] Keyboard lock states all whacked + [681127] MIPSpro compiler (IRIX) is allergic to ^M + [1285923] BIOS keyboard handler + [516639] ATA controller revisited... + [657918] does not boot BeOS under WinX + [649245] BeOS CD locks halfway on boot + [1094385] Attachment for bug 1090339 (beos failure) + [1183196] BeOS 4.5 developer CD does not install + [1090339] BeOS fails to boot + [639484] panics when int 13 is called + [711701] divide by zero + [704295] ATAPI/BIOS call missing + [682856] hard drive problems + [627691] Cursor keys problem + [588011] keyboard not working + [542260] os/2 warp crashes with floppy handling + [1273878] SB16 doesn't work in pure DOS + [542254] OS/2 FDC driver dies + [1099610] Windows 98 SE Does not install + [875479] cr3 problem on task switch + [731423] NE2000 causing PANIC on Win2K detection + [1156155] bochs fails to boot plan9 iso + [1251979] --enable-cpu-level=3 should assume --without-fpu + [1257538] Interupt 15h 83h - set wait event interval + [658396] Panic for DR DOS emm386 + [679339] /? doesn't divulge Bochs command-line syntax + [1167016] call/jump/return_protected doesn't support x86-64 + [1252432] Mac OS X compile bug + [881442] Bochs 2.1 PANIC when loading DOS Turbo Pascal protected mode + [1249324] Boch2.2.1 Buffer Overfollow in void bx_local_apic_c::init () + [1197144] 'make install' has dependency on wget + [1079595] LTR:386TSS: loading tr.limit < 103 + [1244070] Compilation Error in gui/rfb.cc + [761707] CPU error when trying to start Privateer + [517281] Crash running Privateer in DOS... + +------------------------------------------------------------------------- +Changes in 2.2.1 (July 8, 2005): + +- Fixed several compilation warnings and errors for different platforms (Volker) +- Fixed FPU tag word restore in FXRSTOR instruction (Stanislav) +- Added missing scancodes for F11 and F12 to BIOS translation table (Volker) +- Bochs disassembler bugfixes (h.johansson) +- About 5% emulation speed improvement (h.johansson) +- Handle writing of zero to APIC timer initial count register (Stanislav) +- Enable Idle-Hack for 'TERM' GUI (h.johansson) +- Reduced overhead of BX_SHOW_IPS option to minimum. Now every simulation + could run with --enable-show-ips without significant performance + penalty. (Stanislav) +- Fixed pcipnic register access (Volker) +- Limited write support for TFTP server in 'vnet' networking module added (Volker) +- Changed some timing defaults to more useful values (Volker) +- WinXP/2003 style common controls now supported (Vitaly Vorobyov) +- Updated LGPL'd VGABIOS to version 0.5c (Volker) +- Added new BX_INSTR_HLT callback to instrumentation (Stanislav) + +------------------------------------------------------------------------- +Changes in 2.2 (May 28, 2005): + +Brief summary : +- New floating point emulator based on SoftFloat floating point + emulation library. +- improved x86-64 emulation +- Cirrus SVGA card emulation added +- status bar with indicators for keyboard, floppy, cdrom and disk (gui dependant) +- many improvements in Bochs emulated I/O devices (e.g. PCI subsystem) + +Detailed change log : + +- CPU + - fixes for booting OS/2 by Dmitri Froloff + - fixed v8086 priveleged instruction processing bug (was also reported + by LightCone Aug 7 2003) + - exception process bug (was reported by Diego Henriquez Sat Nov 15 + 01:16:51 CET 2003) + - segment validation with IRET instruction + - CS segment not present exception processing with IRET + - several fixes by Kevin Lawton + - add MSVC host asm instructions (patch by suzu) + - fixed bug in HADDPD/HSUBPD (SSE3) instructions + - fixed bug in float to integer SSE/SSE2 convert instructions + - fixed BCD instructions implementation + - execution speed improvements (sshwarts and psychosmur) + - fix MSR_APICBASE base address (Kangmo Kim, Christian Neubert) + - change BX_PANIC messages to BX_INFO when behaviour exactly + matches Intel docs + - EIP > CS.limit case should always cause #GP(0), even in real mode. + Fixed all jump, call and ret instructions for 16/32 modes + - fixed using invalid segment register for MOV instruction (h.johansson) + - fixed ET bit mismatch between CR0 and SMSW instruction + - fixed possible simulator #DIVZERO fault when executing IDIV instruction + - fixed undocumented flags handling for BTS, BTR, SHR, SHLD, MUL and IMUL + instructions (Stanislav Shwartsman) + - added missed #GP(0) exception when loading incorrect flags combination + to CR0 (Stanislav Shwartsman) + - in case of --enable-ignore-bad-msr enabled read ignored MSRs as zero + - enabled #DE, #TSD and #MCE bits in CR4 register, previosly setting + of one of these bits generated #GP(0) (Stanislav, Volker Ruppert) + - exceeding the instruction length limit of 15 bytes (this only can + occur when redundant prefixes are placed before an instruction) + generate #GP(0) (Stanislav Shwartsman) + - corrected PAE functionality + +- CPU (x86-64) + - fetchdecode fixes for x86-64 and 3DNow! (Stanislav) + - fixed CF flag handling for SHL instruction in x86-64 mode (Stanislav) + - implemented CR8 register (aliased to APIC.TPR[7:4]) (Stanislav) + - implemented NXE bit (No-Execute page protection) support (Stanislav) + - STOSQ instruction emulation fixed (Avi Kivity) + - allow null SS selector for MOV SS, POP SS, and LSS instructions + in long mode (Avi Kivity) + - ignore segment bases for all segments (except FS and GS) in long + mode (Avi Kivity) + - allow SYSENTER/SYSEXIT instructions together with x86-64 (Stanislav) + - canonical address checking for RIP (Stanislav) + +- FPU (Stanislav Shwartsman) + - totally rewritten all FPU code based on softfloat library + - significantly improved accuracy of all floating point + instructions. + - implemented all missed P6 and PNI floating point instructions. + - hundreds of bug fixes in FPU code. + + TODO: + ! Unmasked underflow/overflow should correct the result + by magic number for all operations, including float32 + and float64. + +- APIC (Zwane Mwaikambo) + - APIC arbitration + - Processor priority + - Various interrupt delivery fixes + - Focus processor checking + - ExtINT delivery + +- Disassembler + - fixed MOV opcode 0x88, had exchanged the operands (h.johansson) + - fixed MOV opcode 0xA3, had wrong operand size (h.johansson) + - fixed BOUND opcode 0x62 (Stanislav) + - fixed CALLW opcode 0xFF /3 and JMPW opcode 0xFF /5 (Stanislav) + - fixed INS opcode 0x6D, had wrong operand size (Stanislav) + - fixed disassembly for repeatable instructions (Stanislav) + - fixed sign-extended immediate opcodes (Stanislav) + - fixed MOVSS/MOVSD instructions opcode names (Stanislav) + - fixed NEG instruction opcode name (Stanislav) + - fixed CMPXCHG8B instruction, had wrong operand size (Stanislav) + - fixed floating point instructions operands (Stanislav) + - experimental support of AT&T syntax in disassembler (Stanislav) + +- I/O devices + - general + - handle cpu reset through port 0x92 + - new memory handler API for PCI i/o and memory handling (Frank Cornelis) + - speaker emulation for Linux (David N. Welton) and Win32 (Volker Ruppert) added + - pci + - PCI slot configuration added for 5 slots (Volker) + - PCI irq routing, irq sharing and level sensitive irq mode implemented + - ne2k device appears as a Realtec 8029 NIC if connected to a PCI slot + - PCI IDE controller dummy device added + - PCI host device mapping for Linux (Frank Cornelis) + - PCI Pseudo-NIC emulation (Michael Brown) + - serial + - multiple serial port support added (4 ports now available) + - partial raw serial support on win32 (transmit data) + - serial port i/o mode option added (modes: null, file, term, raw, mouse) + - parallel + - multiple parallel port support added (2 ports now available) + - mouse + - serial mouse support (Volker) + - PS/2 and serial wheel mouse support (Ben Lunt) + - usb + - USB mouse and keypad support (Ben Lunt) + - config option to specify devices connected to USB ports + - vga + - VBE 8 bit DAC support added + - VBE memory now registered using DEV_register_memory_handlers() + - CL-GD 54xx SVGA emulation added (Makoto Suzuki) + - vga extension option added (choices: vbe, cirrus, none) (Volker) + - floppy + - raw floppy access now works on Win9x host (Ben Lunt) + - sb16 + - MacOSX sound support (Brian Huffman) + - networking modules + - new: 'eth_vnet' simulates ARP, DHCP, ICMP-echo and read-only TFTP + (m_suzu, easeway) + - new: 'eth_vde' for Virtual Distributed Ethernet (Renzo Davoli) + +- System BIOS + - turn floppy motor off 2 seconds after last read/write/recalibrate command + (Ben Lunt) + - int13_cdrom / 32 bit register update fixes for FreeBSD cdrom boot + (Fabrice Bellard) + - APM and system shutdown support (Fabrice Bellard) + - checksum calculation for expansion ROMs + - extended floppy parameter table (Mike Nordell, Derek Favcus) + - PCI IRQ initialisation added + - boot sequence with up to 3 boot devices added + +- display libraries + - status bar with indicators for cdrom, floppy, harddisk and keyboard added + (done in rfb, sdl, win32, wx and x) + - 3rd (middle) mouse button now supported (rfb, sdl, win32, wx, x) + - mouse wheel support (sdl, win32, x) + - CTRL key + middle mouse button now used to toggle the mouse capture mode + (sdl, win32, wx, x) + - text mode split screen feature added (sdl, win32, wx, x) + - new gui function returns the display library capabilities (xres, yres, bpp) + for the Bochs VBE support + - display library specific options added - currently supported: + rfb: timeout (time to wait for client connection) + sdl: fullscreen (startup in fullscreen mode) + win32: legacyF12 (use F12 to toggle mouse) + - new graphics update API added (used by svga_cirrus) (Robin Kay) + +- configuration interface + - win32: gui runtime dialogs replace textconfig runtime dialogs + - set default IPS to 10000000 in .bochsrc sample + - SB16 options dmatimer and loglevel now available at runtime + +- configure script / compile + - --enable-ignore-bad-msr (ignore bad MSR references) option is enabled + by default + - --enable-mmx enabled by default only if cpu-level >= 5 + - --enable-4meg-pages will be enabled by default if cpu-level >= 5 + - fixes for Solaris SunPro (Robin Kay) + - --enable-pni option added + - --enable-show-ips option added, enable Instruction Per Second counter + in log file + - autodetection for lowlevel sound support added + +- documentation + - a bunch of updates in user and documentation docs (Alexander Schuch) + +- SF patches applied + [894595] MSR_APICBASE always returns APIC ADDRESS 0 by Kangmo Kim + [907163] ctrl_xfer8 clean/speed up + [907161] clean/speed up of io.cc + [899972] data xfer performance patch V 2.0.4 + [904549] imul gives incorrect result in long mode + [877510] amd64 fixes... + [903465] SEGV in iodev/ne2k.cc line 1211 on Alpha architecture by Christian Lestrade + [903332] copy the bximage result to clipboard, etc by Lukewarm + [950905] Do not PANIC on rare, bad input from user-mode by h.johansson + [924428] ET bit mismatch between CR0 and MSW + [869822] a real SVGA implementation by m_suzu + [867045] fix for compiler errors on VC++ by m_suzu + [838601] support for the over 2GB disk size with MSVC++ + [874816] local ARP/ping/DHCP simulator by m_suzu + [976066] Keyboard: Get controller version by Ben Lunt + [832330] ROMBIOS improvement (reduce stack consumption, etc.) + [977900] READ_CDROM_TOC and base address by Ben Lunt + [961665] WinXP patch to read physical CDROM's TOC by Ben Lunt + [978793] CDROM_SENSE_MODE medium_type by Ben Lunt + [615457] gif to png migration + [1021767] Portability in sb16ctrl.c by Robert Millan + [690400] gzip is confused by GZIP variable in Makefile + [567595] guess floppy image size from image file length by Tal Benavidor + [888426] bochsrc to make vnet useful by m_suzu + [1021758] GNU/k*BSD host support by Robert Millan + [969967] int 15/ah=87h clearing cr0 by Ben Lunt + [1048327] Russian Keymap by Dmitry Soshnikov + [851332] DESTDIR support for install_dlx by Ville Skytt + [970929] gdbstub support for MinGW tool chains by Muranaka Masaki + [1021740] Turn gdb stub into a runtime option by Charles Duffy + [1063329] RFB key press/release bug fix by Remko van der Vossen + [1079240] Wheel Mouse by Ben Lunt + [1087537] Fix for Win9x CD boot by lukewarm + [1083218] Start of wheel for USB #2 by Ben Lunt + [1098480] bochsrc: fixed floppya example by Alexander Schuch (ci-dev) + [1094407] configure.in: changed wxWindows to wxWidgets by Alexander Schuch + [1092058] serial.cc debug output cleanup by Ben Lunt + [1101165] APIC base address by Christian Neubert (flashburn) + [1093796] Fix for bug #1093786 (Nigel Horne) + [1082584] The start of Bus mice and USB mice by Ben Lunt + [1104695] msvc6 compatibility update (Royce Mitchell III) + [1059199] VGA text font bug fix (Anonymous) + [1108001] Null pointer on bx_atexit() (Ben Lunt) + [1112093] Fixed mouse cursor remain area drawing (Anonymous) + [1114826] Fix PCIBIOS (Destruction prevention of esi and edi) + [1095473] Reading from a CDRW (Fixed) by Ben Lunt + [1123895] x86-64 gdb/debugger fixes by Avi Kivity + [1145423] stosq simulation bugfix by Avi Kivity + [1151012] allow null ss on x86-64 by Avi Kivity + [1153327] ignore segment bases in x86-64 by Avi Kivity + [1153511] Fixed broken screen update (VBE) + [1152808] use 'install' instead of 'cp' during installation by Avi Kivity + [1159626] bugfix [1156776] keyboard scanmode fault by Rene Kootstra + [843328] PATCH: support for Flat-style ToolBar with Win32GUI + [1198308] PATCH: fix incorrect moving mouse cursor when wheel used + [1200515] add TFTP server to vnet & ipv4 bug fix by easeway + [1203305] tuntap incompatibility by Jan Kratochvil + +- SF patches partially applied + [896733] Lazy flags, for more instructions, only 1 src op + [1005422] Improve mouse cursol Grub when 2 buttons-mouse use (WIN32) + (TODO: improved japanese keyboard support) + +- patches applied + - patch.rombios.markevich (Start/Stop Wait Timer) (Kory Markevich) + - patch.apic-zwane (APIC fixes) (Zwane Mwaikambo) + - patch.v8086-exception.lightcone (LightCone) + +- these S.F. bugs were closed + #957660 >>PANIC<< APIC: R(curr timer count): delta < initial + #1192654 60 x 90 text not quite right... + #1189097 "configure --with-sdl --with-rfb" doesn't compile + #1188980 Crash on XP when break into debugger + #1186693 Improving quality of ./configure --help + #1185245 Errors Making Bochs with Mingw32 + #1185289 PSE is not enabled by default on Pentium + #1170620 info cpu scrolls away, is too long + #1157998 ips shown even when waiting for input + #663108 APIC Timer Bug + #831750 bochs unlike real PC in paging + #1182698 PAE support doesn't work + #954400 debugger causes segfaults when gcc 3.4.0 is used + #1171312 Possible SMP problem with ICACHE pageWriteStamp + #1179964 PANIC: RIP>CS.limit when jumping to longmode + #1171067 configure fails to add -lpthread + #1171065 Term UI needs -lncurses + #1171061 SDL GUI startup failure + #1022056 win32 error build debug version..c2146 + #957190 error while attempting to compile sb16.cc + #804797 Debugger: visualization problem (jmp) + #675523 2.0.1 doesn't run on W2K? + #1167358 When using 5430PCI in DR-DOS Bochs would panic with a PUSHAD + #1164654 Bochs VBE bios causing exception 0B in Windows 95 (SVGA bios) + #1162983 conflicts which configure could detect + #1164536 Windows 95 B crashes during install + #526978 cygwin: in an rxvt, stdout is flaky + #542303 >>PANIC<< call_protected: CS selector null + #859457 BRICKS game doesn't work + #1159639 text modes on address A0000-BFFFF are not handled properly + #1164225 define BX_SUPPORT_X86_64 0 + #1163720 ROL bug + #1156776 keyboard scanmode fault + #1162042 Duke Nukem 3D: >>PANIC<< iret: VM set on stack, CPL!=0 + #1161945 ctrl_xfer32 compile/make error + #1157124 Bochs doesn't run with large amounts of memory in bochsrc + #1154266 weird INT handling in V86 mode + #1157051 default Bochs CVS doesn't work-out-of-the-box + #923954 enter() with level > 0, >>PANIC<< iret: return CS selector + #1098476 Privilege Problem after SYSEXIT + #1121734 Bochs crashes when shutting down Win95 + #1099294 VESA for Win98 bogus + #1112836 PGE-Bit crashes Bochs + #947586 The specification difference in x86-64 emulation + #1117145 Push reset Button, APIC0 Error occur + #1123043 fpu stack pointer changed *despite* fault occured (e.g. #pf) + #1122066 PANIC: iret: IP > descriptor limit when installing os/2 warp + #809574 rm -f segfaults + #593952 SuSE rm segfaults + #929783 floppy not recogniced since 2.1 + #1099298 SB16 for Win98 Bogus + #1079483 Reading from a CDRW + #549793 flaw in interrupt gate handling(exception.cc) + #692055 SMP Error + #805479 Booting from disk causes illegal instruction warnings + #909677 pc-speaker doesn't work + #831751 behaviour unrealistic + #661213 CR4.TSD is broken + #685508 PANIC: prefetch: RIP > CS.limit + #1037923 Non-executable page support missed (NX bit, x86-64) + #1106530 wrong disassemble result + #1105208 drive order for boot gets saved wrong + #661060 Problem with Win98SE + #837377 Norton Ghost don't boot + #876689 Unknown register 0x17 [CPU] / WIN98SE + #947282 Bochs segfault + #963317 Persistent Win98SE + #1101168 APIC base address change + #680737 panic when installing winme + #1097187 Install FC3 on bochs-win failed + #875461 vgabios-lgpl should be default + #594797 Bochs segfaults + #602994 bochs breaks boot kernel + #571539 FreeBSD Install from CD Fails + #774257 Device doesn't work under W98 + #759228 Installing Suse 8.2 in Bochs on WinME + #792561 cant boot freebsd 5.1 from cdrom + #804004 Live cd will halt on boot.. + #956173 FreeBSD won't boot iso install images in Bochs v2.1 or 2.2. + #864401 >>PANIC<< jmp_ev: IP out of CS limits! + #853831 Error on int 15h + #1094150 DR-DOS 7.03: panics when using multitasker + #655592 win98 hardwaredetection + #1093786 Solaris 9 installation CD fails + #959585 USB UHCI IO-Device + #963314 Redhat Fedora Installer Kernel Panic and Crash + #1086920 Bochs (cvs) doesn't compile on FreeBSD 5 + #879050 Bochs reports enabled APIC without support + #1071199 dBaseII cause prefetch: RIP > CS limit + #1070812 typecast error while compiling wx.cc + #1068786 FSINCOS Cos value wrong at 90 degrees + #675248 Panic: EIP > limit on win98 install + #829793 [CPU ] prefetch: RIP > CS.limit + #1034059 >>PANIC<< prefetch: running in bogus memory + #1067813 pbm fpu_proto.h:144 ebuild gentoo bochs 2.1.1 + #922034 bios not aliased at 0xFFFFF000, registers wrong after reset + #912666 Configure fails on Yellow Dog Linux 3.0.1 + #922038 Unexisting memory should read back as 0xFFFFFFFF + #1019723 HD image + #1057814 Shadow RAM not aligned + #1057240 Invalid IRET32 implementation + #809682 >> PANIC << : prefetch: RIP > CS.limit + #618680 memory referencing problems + #724262 A few things (Windows 2.03, Wolfenstein) + #985375 Crash Mandrake 7.1 + #913418 compiler errors with --enable-external-debugger option + #708847 CR8 access should not panic X86-64 + #1039499 Compile error pcipnic.cc (cygwin) + #978024 compile against wxGTK-2.5.2 fails + #639073 MacOSX: Networking not implemented + #639074 MacOSX: Soundblaster not implemented + #963264 Latest CVS --enable-pcidev fails to configue on YDL Linux + #586282 Mac OS X, will not "make" + #699532 CVS (as of 2003/03/07) cannot read disk images + #639275 wrong more than 2GB size DVD-ROM + #766020 info registers / dump_cpu get old eflags + #655920 QuickBasic (qbx.exe) panics + #676188 Error BX_MAX_DIRTY_PAGE_TABLE_MEGS + #923821 LOCK not generating exceptions properly + #1007747 Wrong configure? + #1022577 show "call" command crashes bochs every time + #681849 SuSE 8.1 Compile problem + #660322 Install bochs 2.0 on SuSe 8,0 + #1022587 "Unrecognized args" message wrong after invalid show command + #833118 TUN/TAP interface bug + #1022178 tuntap module mangles incoming broadcast packets + #1028682 Report incorrect disk parameters of floppy + #1026234 make fails on Cygwin because of missing .exe extension + #1026241 --enable-cpp needed for .conf.win32-cygwin + #855323 BIOS Panic at rombios.c, line 1563 + #762773 ROM checksum is not checked in rom_scan_loop + #657604 concat_image_t.lseek to byte -1378816 fa + #800140 No AH=83h INT15h implemented + #831965 Win32.zip BIOSes in wrong directory + #873280 bximage crashes after createing "growing" + #892223 bochsrc-sample.txt/vgaromimage option error + #1014361 Bximage on WinXP won't create image + #651510 bximage won't create larger than 2GB + #759206 bximage fails on Win32 for hd images over 2Gb + #759210 Bochs fails on image files over 2Gb on Win32 + #799785 bximage doesn't work + #903345 Problem compiling harddrv.cc + #933303 Bochs cannot lseek() HD images > 2GB on W32 platforms + #888438 bximage crashes...(hacked fix included) + #871720 bximage 2GB file size limit + #930368 Can't create big hard drives (>2 GB) + #912496 IDIV can cause simulator divide error + #522111 Host os SIGILL, booting grub from hd + #1005052 DMA Controller Model Problem + #552939 Bochs window doesn't resize when win311 + #989478 I-Cache and undefined Instructions + #661008 make install fails + #845691 Workaround: Ne2k and Windows 2000 not working + #923662 BIOS diskette motor countdown byte broken + #848141 VGA problems running Scitech Display Driver on Win95 + #799370 Problem booting ReactOS 0.1.3 + #670143 No rule to make config.h + #653444 with vbe/lgpl bios, scrn updates broken + #655696 quickstart broken? + #659350 FDC + #620853 Ne2000 ethernet card *NOT* supported + #607611 Numlock + #543476 Sound card does not work in Windows 95 + #529554 unsupported VBE features DISPI update + #487316 Access violation on Win32 + #576253 RTC too fast + #489748 io read from address 000003c0, len=2 + #656861 Gentoo Linux panics in VGA code + #787184 Video BIOS's don't checksum correctly + #988529 textconfig [Save options to] function output obsolete option + #987293 Cannot accesss header/toolbar + #988246 floppy read error + #933199 speedup Bochs compilation 4x -> suggestion + #979106 Incorrect disassembly table entry + #658374 FPU incorrect emulation + #706933 Problem with the F12-Key + #477043 math_abort panic in RH 7.1 + #634371 Floating point problems + #681138 // is not valid in C + #643300 cpuid feature flag 15, cmov and fcmov + #913697 missing division by 0 exeption in fpu emuation + #923682 FSTENV/FINIT problems + #923855 FPTAN doesn't work right with full NPX stack + #924379 ET bit mismatch between CR0 and MSW + #716116 Direct floppy access + #962919 Mac: iodev/cdrom.cc disordered + #954751 Two FPU.CPP in project + #954359 Compile faile is 3dnow support is selected without SSE support + #906412 FreeSCO error + #942060 FDC Controller not conforming to specifications + #938522 Win XP installation fails + #923613 BOUND instruction exception handling is broken + #923223 memtest86 errors + #593342 autoconf script doesn't regenerate clean + #616116 Crash on exit... + #922042 shutdown through port 92 does not work + #891633 02839990390p[CPU0 ] >>PANIC<< RDMSR: Unknown register 0x17 + #923653 DAA instruction is broken + #911225 obscure AAA / AAS bugs + #837206 Problems with numerical keys + #658765 BOCHS halts in runtime config + #890734 Bochsrc Parser Bug with commas included in strings + #877285 MSR_APICBASE zero upon startup + #526984 SDL compiled in cygwin just quits + #886406 I/O permissions bug + #883239 undefined symbols in gui/siminterface.h:1215 + #419647 on OSF1, cxx hates C++ inlines + #809790 "No rule to make target `devices.cc?..." + #873654 How compile without plug-in support ? + #837161 Test case for BX_CPU_C::IRET32 + #888116 mmx.cc compile error + +------------------------------------------------------------------------- +Changes in 2.1.1 (February 8, 2004): + +- fix bug in int15h function 0xe820 (Christian Neubert) +- fix vmware3 disk support on big-endian platforms (Christophe Bothamy) +- fix conditions for NM exception on FWAIT instruction (Christophe) +- fix symbol conflict in rfb and x display libraries (Volker Ruppert) +- allow 16 bit writes to ne2k page 0 (Kenneth Stailey) +- notify display libraries on change of bpp (Volker) +- fix bug in int13h function 0x10 (Volker) +- fix floppy dialog error on win2k (Volker) +- fix adress check in TSS IO permission bitmap (Christophe) +- fix buffer overflow vulnerability pointed out by SeSoX (Christophe) +- updates for MacOS compile (Daniel Gimpelevich) + +------------------------------------------------------------------------- +Changes in 2.1 (January 9, 2004): + +Brief summary : +- New disassembler +- 3DNow!/SSE/SSE2/PNI instruction support +- Vmware3/Sparse/Undoable/Growing harddisk images support +- many VGA emulation improvements (e.g. high/true color VBE modes added) +- No more X11 vga font required + +Detailed change log : + +- CPU + - added emulation of AMD 3DNow! instructions set. (Stanislav Shwartsman) + Bochs now could decode all AMD 3DNow! instructions. + Most of instructions still not implemented, but the basis already presents. + Configure --enable-3dnow to enable 3DNow! support. + Notes : + - These instructions are not implemented yet: + PFPNACC_PqQq, PF2IW_PqQq, PFNACC_PqQq, PFCMPGE_PqQq, PFMIN_PqQq, + PFRCP_PqQq, PFRSQRT_PqQq, PFSUB_PqQq, PFADD_PqQq, PFCMPGT_PqQq, + PFMAX_PqQq, PFRCPIT1_PqQq, PFRSQIT1_PqQq, PFSUBR_PqQq, PFACC_PqQq, + PFCMPEQ_PqQq, PFMUL_PqQq, PFRCPIT2_PqQq + - CPUID does not report 3DNow! instruction set. + - added emulation of SSE/SSE2 floating point instructions. (Stanislav) + All SSE/SSE2 floating point instructions are fully implemented using + free softfloat library (including DAZ support and floating point + exceptions). Correctness of the emulation checked with heavily random + testing. + - added emulation of SSE3 (PNI) instructions (Stanislav) + Currently only 3 PNI opcodes still not implemented: + FISTTP m16int, FISTTP m32int, FISTTP m64int + - added P4 CPU support to CPUID instruction. (Stanislav) + - fixed implementation of FXSAVE/FXRSTOR instructions. (Stanislav) + - bugfix: unallowed lock prefix cases must cause #UD exception. (Stanislav) + - fixed fetchdecode bug caused #UD in SYSENTER/SYSEXIT instructions + in 32bit mode. (Stanislav) + - fixed fetchdecode64 bug caused wrong decoding of opcodes containing + BxImmediate_IvIw or BxImmediate_IwIb in x86-64. (Stanislav) + - fixed bug in int01 (opcode 0xF1) emulation. (Vitaly Vorobyov) + - fixed bug in x86 debugger with dr0-dr3 registers (Vitaly) + - fixed bug with mov to/from dr register in v86mode. + (now exception is generated (according to Intel documentation) + instead of panic) (Vitaly) + - fixed stack limit checking, now message is generated as BX_DEBUG, + rather then BX_PANIC, and exception code is executed. (Vitaly) + - instrumentation code updated. (Stanislav) + - fix flaw in IO bitmap permission of TSS (Christophe Bothamy) + - cpu resets on triple fault (Christophe) + - remove calculation on cr3 in dtranslate_linear to increase + emulation speed (Conn Clark) + - numerous x86-64 fixes (Peter Tattam) + +- FPU + - hundreds of bugfixes in FPU emulation after checking of the emulation + with testfloat (Scott Duplichan). + - Fixed cases: + - floatx80_to_int32, floatx80_to_float32 + - floatx80_to_float64, floatx80_round_to_int + - floatx80_add, floatx80_sub, + - floatx80_mul, floatx80_div + - implemented FCMOVcc instructions (Stanislav) + - 64-bit addressing support for x86-64 mode (Peter) + +- Disassembler + - replaced Bochs disassember. New table-based disassembler fully supports + all IA-32 instruction sets including all FPU/MMX/SSE/SSE2/SSE3 opcodes. + (Stanislav) + +- I/O devices + - general + - i/o access mask implemented, unallowed cases are now handled in the devices + code and cause a BX_ERROR (Volker Ruppert) + - include slowdown timer as a runtime option (Christophe) + - netBSD : fix serial, ethernet, cdrom (fredb, uebayasi and David Laight) + - VGA + - color depth 15, 16, 24 and 32 bpp supported by VBE (Volker and + Christopher Nelson for 32 bpp on win32). Supported by sdl, x, win32 and wx. + - SVGA mode 0x6A (800x600x4bpp) implemented (Volker) + - new CGA graphics modes 640x200x1bpp and 160x100x4bpp (text mode 80x100) (Volker) + - raster operations AND, OR and XOR in write mode 2 (based on SF patch #707931) (Volker) + - 'split screen' in standard VGA graphics mode implemented (Volker) + - 'double scan' and 'double width' now handled in the VGA code (Volker) + - more accurate emulation of the horizontal and vertical retrace (Volker) + - changeable start address and variable line length supported by all + graphics modes (Volker) + - VBE: preserve video memory feature implemented (Volker) + - additional text mode features prepared (handled in the display library + code) (Volker) + - PCI + - add experimental PCI VGA card (Mike Nordell) + - add experimental PCI USB card (Ben Lunt) + - Harddisks + - per device selectable harddisk modes : + - undoable, volatile, growing disks support (Christophe) + - sparse disks support (justinSB) + - vmware3 disks support (Sharvil Nanavati) + - fix non detection of hard drives by minix2 (Christophe) + - implement atapi command 0xA8 read (12) (Christophe) + - mode sense command updated (Hartmut Birr) + - sb16 + - opl2 support enhanced (James E. Flemer) + - ne2k + - tap support for FreeBSD (Ronald Klop and Gen Otsuji) + - fix when booting with grub (Keir Fraser) + - cmos + - date/time change support added (Volker) + - UIP bit and divider chain reset implemented (Volker) + - initial time can now be set to local time or utc (Christophe, Daniel Gimpelevich) + - keyboard + - keyboard reset function (0xff) now resets the keyboard (Volker) + - gameport + - new standard PC gameport device (real joystick connected on Linux and + win32 only). Enable it with --enable-gameport or the SB16 emulation (Volker) + - serial + - FIFO emulation (UART type 16550A) implemented (Volker) + - floppies + - 160k,180k,320k floppies support (Ben Lunt) + +- display libraries + - X11 + - onboard vgacard charmap usage (no need for external X11 vga font any more) (Christophe) + - vgacard charmap change support (Christophe) + - fix black stripes on partial exposes (Dirk Thierbach) + - headerbar redraw optimizations (Dirk Thierbach) + - external font files and their installation mechanism removed (Volker) + - belgian keymap support (Wouter Verhelst, Eric Brasseur) + - win32 + wx + x: new application/window icon (bochs.ico / icon_bochs.xpm) (Volker) + - sdl + win32 + wx + x: new textmode features: variable line length, + char width switch, horizontal and vertical pel panning (Volker) + - win32 + wxMSW: key event handling rewritten (Volker) + - win32: status bar at the bottom of the simulation window added (Volker) + - wxMSW: resource problems fixed - wx dll plugin works now without errors (Volker) + - term: variable line length and cursor enable/disable feature implemented (Volker) + - rfb + - textmode: charmap change, better cursor emulation, variable line length (Volker) + - headerbar works now (power, reset and user button are okay) (Volker) + - key event handling rewritten (Volker) + - Bochs-RFB waits up to 30 seconds for a client connection. The emulation + starts after connecting the client. (Volker) + - carbon: Alt/Ctrl/Shift key handling rewritten & SysRq/Ctrl-Break key support added + (Daniel) + +- configuration interface + - gui dialogs as an extension of the textconfig interface on win32 added (Volker) + * ask dialog + * save text snapshot + * user button shortcut + * floppy image change + - wxwindows configuration dialogs improved (Volker, Christophe) + +- support tools + - bximage : added support for + - growing disks (Christophe) + - sparse disks (justinSB) + - created bxcommit tool for undoable disk images (Christophe) + +- System BIOS : + - fixed int15 function e801 (get memory size) (Christophe) + - added int75_handler for FPU Dos Exceptions (Christophe) + - added int16 function 0a (Get Keyboard ID) (Volker) + - added support for ElTorito Harddisk-on-CD emulation (Christophe) + - fixed ATA/Serial ioport conflict (Daniel) + +- VGA BIOS : updated to version 0.4c (Christophe) + +- configure script/compile/porting to other OSes/installation + - fixes for compilation with MSVC (Andrew Zabolotny) + - fixes for cross-compilation (Jeroen Janssen) + - win32 nsis installer script updates (Volker) + - small configure fixes for MacOS (Christophe) + - optimizations & compile fixes for MacOS/X (Daniel) + +- configuration files. The following options have been deprecated : + diskc, diskd, cdromd, time0, pit, newharddrivesupport. + +- documentation + - already ported and obsolete parts of the old documentation removed (Volker) + - user documentation updated and extended : + - improved section "What does Bochs need" (Volker) + - command line arguments (Volker) + - search order for the configuration file (Volker) + - the configuration interface 'textconfig' (Volker) + - FreeDOS Beta 8 installation instructions (Volker) + - disk modes (Christophe) + - LBA translation (Christophe) + - cdboot error codes (Christophe) + - SCO OpenServer install section (Carl Sopchak) + - MacOS-X DMG install guide (Aard Vark) + - update Win98 install guide (Dirk Thierbach) + +- SF patches applied + #658950 Bug in FPU (Anonymous) + #678117 build fail due to bad SGML punctuation (Anonymous) + #671873 minimal USB support (UHCI) (Ben Lunt) + #682539 Fix CapsLock and NumLock behavior (rock at gimp.org) + #720776 REX MOVB immediate broken for x86_64 (Arnd Bergmann) + #729450 new keymap x11-pc-be.map (Wouter Verhelst) + #735990 Limited patches for VC++ (Anonymous) + #742670 fix library dependencies in GUI plugins (Robert Millan) + #742782 LFB bugfix (Jan L. Hauffa) + #748414 load32bitOShack bug (kyriazis at nvidia.com) + #830079 Fix bochs's application error if unsupported key pressed (Anonymous) + #724466 enable building with CC=gcc-3.2 CXX=g++-3.2; dist-clean adds(Leonard Norrgard) + #834962 Fixed drawing graphics is broken (Anonymous) + #838401 Fixed redrawing of ToolBar on Win32GUI (Anonymous) + #850236 Fixed accessing DVD-ROM with direct device access on Win32 (Anonymous) + #847822 Bochs crash when exmining memory that crosses page boundary (ortal at jungo.com) + +- SF patches partially applied + #707931 Support EGA/VGA write mode 2 and others (Anonymous) + already applied: disable IME, split screen, write mode 2, + BIOS INT16h/AH=05h + #856506/#856510 Patch to fix compile-time iodev/cd-rom.cc error (alden.dima at nist.gov) + Correct patch provided in SF bug report #843433 (birkhofer at users.sourceforge.net) + +- patches applied + - patch.highmem (memory allocation) (Zwane Mwaikambo) + - patch.floppy-160k-180k-320k-benlunt (exotic floppies) (Ben Lunt) + - patch.perf-regparm-cclark (performance) (Conn Clark) + +- new patches present in the patches directory : + patch.pipelined-asm-cclark + patch.mingw-resources + patch.v8086-exception.lightcone + patch.pit-vitaly-vorobyov + patch.rombios-vitaly-vorobyov + patch.win32-vitaly-vorobyov + patch.win32-new-files-vitaly-vorobyov.tgz + patch.rombios.markevich + patch.rombios.dirk.thierbach + +- these S.F. bugs were closed + #865354 ">>PANIC<< CRA: divider chain control 0x07" in Linux 1.1 + #725796 configure script bug + #859768 cpuid + #863964 panic in duron 2000 + #843433 cdrom.cc on MacOSX: wrong const names + #818493 EMU][ (DJGPP app running on FreeDOS) broken + #787005 Some MOV instructions are not implemented!!! + #840664 2200136693936p[CPU ] >>PANIC<< prefetch: RIP > CS.limit + #837416 V2 OS not compatible !? + #650917 Serial port broken under win95 + #829863 Make bochs 2.0.2 build with gcc3 + #816971 main.cc: getcwd() missing argument + #813556 Compile error under gcc 3.3.1 + #809758 RIGHT ALT does not function properly + #809695 CVS complains about unknown files after compilation + #628762 Error in Floppy Booting + #474526 Crash under win32 (access violation) + #687619 test case for BX_CPU_C::IRET32 + #664544 Panic in IRET32 - Reporting test case + #637822 test case for BX_CPU_C::IRET32 + #603410 BX_CP U_C::IRET32 + #537047 IRET32 incomplete emulation, panic + #805541 Compile fails on i686, gcc 3.3 + #798829 Problem booting from ISO image + #688163 Panic at rombios.c + #688161 rombios.c crashes when boot from a CD. + #796339 int 15h, e801h broken? + #666946 Slowdown Timer should be a module + #783826 the clock is extremely fast + #645609 Real Time Clock is too *FAST* + #663320 flaw in IO bitmap permission handling + #764929 Timing is off. + #659510 Bochs timing off by x10 + #787138 No ROM BIOS character map + #787134 Config options not saved + #689201 Disassembler bug + #666202 Windows 2000 - random screen blanking with linux DLX demo + #629242 reset during Doom -> BIOS panic + #695434 minix floppies won't boot. + #764473 Freesco Linux crashes on boot + #656026 error when trying to run some stuff + #614202 HD: non-byte IO read to 01f4 + #777357 Strange FPU compiler error + #583758 gag bootloader doesn't run + #658639 ne2k panics with MS lanman Client/DOS62 + #536711 problem running smart bootmanager + #741433 Disabling all ata# results in HD error. + #753200 lock instruction doesn't do an illegal instruction trap + #679389 libbx_wx.so.0: undefined symbol + #758936 Problem Installing Bochs + #742580 I configured fants but bochs still give me the same error + #772242 iodev/vga.cc wrong memory access. + #739222 Cannot change resultion + #693344 libwx_gtk2.3.so.2 RedHat linux 8.0 + #639320 sparc: needs -lm to compile + #587422 Windows 95j doesn't boot + #547817 sparc: rfb needs -lsocket + #480963 RFB: option to wait for client + #763893 i've got problems with a "libvga.so.1" and another file + #766490 Documentation mistake + #766481 Bochs 2.0.2 Fails to compile on YDL3.0 + #626144 %lld is not portable + #752241 lock prefix erronously allowed for some instructions + #743305 fetchdecode.c probs + #658707 Automatic exit? + #696758 BeOS can't mount image disk, won't complete boot. + #737048 Enabling keyboard resets controllers translation mode + #717713 Bochs panics on startup on RH 9 + #741108 VGA PANIC + #730922 seg fault on "bochs boot: cdrom" + #658905 VGA read write error + #564218 Panic on vga_mem_write + #614231 X11 doesn't support charmap change + #708311 Missing CGA low-res emulation + #720776 REX MOVB immediate broken for x86_64 + #643296 lock prefix, unallowed cases + #716964 [sb16] OPL.timer_running not initialized + #662074 little mistake in the default config example + #470701 CD-ROM on Win2K needs FILE_SHARE_READ + #706454 bug?? + #653861 Win32 build bug + #421155 panic on vga read 0x3c7,0x3cb + #666434 VGA BIOS: Incompatible mode reporting + #681819 Incorrent return value from cdrom reads + #648222 Lotus Agenda futuristic dates off + #657455 doesn't boot plan9 + #658938 SGDT in VM8086 + +------------------------------------------------------------------------- +Changes in 2.0.2 (January 21, 2003): + +- fix possible segfault in wxWindows (Volker Ruppert) +- fix instrumentation (Stanislav Shwartsman) +- fix cdrom read_toc() function for *BSD (Keith Matthew Jones) +- fix NetBSD boot from cdrom (Christophe Bothamy) +- fix cmos checksum (Volker) +- fix "refresh bit" behaviour in pit (Volker) +- fix .bochsrc parsing (Volker) +- fix vga resize/redraw problems (Volker) +- fix compilation issues on Irix and Tru64 (Christophe) +- fix MMX/SSE bugs (Stanislav, Peter Tattam) + +------------------------------------------------------------------------- +Changes in 2.0.1 (January 4, 2003): + +- fix corrupt saved configuration files (Christophe Bothamy) +- fix missing break statements in apic (Shai Fultheim) +- fix compiling sb16 under FreeBSD (Volker Ruppert) +- updates to the documentation (Volker) +- fix text mode colors 8 to 15 (Volker) +- fix FPU integer load bug (Volker) +- stop pasting on hardware reset (Volker) + +------------------------------------------------------------------------- +Changes in 2.0 (December 21, 2002): + +Since the change log is hundreds of lines long, here is a very brief summary. +- 2x emulation speedup!!! +- added plugin devices and guis. Now you can compile with many more + options, and choose between them at runtime. +- added emulation of AMD x86-64, MMX, SSE, SSE2 instructions +- add wxWindows port (a graphical configuration interface and display lib) + and SVGAlib port (full screen display for Linux without X11) +- improvements in many I/O devices: for example up to 8 hard disks/cdroms, + TUN/TAP network interface, 360k floppies, +- improved MacOSX/Carbon interface and updated MacOS9 port +- GDB remote stub, allows symbolic debugging with Bochs simulation. +- support for up to 32gig hard disk images + +Detailed change log follows. + +- documentation + - manpages updated (Volker, Christophe) + - install HTML rendering of docbook documentation instead of + docs-html (Bryce) + - doc/docbook/Makefile is now generated by configure script. + if configure detects docbook2html on your system, it will turn on + --enable-docbook and run make in the doc/docbook directory. Also + make install will install documentation into $(docdir). You can use + --disable-docbook to turn this off, if necessary. (Bryce) + - add "make bochsdoc.tar.gz" target to create a documentation tarball. + If you do "make webinst" and you have write access on SF shell server, + it updates doc/docbook/* on the website (Bryce) + - user documentation additions: + - new options (Bryce, Volker, Christophe) + - Bios tips section (Christophe) + - Tuntap section (Christophe) + - Serial Port section (Christophe) + - "Will it Work for Me" / "Is Bochs Right for Me" sections + (N. David Guarneri) + - VESA section (Jeroen Janssen) + - several documents, previously existing as separate html files, have + been included : + - internal debugger section (Christophe) + - gdb stub debugger section (Christophe) + - WinME, WinNT, WinXP, The Hurd, Japanese Win95 install tips (Christophe) + - Win95, Win98 install tips (N. David) + - SB16 section (N. David) + +- configure script/compile/porting to other OSes/installation + - added plugin architecture + - plugin code written by Bryce, Christophe, Volker based on + plex86's plugin code by Kevin. Testing help from Psyon and Br'fin. + - Plugins are shared libraries that can be loaded on demand. Example: + the serial device is implemented as a plugin. In UNIX, the + serial plugin is called libbx_serial.so. When Bochs reads its + configuration file, if the serial device is enabled it loads + libbx_serial.so. + - all display libraries, most I/O devices are converted to plugins now + - plugins supported on Linux, Solaris, and MacOS X using libtool, + Cygwin using dlltool. On MacOSX, you must have dlcompat installed + and in your include/library paths at configure time. (See .conf.macosx + for an example.) + - we use libtool's LTDL library from libtool 1.4.2, with a number of + critical bug fixes (Bryce Denney) + - the Linux binary RPMs are built with plugin support + - to compile with plugins, configure with --enable-plugins + - the LTDL_LIBRARY_PATH variable tells Bochs where its plugins can be + found. Bochs has a compile-time default for this variable which is + correct if you do a make install. You would only need to set the + variable if the default is wrong. + - for win32 plugins we added "BOCHSAPI" in front of many classes + and methods, to aid in building DLLs. This turns into __declspecs + which are used when making an export library for Bochs. + - allow many display libraries to be configured and compiled at + a time. For example --with-win32 --with-sdl --with-rfb. + Also, we added an experimental option --with-all-libs which + tries to detect which --with-* options will work. If the + autodetection fails, just type the --with-* options explicitly. (Bryce) + - add #if's around all files which are conditionally compiled such + as cdrom.cc and sb16.cc. This makes it possible to compile every + source file all the time, which has the potential to simplify the + configure script and makefiles. At present we only take advantage + of this capability in the win32 VC++ workspace. (Bryce) + - the MacOS9 port has been updated so that it works again. It had + not been updated in at least 2 years, maybe more. (Christophe Bothamy) + - improve support for FHS standard (Robert Millan, Volker Ruppert) + See patches 551811 and 650066. + - keep separate CFLAGS and CXXFLAGS for Bochs (usually a graphical + program) and console programs such as bximage and niclist. Some + sdl and wx compile flags were making bximage and niclist unusable.(Bryce) + - add concept of cross-configuring in the configure script. If you + use the --target option to generate makefiles to be used on another + machine, some detection of compilers and libraries is disabled. (Bryce) + - fix term compile on Cygwin, but it has to be done without -mno-cygwin, + which means that several win32 features such as networking do not work. + - add "-Wno-multichar" on beos + - test for largefile support, and add required CFLAGS (Bryce) + - add -lm when it's needed, and not when it's not (Bryce) + - add configure support for 8 processors. Bochs can support up to 15 + with some work on the BIOS. + - fix nmake makefile generation (Psyon) + - improved pthread detection function from ac-archive project on SF + - add installer package for Windows, using Nullsoft (Michael Rich, Bryce) + - on MacOSX, add startup script that creates a text console and then + runs Bochs. Also add make target to create a DMG disk image (Br'fin) + - do not restart the font server on Unix/X11, if vga.pcf was already + installed. On several modern machines, if you restart the font + server the user has to restart X windows. (Bryce) + - update most .conf.* files with modern options such as + --enable-all-optimizations. (Bryce) + - The MacosX .conf script adds /sw/include and /sw/lib to the compile/link + path list because it is a common place to put dlcompat. Dlcompat is + required when building with plugins. (Bryce) + - rpms can now be built without root privileges (Bryce) + +- command line + - fixed up our command line options (Volker, Bryce, Christophe) + Usage: bochs [flags] [bochsrc options] + -n no configuration file + -f configfile specify configuration file + -q quick start (skip configuration interface) + --help display this help and exit + +- configuration file (bochsrc) + - There are several new options. See the documentation for more details. + - config_interface: select text mode menus or wxWindows for configuration + - display_library: select which display lib to use + - optromimage: load optional rom images + - ataN (N=0,1,2,3): up to 4 ATA controllers for hard disks, cdroms + - ataN-master, ataN-slave, N=0,1,2,3: defines a hard disk or cdrom. + The "ata*" options replace diskc, diskd, and cdromd, which are + now deprecated. + - floppy_bootsig_check: control the 0xaa55 signature check on boot floppies + - logprefix: lets you change the format of log messages + (patch by Carl Sopchak, help from Christophe) + - debugger_log: log all output from bochs debugger + - user_shortcut: allow you to type key combinations like Ctrl-Alt-Del + - pit: control the PIT model, including realtime option to try to + keep in sync with real time. + - Credits: Christophe added optromimage, everything about ATA, + floppy_bootsig_check, debugger_log. Bryce added config_interface + and display_library. Volker did the user_shortcut button. + Greg Alexander wrote the PIT model and added the realtime option. + - since v1.3 we've been able to use environment variables in pathnames + in the bochsrc file. Now, a few variables have default values, set at + compile time, that are used if the user does not set a value. If Bochs + is installed correctly, the defaults will be correct and the user will + not need to override them. + - $LTDL_LIBRARY_PATH is the path name where the plugins can be found. + The default value comes from $(plugdir) in the makefile. This is only + important if plugins are enabled. (Bryce) + - $BXSHARE is the path where the BIOSes and keymaps are installed. + The default value comes from $(sharedir) in the makefile. Disk + images on the Bochs website will begin to use BIOS pathnames like + $BXSHARE/BIOS-bios-latest. On win32, the $BXSHARE default is + set by the NSIS installer and read from the registry. On MacoSX, + the $BXSHARE default is set to the path containing bochs.app. + (Bryce, Volker, Br'fin) + - new option in the configuration interface to reset all bochsrc + settings to initial defaults. A reset occurs just before reading + a new configuration file, so that leftover parameters from a + previous configuration do not affect the new configuration. Also, + you can request a reset using the configuration interface. (Volker, Bryce) + - ne2k line can now specify a script to set up the interface (Christophe) + - on Unix, also search /etc/bochsrc (Bernhard Bablok) + - you can use #include in the bochsrc to read configuration from other + files (Volker) + +- CPU + - speed optimizations from Kevin Lawton, yielding around 2x speedup + - guest2host_tlb : for entries in the paging TLB which point to normal + physical memory pages, a pointer to the host address of the emulated + physical memory (from malloc()) page is stored in the TLB entry. In + many cases, this pointer can be used in memory accesses to directly + read/write the guest memory address. In exceptional cases, the physical + memory access routines are used. Turn on with --enable-guest2host-tlb. + - repeat IO/string : for some variants of repeatable IO and string + instructions, the segmentation and paging checks are done in batch along + with the data transfers, constrained within page boundaries and the + segment limits. Turn on with --enable-repeat-speedups. + - icache : The structure holding instruction decode information was + reduced to 32 bytes. 24 bytes for the actual decode data, and 4 each + for pointers to the address resolution routine (not always needed) and + the instruction emulation routine. With a reasonably small + per-instruction decode size, an instruction cache (iCache) was created, + which is simply a hash table. The main cpu loop looks in the table + first; if the instruction has already been decoded, execution can begin + immediately without decoding. Turn on with --enable-icache. + - host specific asm : when compiling on an x86 platform, use of + x86-specific asms can be enabled to accelerate several facets of + emulating instructions. For example, the EFLAGS values are much more + efficient to calculate when the actual x86 instructions are used to + generate the EFLAGS values. Turn on with --enable-host-specific-asms. + (Kevin, with help from Jas Sandys-Lumsdaine) + - if you want to enable all the speed optimizations that we believe + to be stable, use --enable-all-optimizations. The release binaries + are built with this option. + - add support for AMD's x86-64 instruction set. To enable, configure with + --enable-x86-64. The AMD x86-64 support is about 90% complete and is + still experimental. We've implemented the core x86-64 instruction set and + the changes to the rest of Bochs necessary to operate in long mode, but + we've still to implement checking for canonical 64 bit addresses. The code + has been tested on a limited number of test programs. It has been able to + successfully boot a x86-64 Linux kernel and run a 64 bit userland + application. It has also successfully run a DOS based 64 bit protected + mode test application. (Peter Tattam, with merge/bugfix help from Kevin + Lawton and Bryce Denney) + - add MMX support. To enable, configure with --enable-mmx. + (Stanislav Shwartsman) + - add SSE and SSE2 support. To enable, configure with --enable-sse=1 + or --enable-sse=2. (Stanislav) + - fixed the behaviour of the bcd instructions AAM, AAD and DAA based on + SF patch #537146 (Volker) + - stop printing an error for VERR/VERW. According to the i386 opcode + description there is no error present. (Volker) + - fix bug [ 625878 ] reset doesn't reset something(?). Fix cpu reset + when executing a rep instruction (Christophe) + - use accessors methods for CFLAGS and several other registers, so that + the implementation can be changed transparently later (Bryce, Stanislav) + - add support for page size extensions, also known as 4meg pages. + Turn on with --enable-4meg-pages. (Kevin Lawton) + - add support for page global extensions. Turn on with + --enable-global-pages. (Kevin) + - add support for physical address extensions. Turn on with --enable-pae. + (Peter Tattam) + - implement RDMSR and WRMSR. not all MSRs are supported (Zwane Mwaikambo) + - new configure option --enable-ignore-bad-msr, which makes unrecognized + MSR reads and writes into just a warning + - fix PIC/APIC interrupt problem that caused Linux 2.4.19 to hang + during boot (Peter) + - CMPXCHG8B patch (Michael Hohmuth) + - EFLAGS are now stored in the same form as the native EFLAGS on an x86, + so that we can use native machine instructions in some cases (Kevin) + - instrumentation code updated (Stanislav) + +- FPU + - fixed bug [ 452275 ] fprem emulation bug (Volker) + - fixed bug [ 648579 ] Mac OSX >>PANIC<< FPU_printall. There was an + endianness issue with the fpu (Christophe) + +- I/O devices + - rewrote pc_system timers (Kevin) + - biosdev + - this new device handles the panic/error/info/debug messages sent + by the Bios and VGABios. It was previously done in the unmapped device. + - cdrom + - implementation of the function READ TOC for cdrom image files. (Volker) + - function capacity() for win32 fixed. Now it returns the number of blocks + instead of bytes. (Volker) + - added multiple cdrom support for win32 (NT/2000 version untested). The + ASPI version uses the cdrom drives in the system's order. Drive letters + are not used by ASPI. (Volker) + - fix configure script's cdrom detection on BeOS (Bryce) + - fix physical CD change at runtime (Bryce) + - cmos + - fix panic when WinXP read port 70h (Christophe) + - add ps/2 style century at index 37 to allow WinXP to boot. (Bryce) + - dma + - DMA register and unregister functions for DMA channels added and macros + for DMA functions defined. The changes are based on the Plex86 functions. + (Volker) + - implementation of the DMA controller reset (Volker) + - the value of the command register must be always 0x00 (BX_ERROR fixed) + - floppy (Volker) + - implemented Tape Drive Register (Dave Poirier) + - added support for 360k floppy images + - the skip flag (SK) in command 'read sector' is ignored now + - floppy read and write function do not set the 'seek end' bit in status + register 0 (fixes SF bug #553377) + - the status of the 'disk changed' line depends on the selected drive. + The digital input register is now an array (DIR[4]). + - apply patch [ 635021 ] floppy cleanup by Alex Thiel + - distinguish between floppy drive type and media type + - hard drive + - add largefiles support, to allow disk images larger than 2gig. + (Stu Grossman) + - missing conditions for lower_irq() added (Volker) + - several noncritical panics replaced with BX_ERRORS and the controller + returns an error code until we implement the features (Volker) + - applied patch from Carl Sopchak for booting sco openserver + - allow disk block access only if concatenated images are not used + (Christophe) + - fix bug [ 419415 ] netbsd 1.5 rescue disk won't boot (Volker) + - multiple drq atapi data transfers corruption fixed (Christophe) + - added some commands to the unsupported "Set Feature" commands (Christophe) + - speedups in repeated IO transfers (Kevin) + - support for Peter Tattam's external disk simulator (Bryce) + - 4 channels / 8 devices support (Christophe) + - "inquiry" atapi command results corrected (Volker) + - check for incomplete devices configuration before starting the + simulation (Bryce) + - implemented the different bios disk translation schemes (Christophe) + - keyboard and mouse + - add commands 0xd2, 0xdd and 0xdf (Dave) + - fix bug [ 613975 ] wxWindows: params redefined on restart (Bryce) + - in function mouse_motion(): added parentheses to fix compilation problems + with MSVC. See SF bug #575301. (Volker) + - added missing register_irq() for the PS/2 mouse IRQ12 (Volker) + - fix "AltGr" key on European keyboards wxWindows/win32, SDL (Volker) + - NE2000 + - function reset() clears the IRQ line (Volker) + - added TUN/TAP interface (Renzo Davoli, Christophe) + - fix DOS based packet drivers that use an odd count for the NE2000 DMA (Peter) + - changed "TCR write, reserved bits set" panic into an error, fixes + networking with debian image (Bryce) + - parallel + - parport1 enable/disable support added (Volker) + - PCI (Volker) + - implementation of the PCI device register mechanism + - PCI memory handling moved to the memory code + - replaced memcpy() in pci_read() by a more portable code. Problems with + PCI on big-endian machines are fixed now (SF bug #638481). + - implementation of the PCI-to-ISA bridge started (still incomplete) + - PIC + - fixed detection of single mode and level senistive mode in ICW1 (Volker) + - fixed handling of rotate_on_autoeoi for master PIC (Volker) + - irq mask is now cleared on initialization (Dave) + - fixed lockup during mouse movements during win98 install. (patch from + Wilfried Weissmann) + - PIT + - Added realtime PIT support (Greg) + - Sound Blaster 16 + - it used to enable itself all the time; now only when you ask + - fix memory leaks (Bryce) + - serial + - don't cause problems when serial device is disabled (Volker) + - unmapped + - add programmatic shutdown feature at port 0x8900 (Christophe) + - vga + - VBE fixes (Jeroen, Volker) + - CRTC fixes (Volker) + - sequencer reset with bits 'reset1' and 'reset2' implemented (Volker) + - add charmap change support (used by SDL, win32 and wxWindows gui) (Volker) + - screen dimensions / updates for some graphics and text modes fixed (Volker) + - use the start address when calculating the byte offset for standard + EGA/VGA modes (Volker) + - byte offset for modeX fixed (use value of CRT register 0x13) (Volker) + - text mode memory mappings 0 and 1 support (Christophe) + - fix bug [ 612741 ] VBE mem conflicts w/ local APIC address (Jeroen) + - fix bug #635223: VGA tiles array access out of bounds (Bryce) + +- ROM BIOS + - improve compile process. Now bioses for 1, 2, 4 and 8 processors + are built at the same time (Bryce) + - fixes to be able to compile the bios with gcc2 or gcc3 (Jeroen and + Christophe) + - changes on boot signature check (Christophe): + - never done for cdroms + - always done for hard-disks + - conditional for floppies + - add keyboard int16 functions 0x09 (get keyboard functionality) and + 0x0a (get keyboard id) (Christophe) + - fix bug [ 629810 ] int 16/ah=01 broken? Enable interrupt on entering + int16 handler (Christophe) + - new keyboard init in POST (patch from Adam Sulmicki) + - flush input and output keyboard buffer before keyboard self test + (Volker and Christophe) + - fix bug [ 547603 ] kbd up/down arrows in dos install (Christophe) + - fix bug [ 549815 ] bios wrongly loads CS,ES. CS and ES are set to 0 + before the bootloader code is called. (Christophe) + - PCI functions support (Volker) : + - BIOS32 service directory + - real mode PCI int1a functions + - protected mode PCI int1a functions + - fix reset for MS-DOS and Win95 (Volker) + - 360K floppy support (Volker) + - enhanced ata/atapi support (Christophe) : + - 4 channels / 8 devices + - device auto detection (with help from Adam Sulmicki) + - EDD3.0 + - 32bits device access + - optional disk translation "large", "r-echs" or "lba" (up to 8.4GiB) + - re-enable harddisk controller interrupt after reads/writes. + Win95 can now use native access to harddisks and cdroms. (Volker) + - shutdown status handling (cmos index 0x0f) (Christophe) : + - fix bug [ 601166 ] CMOS Problem @ "0x0F Index 0x05 data". After reset + execution will resume by a jump to [0x40:0x67] if the shutdown status + is 5 + - the bios don't panic any more if the shutdown status is 9 + - two parallel ports detection in POST (Volker) + - two serial ports detection in POST (Volker) + - add int15 extended memory function 0xe820 (patch from osmaker) and + 0xe801 (patch from Hartmut Birr) + - fix return values on some int15 functions (Bryce) + - fix int70 handler overlapping int08 handler (Christophe) + - simplify 8 processors BIOS for operating systems which don't do + paranoia/sanity checks (Zwane) + +- configuration interface + - wxWindows config interface now allows you to change every bochsrc + option using menus and dialog boxes. There is also the beginning of + a wxWindows graphical debugger, but it needs a lot of work before it + will be useful. + - renamed control.cc to textconfig.cc. Now we're calling it a + text configuration interface, instead of a control panel. + +- display libraries + - Even though we've had them for years, the term "display library" is new in + release 2.0. In the gui directory, Bochs has a number of different C++ + files which you can select to display the text and graphics on the + simulated monitor. Each of these is a display library. The display + libraries are: + x use X windows interface, cross platform + win32 use native win32 libraries + carbon use Carbon library (for MacOS X) + beos use native BeOS libraries + macintosh use MacOS pre-10 + amigaos use native AmigaOS libraries + sdl use SDL library, cross platform + svga use SVGALIB library for Linux, allows graphics without X + term text only, uses curses/ncurses library, cross platform + rfb provides an interface to AT&T's VNC viewer, cross platform + wx use wxWindows library, cross platform + nogui no display at all + - it is now possible to compile Bochs with support for many different + display libraries and select the one to use at runtime (even without + plugins). See the display_library directive in .bochsrc. + - add new svgalib display library by Igor Popik + - fix bug [ 614724 ] SDL can get stuck in full screen mode + display libraries such as SDL which have a full screen mode can be + dangerous, if Bochs does not switch back to normal display mode at + the right time. This is fixed for SDL and the new svga. + - keymap support added in SDL interface (Bryce, Volker) + - new keymap files: SDL keymaps for US and DE keyboards, X11 keymap + for Danish keyboard. + - use keyboard mapping for keyup messages too + - renamed almost all references to data type "Boolean" to "bx_bool". + The Boolean data type was defined in Carbon.h headers, and conflicted + with Bochs's definition. See bug [ 618388 ] Unable to boot under MacOS X + Exceptions: When talking to the Carbon library, you must use Boolean. + Also, siminterface.h uses standard "bool" instead of bx_bool. + - "User" button added in toolbar. It can send keyboard shortcuts to + the guest OS. (Volker) + - snapshot improvement and memory leak fixed (Volker) + - testing framework, based on comparing screen content, added (Greg) + - term display library: + - support for color terminal, function keys, clear screen (Volker) + - solaris compilation problem (bug #613393) fixed (Bryce) + - win32 display library: + - use native win32 toolbar for headerbar, use system palette (Volker) + - many Carbon interface improvements: + - patch [ 549248 ] Fix Carbon key & menu handling (Chris Thomas) + - partial keymap support, copy&paste, menu items fixed, new toolbar + behavior, dialog box display for panics (Br'fin) + - sdl display library: + - keyboard fixes and key mapping added (Bryce) + - when captured, the mouse is forced to stay in the window. fix bug + [ 619283 ] SDL: os mouse pointer leaves the window (Bryce) + - x display library: + - bug [ #537593 ] vga font not being found fixed. If vga font not + found, search for a font called "-*-vga-*" (Bryce) + - keyboard problems fixed (Bryce, Christophe) + - beos platform, any display library: add a nice icon to the executable + (Bernd Korz) + +- wxWindows + - wxWindows is a cross-platform C++ user interface library which you can + download for free at http://wxwindows.org. wxWindows provides C++ + classes for all sorts of GUI controls (buttons, menubars, etc.) and + implements all of them using the native controls on the platform. + - The new wxWindows port of Bochs provides both a graphical configuration + interface (for editing bochsrc options) and a display. It was + written by Bryce Denney, Don Becker, Dave Poirier, and Volker Ruppert. + - In release 2.0, we concentrated on making the wxWindows port as stable + and functional as the other interfaces. wxWindows provides a great + toolbox that we can use to make Bochs easier to learn and use. + - wxWindows supports charmap changes, keyboard mapping, cut and paste, + text and graphics modes, text mode cursor size, and mouse (Volker, Bryce) + - To compile Bochs with wxWindows, you should install wxWindows 2.3.3 + or later. Then configure Bochs with --with-wx. + - if you have multiple versions of wxWindows installed (e.g. a debug + and a release version), you can set $WX_CONFIG before configuring + to select between them. (Bryce) + +- Bochs debugger + - [ 609616 ] remote GDB stub + add GDB Stub support from Johan Rydberg, with bug fixes by Stu Grossman + - add hooks for external debugger for win32. The external debugger + that connects to Bochs is distributed in + build/win32/tattam-external-debugger.zip in binary form. Turn on + with --enable-external-debugger. (Peter) + - add "debugger_log" option to bochsrc, which logs all debug output + into a file. feature [ 629068 ] (Christophe) + - debugger is now usable in fullscreen SDL and SVGA guis. It will + switch back to text mode for each debug prompt (Bryce) + - disassembly output cleaned up and improved + (Kernel Panic, Peter Tattam, Jonathan Shapiro, Luiz Henrique Shigunov) + - fix [ 628806 ] debug: x/c prints unprintable chars (Bryce) + - add the beginnings of a wxWindows debugger. Not ready for mainstream use + yet. CPU register display is implemented, and you can type any debugger + command you want into the Debug Console window. (Bryce) + - add help command (Alexander Krisak) + - symbol table lookups cleaned up a bit (Bryce) + - displays the address of the caught watchpoint, feature #435271 (Dave) + - remove obsolete "loader" + +- utilities + - fixed bug [ 487758 ] bximage fails on file creation >2048meg + Bximage should now work up to 32gig. (Bryce) + - on win32, both bximage and niclist now ask the user to press + return before exiting, so that you have time to read the results + before the window disappears. (Bryce) + +------------------------------------------------------------------------- +Changes in 1.4.1 (June 22, 2002): + +- now cdrom is enabled in configure, unless you specifically disable + it with --disable-cdrom. (Christophe) +- fix compile error in main.cc when SMP or APIC is enabled (Dave) +- the runtime menu now displays 11 (continue) by default (Bryce) +- initialize DMA controller before floppy and SB16 +- fix DMA panic when installing win95 (Volker) +- first character of the vga bitmap is blank on win32 (Volker) + Before, it was incorrectly coded as a '@'. +- AltGr key on European keyboards works now on win32 (Volker) +- fix problem with console/serial port on Bochs exit (Volker) +- enable serial port for GNU and GNU/Linux (Volker) +- small documentation fixes (Volker) +- remove unnecessary include statements for X11 (Volker) +- italian keymap added (Emanuele Goldoni) +- fix win32 ethernet frames error. It will no longer reject packets + that are less than 60 bytes long. (Peter Tattam) +- BIOS fixes : + - win2k cd-boot (Christophe) + - emm386 crash (Dave) + - cs=0 at boot time (Christophe) + - keyboard failure in scandisk (Dave) +- fix bug in forming the 64-bit APIC base address from two 32-bit registers. + A compiler warning in cpu/proc_ctrl.cc pointed this out. +- fix default choice in the runtime options menu + +------------------------------------------------------------------------- +Changes in 1.4 (March 27, 2002): +- ROM BIOS + - Boot from CDROM! Christophe Bothamy added partial El Torito support in + rombios.c, which allows Bochs to boot cdroms. Booting from win2k or winXP + cdrom is not supported yet. The default BIOS includes El Torito functions. + the boot line must say "cdrom". + Example: + boot: cdrom + - implementation of int13 diskette function 5 (format track) (Volker) + - initialisation of PIC and DMA-2 added to POST code (Volker) +- configure script (Bryce Denney) + - the configure script now detects your platform and provides a default + GUI and the required compiler flags. All supported platforms should + compile with simply "configure" and "make". + - default guis by platform: + - win32/windows/cygwin: win32 gui + - MacOS X: carbon gui + - MacOS 9 or earlier: macos gui + - BeOS: beos gui + - AmigaOS: amigaos gui + - all other platforms: X windows gui + - compile arguments supplied by configure script + - win32: too many to list here; see documentation + - cygwin: -mno-cygwin -DWIN32 + - MacOS X: -fpascal-strings -fno-common -arch ppc -Wno-four-char-constants + -Wno-unknown-pragmas -Dmacintosh + - the --with-GUINAME configure option is only needed if you want to override + the default GUI. This is the only way to use the Term, RFB, and SDL + GUIs. +- VGA + - added VESA BIOS Extensions code by Jeroen Janssen (banked mode only, LFB + support in patches) + - vga memory read/write functions in text mode fixed + - implementation of CGA mode 320*200*4 (patch from Sebastien Bechet) +- VGA BIOS + - updated Christophe Bothamy's LGPL VGA BIOS to version 0.3a. This consists + of a bug fix for function ah=13 and VBE support by Jeroen Janssen. +- networking + - chipmem read/write limit fixed (Mike Lerwill) + - writing a byte in 16-bit mode now possible (Mike Lerwill) + - new ethertap interface for Linux, which allows Bochs to talk to + the local machine and the internet (Bryce Denney) + - NE2000 is now enabled by default on Win32, Cygwin, and Linux compiles + in the .conf.* scripts and release binaries. + - fix check for auto transmit disable, which was checking the wrong bit + (Peter Tattam) + - Win32 only + - niclist.exe has been revised to work on more Windows versions, and it + suggests a usable ne2k line (Dean Payne) + - fix timeout setting so that ne2000 does not slow down the whole + simulation (Don Becker) + - bug fix: be able to handle multiple packets that arrive at once + (Mike Lerwill) +- GUI changes + - cdrom button: click this to notify Bochs when you changed the CDROM (Volker) + - snapshot button: saves the text on the Bochs screen into a file called + snapshot.txt (Volker) + - copy button: on Win32 and X windows, copy the text on the Bochs screen + to the clipboard (Volker) + - paste button: on Win32 and X windows, paste the characters on the + clipboard into the Bochs window. This requires keyboard_mapping to + be enabled. (Bryce Denney) + - improved text mode cursor for Win32, X11, and SDL (Volker) + - new SDL interface (Dave Poirier, debugging by Christophe, Volker, Bryce) + SDL is a graphics library that has works on many platforms. This interface + is experimental, and is missing a few features of the standard Bochs + interfaces: extended keys (arrows, keypad). + - MacOS X: add MacOS X carbonized event handlers by Jeremy Parsons + - X windows: when not enough colors can be allocated, force use of + private colormap (Bryce Denney) + - bug #490570 fixed: OUTB set and command 0xaa encountered (Dave Poirier) +- keyboard + - completed keyboard emulation with the implementation of the three scancodes + sets (mf1, mf2, mf3) with or without translation. This is based on Ludovic + Lange's plex86 keyboard patch. (Christophe Bothamy) + - added a "keyboard_type" option, that defines the answer to an "identify + keybord" request to the keyboard controller. The available values are + "xt","at","mf". (Christophe Bothamy) + - added an optional keyboard_mapping option that enables to use your + country specific keyboard with Bochs. If enabled, the keymap file must be + specified in bochsrc. The available keymaps are US, German, Spanish and + French for PCs running X11. Contributions are welcomed. (Christophe + Bothamy) + - added Windows(tm) key definitions (Volker Ruppert) + - added paste button, which causes the emulated keyboard to type characters + from the system clipboard. This only works when keyboard_mapping is + enabled. (Bryce Denney) +- cdrom + - bug fix: win32 could not read a cdrom image file + - eject cd support for linux (patch from Petr Stehlik) + - BeOS fixes + - changing cdrom media is possible now with CDROM button +- sound blaster(tm) emulation (Volker) + - you can use --enable-sb16=freebsd now + - 16-bit DMA controller added + - 16-bit mode of the SB16 implemented (output to file works) +- floppy drive (Volker Ruppert) + - implementation of the floppy command 'format track' + - implementation of read / write operations with MT=0 + - behaviour of a few floppy commands fixed + - floppy reset behaviour fixed + - lots of other fixes +- fixed bug [ #468340 ] pic:slave: OCW3 not implemented. Now the slave PIC + supports all the modes that the master PIC does, and nobody will see this + message again. +- serial port (by Volker Ruppert unless noted) + - improved IRQ handling + - now Windows 95 serial driver works correctly + - fixed the return value of the MCR (loopback bit) + - interrupt reasons LSR change and MSR change implemented + - the number of data bits is considered when sending data + - all serial port changes are tested in loopback mode only + - serial port emulation fixed for FreeBSD and OpenBSD (Stu Grossman) + - fix receiver poll frequency so that it doesn't slow emulation (Stu Grossman) +- Bochs debugger + - when tracing, print the instruction just before it is executed, instead + of just after (Greg Alexander) + - after a triple-fault panic, you can now return to the debugger +- symmetric multiprocessor (SMP) simulation + - no more panic if you read the EOI register + - fixed default destination format in local APIC + - fix SMP instruction tracing in bochs debugger + - fix deadlock when debugger enabled and all processors HLT + - MSR support added by Zwane Mwaikambo +- simulation of interrupts is more accurate (Volker) + - implemented edge triggered interrupt mode + - added functions raise_irq() and lower_irq() +- programmable interrupt timer (Greg Alexander) + - fixed the PIT gate and improved the PIT printing options + - experimental real-time PIT +- parallel port improvements (Volker Ruppert) +- bug fix: hard disk errors caused by overflowing imul in the BIOS code. + Sebastian Bechet and Peter Tattam tracked it down and fixed it. +- fix some memory leaks (patch from Darko Tominac) +- Double-Word IO is supported for ATA devices +- fix bash-specific syntax in install-x11-fonts script +- print stack_return_from_v86 error only the first 100 times + +------------------------------------------------------------------------- +Changes in 1.3 (December 10, 2001): +- networking works on Windows and Linux platforms +- emulated cdrom can now read from ISO image files, on any platform. +- new PIT model by Greg Alexander which is much more complete than the + old one. The new PIT is used by default, but you can switch back to + the old one if you configure with --disable-new-pit. + (PIT = 8254 programmable interrupt timer) +- new configuration menus by Bryce Denney, which allow you to change any + bochsrc option using text menus, then save the configuration into + a new bochsrc file for later use. You can disable the new code using + configure --disable-control-panel. Also you can use the command + line arguments -nocp or -nocontrolpanel. Also, there is a new + "Config" button on the GUI that allows limited changes to the + configuration at runtime, such as changing the floppy disk. +- add docbook documentation directory in the sources under doc/docbook. + The transition from HTML to docbook documentation is still in progress. +- Add new log action "ask", as shown in these example bochsrc lines: + panic: action=ask + error: action=ask + When an event occurs which is set to "ask", you get a beep and message + on the text terminal that asks what you want to do. Choices are: continue, + continue and disable future messages from this device, quit immediately, + or segfault (where abort() function is available). If compiled with + --enable-debugger, you can also choose to enter the debugger. +- Parallel port emulation cleaned up by Volker Ruppert. See .bochsrc for + syntax of new parport1 line in bochsrc. +- PCI support improved by Volker Ruppert, including BIOS changes. Still + not complete. +- floppy controller returns a proper error response if you try to write + a read-only disk image. For systems such as DOS that actually use the BIOS + services, it was also necessary to add code in int13_diskette_function to + recognize a write-protected error and return the correct error status code + (AH=3, Carry Set). +- the ROM BIOS now prints panic messages to the console. Thanks to Cliff + Hones for his console display code. +- the ROM BIOS detects nonbootable disks (Barry Allard), and prints a message + on the console. Barry Allard's patch who helped with checking the boot + signature. +- LBA support added for hard disks. (Not tested very much.) +- add dependencies to makefiles +- logging code moved into a separate file, logio.cc +- new option --enable-slowdown-timer, by Greg Alexander, which kicks in if + Bochs simulation time starts to run faster than real time. This helps to + keep the Bochs clock in sync with the real clock when the CPU is mostly + idle. +- new option --enable-iodebug, by Dave Poirier, which creates an I/O + interface to the debugger. This lets you write software to be emulated + in Bochs which can turn on instruction, register, or memory tracing + using I/O accesses. +- improved detection of readline in configure script +- configure substitutes the version number into many files, instead of + using sed in the makefile. There are still a few uses of sed remaining. +- you can now use environment variables in bochsrc values. For example, + diskd: file="$BOCHS_IMG/diskd.img", cyl=615, heads=6, spt=17 +- configure with --prefix=PATH works now +- running configure from a different directory works now, thanks to + a patch from Edouard G. Parmelan +- fix [ #433759 ] virtual address checks can overflow. + > Bochs has been crashing in some cases when you try to access data which + > overlaps the segment limit, when the segment limit is near the 32-bit + > boundary. The example that came up a few times is reading/writing 4 bytes + > starting at 0xffffffff when the segment limit was 0xffffffff. The + > condition used to compare offset+length-1 with the limit, but + > offset+length-1 was overflowing so the comparison went wrong. +- cmpxchg8b patch from Michael Hohmuth +- apply patch from Thomas Fitzsimmons to fix compile + problems when BX_SUPPORT_PAGING and BX_USE_TLB are turned off +- fix bug introduced in 1.2.1 which caused spurious exceptions. + See patch #439314, Exception 1 (debug) on HALT, from + thomas.petazzoni@meridon.com. +- add panic in ctrl_xfer32.cc where the IRET32 implementation is broken. + This only happens if you are NOT in vm8086 mode or protected mode. + The intent is to warn people when they are getting bad emulation, and + encourage people to report how they got to that point. +- apply patch from Santiago Bazerque. See this bug report: + [ #463018 ] retf not removing parameters sometimes +- fix bug [ #461730 ] IRETD causes problems if NT-flag is set + reported by Peter Lammich. +- apply patch [ #455014 ] CR0 bug in 80486, described as: + > In the register CR0, when the bit PM is enabled, the bit 4 is 0 + > when should be 1. +- apply patch from Mike Rieker associated with this bug + report: [ #480422 ] gdt 'accessed' bit +- in task_switch when it tried to ensure that the old TSS was paged in, + it actually used the new TSS address, fixed. +- updated the instrumentation code, and added a working example. To try + it, configure --enable-instrumentation=instrument/example1. Then when + you run bochs, you will get one line for each instruction PC and for + each I/O access in a new file called bxevent.txt. +- set a bit in the CMOS that says the processor has an FPU. This is + from patch [ #455006 ] Device byte is not initialized aptly. + Author did not leave their name. +- add logging code to the "null ethernet" which does not require host OS + support. All this does is print the outgoing packets from the guest OS. +- cleanup of log functions (Todd Fries) +- add BX_ERROR for every command in ATAPI-6 that bochs does not support. + I still need to do add some commands from older specs that are obsolete + (and not listed) in ATAPI-6. Commands that aren't in the spec will still + panic. +- only put 0xf into the 2nd hard disk field when the cdrom is not present. + This is a patch from Volker Ruppert , who + comments: "The fdisk command reports an unusable second harddisk if the cdrom + is enabled. This patch helps, but I don't know if it is the right way." +- make hard disk code return error codes when data is not available instead + of just panicing. In particular, if the logical sector is out of bounds + or the disk image cannot be read/written at the desired offset, we now + abort the ATA command and return an error code. Many of the old BX_PANIC + messages are turned to BX_ERROR, so they will still appear in the + log, but now the device model will try to communicate this fact to + the OS instead of simply giving up. +- don't blindly reject odd length atapi commands. There are cases when + it's really ok according to ATA-4. +- for big endian machines, reversed the bit fields in interrupt_reason. + This was pointed out by Nicholai Benalal. +- extended keyboard improvements by Dave Poirier +- major mouse patch from Dave Spring, that implements several missing + mouse modes. +- commit keyboard patch from David Haslam + posted to mailing list, that addresses the problem of each key press + printing ^@. See cvs log for details. +- mouse performance fixes by Greg Alexander and Robb Main +- NE2000 fixes by Frode Vatvedt Fjeld, ecelca@yahoo.com, Greg Alexander, + and angelos@openbsd.org. +- fix bug [ #468340 ] pic:slave: OCW3 not implemented. Some event handling + code appeared in the master pic but not the slave pic. +- fix compile problems in SB16 code, related to fpos_t being treated as + an integer. +- patch from Volker Ruppert to fix + midi output file so that winamp can play it. +- some cleanup of serial code by Todd Fries and Volker Ruppert, but it + doesn't work yet. + +X Windows specific: +- commit patch from David Haslam + [ #455763 ] Cursor trail with DOS Edit/Minix vi +- error for missing fonts now points to the documentation +- new option --enable-idle-hack, by Roland Mainz, which makes Bochs more + friendly toward other processes when its CPU is idle. Presently, + this option is specific to X windows. + +Win32 specific: +- now Windows 95/98/ME can read the physical cdrom (Don Becker) +- The default configuration for Win32 VC++, given in .conf.win32-vcpp, + now enables the NE2000 and renames all .cc files to .cpp. This keeps VC++ + happy but may make it hard to use CVS. +- The default configuration for Cygwin, given in .conf.win32-cygwin, now + enables cdrom and SB16. +- See "new docs" on the web site for compile instructions for VC++ and Cygwin. +- The sources include a VC++ workspace, in addition to the old "nmake" + makefile. +- ethernet support (emulated NE2000 card), coded by Don Becker. This + implementation requires a library called WinPCap, which you can + download from http://netgroup-serv.polito.it/winpcap. +- new utility called niclist.exe which lists the ID number of all your network + cards (well probably you just have one). The ID be used when setting up your + .bochsrc. +- patch [ #466403 ] make text colors more accurate. The author did not leave + his/her name. +- fix GUI bug [ #452159 ] win32: mouse stuck if bochs win partly off screen + Now we center the mouse periodically, whether or not the mouse has + wandered outside of the window or not. +- event handler recognizes the extended keycode flag +- fixes for raw floppy and floppy disk images (Don Becker) + +Linux specific: +- Ethernet (emulated NE2000 card) now works in Linux! Contributed by + splite@purdue.edu. This has been tested using host OS kernel 2.2.14, and + works with telnet, ftp, irc, lynx, etc. Because it is a packet filter + solution, you aren't able to talk to the host machine, only to other + machines on the network. +- The default configuration for Linux, given in .conf.linux, now enables + the NE2000 model. +- RPM build process configures with --prefix=/usr so that everything is + installed in /usr/bochs instead of /usr/local/bochs. +- DLX Linux disk image is now installed so that only root can write it, to + avoid security problems. When you run the bochs-dlx script, it creates a + local copy in your home directory and then runs it. +- code that determines the capacity of a cdrom now works for both ATAPI + and SCSI drives (splite@purdue.edu) +- applied patch from bochs@sigint.cs.purdue.edu. The comments are: + > The Linux 2.4.5 CD-ROM driver sends a READ_DISC_INFO command which caused + > an "unrecognized ATAPI command" panic. Looks like READ_DISC_INFO is only + > recognized by CD-R and CD-RW drives, so I ignore it for now. + +Amiga MorphOS specific: +- Bochs now compiles and works on Amiga MorphOS. Configure with + --with-amigaos. For AmigaOS only, see .bochsrc for use of fullscreeen and + screenmode options. The Amiga MorphsOS is written and maintained by + Nicholai Benalal . +- raw cdrom supported if you configure with --enable-cdrom + +BeOS specific: +- Bochs compiles and works on BeOS. Configure with --with-beos. + Bernd Thorsten Korz maintains the BeOS port. +- raw cdrom supported if you configure with --enable-cdrom + +MacOS X specific: +- Bochs now compiles and works on MacOS X. Configure with --with-carbon. + Emmanuel Mailliard ported the Macintosh code to the + Carbon API. +- The MacOS X application is built using (gasp) mkdir, copy, and rez. + Surely this is not the right way, but it works. +- raw cdrom supported if you configure with --enable-cdrom + +RFB mode: +- apply patch.rfb-mouse by MURANAKA Masaki (monaka@users.sf.net) + see this source forge bug [ #457968 ] Strange mouse motion on RFB +- add a retry loop in RFB code, so that if port 5900 is not available + it can try 5901, etc. + +Bochs Debugger: +- do a vga update whenever you print a debugger prompt. +- added debugger command "info fpu" that prints the FPU registers. If you + do "info all" you get cpu and fpu registers. +- added debugger command "info ne2k" which prints all the registers + of the NE2000 model +- add ability to do register tracing and flag tracing (Dave Poirier). + Try the trace-reg-on and trace-reg-off commands. +- instruction trace now includes time ticks +- fixed problems in which bochs compiled with debugger measured time + differently from bochs compiled without debugger. Also when instruction + trace was enabled, breakpoints and control-C did not work. Also, + breakpoints at the beginning of an interrupt handler did not work. + +------------------------------------------------------------------------- +Changes in 1.2.1 (June 12, 2001): +- more work on makefile for building RPMs +- [ #432382 ] build debian packages patch + add build/debian directory from Rob Lemley + which allows us to make Debian packages! +- optimize for speed when simulating one processor. Now 1-processor + performance should be equivalent to 1.1.2. +- [ #425640 ] sb16 assumes fpos_t is long int + This fixes compiles of iodev/sb16.cc on linux systems with newer libraries + in which fpos_t is not an integer. +- [ #432488 ] SMP:assert "n_logfn < MAX_LOGFNS" fails + increase MAX_LOGFNS since we ran out of them on an SMP simulation with + 4 processors +- changes to compile clean on cygwin: + - don't use the WIN32 snprintf define for cygwin + - add ssize_t definition for cygwin + - only compile "struct timeval tval" if select is available + on that platform. +- [ #432491 ] SMP: CPUID says no APIC feature + clean up inconsistent use of BX_SUPPORT_APIC and BX_APIC_SUPPORT, which + caused the CPUID to report no APIC was present +- [ #431025 ] --enable-external-device-models broken + removed configure options for external-device-models and + external-cpu-memory. These don't work and aren't going to be fixed. +- [ #429448 ] configure: -lreadline when not there + Now configure allows you to choose not to use readline, even if it's found + on your system. +- [ #428915 ] apply extended keyboard patch + extended keyboard patch by Dave Poirier +- [ #428626 ] if no X11 found, configure&make fails + Now configure halts if X windows is selected but no X libraries are found. +- updated rombios to version 1.13. This fixes several problems: + - [ #430472 ] DOS HIMEM "A20 line" error + This problem was apparantly caused when Bryce added a function that prints + the BIOS version, and he called it too early in the boot process. Now the + same function is called later, and it doesn't break the A20. + - [ #431010 ] SMP structure overwritten in v1.2 + SMP structures were getting overwritten by BCC-generated data, + preventing SMP operating systems from detecting that other processors + were available. + - [ #431016 ] bios: SMP struct has wrong entry count + SMP structure had the wrong entry counts +- very minor doc updates (typos, replace broken link to mtools info) +- quit when the user clicks the power button, even if they have disabled + panics. +- win32 now defaults to having mouse capture mode turned off. For new users, + it would be distressing for their mouse cursor to disappear until they + pressed F12. +- [ #428222 ] vga font not installed + added script called "install-x11-fonts" which should help people install + the VGA font on X windows systems, if it isn't already there. + +------------------------------------------------------------------------- +Changes in 1.2 (June 3, 2001): +- [ #427259 ] rombios HALT calls don't print + Fixed bios/rombios.c HALT macro so that it writes the line number of the + panic to the PANIC_PORT (port 0x400) and then does NOT do a halt + instruction. Also changed iodev/unmapped.cc so that the line number written + to PANIC_PORT is displayed as a BX_PANIC message. Because the HALT + macro now triggers the normal panic behavior, it can be controlled by + the bochsrc. +- [ #429016 ] crash if no hard drive + rombios used to call HALT macro if no hard drive was found. Now it only + calls HALT if a hard drive has an illegal geometry. +- [ #425388 ] include source for simple disk img tool + [ #428478 ] mkimg tool creates image 1 byte too big + Added bximage tool, which makes empty floppy and hard disk images. + It is now included in the top level Makefile, so it will get built + by default on all platforms. +- [ #426036 ] eth_fbsd.cc compile problem on solaris26 + added configure test so that "configure --enable-ne2000" only + includes the Berkeley Packet Filter code (eth_fbsd) if the header + file can be found. If you don't have BPF the ne2000 + will not actually move packets, but at least it will compile clean now. +- [ #428214 ] 1.2.pre1 need documentation for binaries + Write windows and linux specific documentation to be installed in + binary releases. +- [ #429258 ] disable RESET for version 1.2 + Since soft reset was not completely working, I reverted the reset patch. + Now it does panics on reset instead of trying to reboot, as the old + bochs versions did. +- [ #428222 ] Should the linux RPM install vga font? + now font/vga.pcf will be installed in the RPM package +- [ #429020 ] stop renaming the BIOS!!! + new BIOS changes are now in BIOS-bochs-latest, instead of a BIOS + whose name changes every time we change anything! To help distinguish + different BIOS versions, the BIOS now prints its RCS Id into the + log file. +- [ #428625 ] compile problem if SHOW_IPS is on + removed extra paren that broke SHOW_IPS +- [ #428219 ] PCI doesn't compile with SMF=1 +- [ #429375 ] pthreads detection broken +- [ #429073 ] configure: if no X11, makes bad config +- [ #429229 ] install current .bochsrc in binary rels +- install Tim's man pages on linux RPM +- BIOS prints messages in log in case of boot failure +- rewrote instructions for compiling in win32 (win32.txt) +- fixed link in HTML changelog.html to point to the real sources on SF. +- added missing LOG_THIS definition to gui/nogui.cc and gui/rfb.cc +- added additional check for null pointer in debugger exit routine +- added diskd to .bochsrc + +------------------------------------------------------------------------- +Changes in version 1.2-pre1 (May 25, 2001): +- major cleanup of .bochsrc +- major cleanup of stderr output: prints bochs version information when + starting, and at the end it tries to print the message that caused + bochs to quit. +- two hard disk support (diskd). At present, you cannot have two + hard drives and a cdrom at the same time, because there is only + one IDE controller with two channels. +- split hard disk support allows different partitions to be stored in + different image files +- two new GUI choices: term mode and RFB mode. Term is a text-only + interface, and RFB creates a server that can be accessed using + the AT&T VNC viewer. +- now Bochs can simulate an SMP machine, if you configure with + --enable-processors=N. Configuring more than one processor has + a major performance impact, so the default is 1 processor. + See SMP documentation for more details. +- to make SMP work, bx_mem and bx_cpu have been replaced with + bx_mem_array[] and bx_cpu_array[]. The cpus are referenced through + the BX_CPU(n) macro and memories through the BX_MEM(n). Normal + mode has one cpu and one memory, SMP mode has multiple cpu's and + one memory, cosimulation mode has multiple cpus and multiple memories. +- use --enable-cpu-level=6 to make Bochs claim to be a Pentium Pro. + The only feature that requires CPU level 6 is apic support. +- new logging system by Todd Fries, which has 4 levels of event + severity (panic, error, info, debug). There are new .bochsrc + options that control what action to take when a + panic/error/info/debug event occurs. +- now searches for .bochsrc, bochsrc, bochsrc.txt, and (on unix only) + $HOME/.bochsrc. +- use GNU readline library if --enable-debugger is on, as long as readline + can be found on the machine +- configure checks for existence strtoull and strtouq. if neither exists, + Bochs uses its own implementation +- applied patches from Cliff Hones to fix up the + rombios. This includes many improvements, which you can list by + doing "cvs log -r 1.6 bios/rombios.c" or looking at cvsweb. +- added suggested geometries of larger disks to the documentation +- this is the first release to have official binary packages for win32 + and Linux. There is a new "make rpm" in the top-level Makefile which + will create an RPM of the current bochs directory. To use this, + become root and type "configure; make rpm". +- applied some FreeBSD patches from Maxim Sobolev (cdrom and serial). + +------------------------------------------------------------------------- +Changes in version 1.1.2 (bugfix3, May 16, 2001): +- updated Elpin VGA BIOS to version 2.40, and changed pointer in .bochsrc +- fixed .conf.x86 script so that it uses c++ instead of egcs for C++ files +- now Makefile targets that recurse into subdirectories use double colons, + so that it will always recurse into subdirectories. Now a single make + command should notice a modified source file in a subdir. +- fixed bug in bx_panic. If BX_PANIC_IS_FATAL==0 and a (non-fatal) panic + occurs, it used to call bx_atexit() and then return. It should never + call bx_atexit, which starts to shut down the simulator, unless it's + really going to quit! +- support 2.88 MB floppy disks +- since dataseghack is checked in as non-executable, invoke it with + "csh dataseghack" +- double fault patch from Thomas Petazzoni , + sourceforge patch #423726. +- removed -fno-builtin from fpu makefiles +- redefine u_char, u_short, etc. in order to not conflict with system + definitions of these same types. +- in cdrom.cc, remove the extern "C" { } structure around some of the + header files. This is no longer necessary. +- do not panic on hard disk command 0x1f2 (read sector count) +- in keyboard.cc: + - apply Todd Fries' reset patch + - recognize most of the "Grey" insert/delete/home/end/etc. keys the + same as keypad keys. + - removed panic on "kbd_ctrl_to_kbd(): got value of 0x??" + - implement mouse command 0xf6 (set defaults) +- apply Suboner@aol.com's Xwindows timing patch from + http://sourceforge.net/tracker/index.php?func=detail&aid=418730&group_id=12580&atid=312580 +- remove all patches from patches subdir which have already been applied. + The remaining ones are under consideration but not applied. + +------------------------------------------------------------------------- +Changes in version 1.1.1 (bugfix2, April 9, 2001): +- in soundwin.cc, arg 3 should be typecast to LPWAVEFORMATEX +- in fpu_entry.c, Bryce mistyped his own initials! +- in configure.in and configure, define good defaults for VC++ + #define BX_64BIT_CONSTANTS_USE_LL 0 + #define inline __inline + #define BX_NO_EMPTY_STRUCTS 1 + #define BX_NO_ATTRIBUTES 1 + #define BX_HAVE_HASH_MAP 0 +- in config.h.in, fixed typo in #error message + +------------------------------------------------------------------------- +Changes in version 1.1 (bugfix1, April 6, 2001): + +(FIXED, patch #414360: update copyrights) +update headers. Change copyright to 2001, replace config.h.in header with +the standard mandrake header that every other file uses. + +(FIXED, patch #414356: inlines) +make macro to replace inline and static/extern keywords. Then make +define the macro appropriately based on configure. + +(FIXED: patch #414234: macos-no-strdup) +--with-macos should force HAVE_STRDUP=0. + +(FIXED, patch #403027: Fix mouse bugs in Linux and BSD) +Linux and BSD (maybe others) cause panic in mouse code. + +(FIXED, patch #413851: const64bit patch) +VC++ does not allow "LL" after 64-bit constant. + +(FIXED, patch #413859: fabs symbol conflict) +fpu code contains fabs, which conflicts with math library fabs. + +(FIXED, patch #403004: Implement aborts on a few SET FEATURE commands...) +Implement aborts on a few SET FEATURE commands for ATA. + +(FIXED, patch #402991: Update to iodev/vga.cc to add 3c3h read support) +Implement VGA enable register, at 0x3c3. + +(FIXED, patch #403027: Fix mouse bugs in Linux and BSD) +Mouse panic in linux/BSD: +KBD: io write 0x64: command = 0xD3(write mouse outb) + +(FIXED, patch #414229: panic-is-fatal) +Allow user to decide if panic is fatal, or just a warning + +(FIXED, patch #414230: sun-cdrom) +Support Sun CDROM + +(FIXED, patch #413574: portable1) +there are cases where a pointer is cast to a 32-bit int, +then later cast to a pointer and dereferenced, which crashes any 64-bit +machine. + +(FIXED, patch #413574: portable1) +some machines have no snprintf or strtoull. include a replacement function +when needed. + +(FIXED, patch #413574: portable1) +Some compilers don't allow "typedef struct { } foo;" + +(FIXED, patch #413574: portable1) +Some people don't have hash_map.h, used in dbg_main.cc. Disable this code +if hash_map.h not found. + +(FIXED, patch #413574: portable1) +Some compilers can't handle labels at the end of a block, as in + void main () { /*code*/ label: } + +(FIXED, patch #413574: portable1) +Most compilers can't handle __attribute__. Use macro to define it away. + +(FIXED, patch #413574: portable1) +if --enable-debugger, turn on --enable-disasm too. + +(FIXED, patch #413574: portable1) +ome compilers can't handle any chars after an #endif + +(FIXED, patch #413574: portable1) +wrong type arg1 of bx_dbg_watch and bx_dbg_unwatch. The code in +lexer.l was calling it with integers (not booleans) + +(FIXED, patch #413574: portable1) +in fpu code, "setcc" macro was implemented with braces inside parens, +which some compilers don't understand. + +(FIXED, patch #413574: portable1) +in fpu_entry.c, FPU_load_int32 was consistently called with arg1 of +type (s32 *), but should be (u32 *) + +(FIXED, patch #413574: portable1) +comment out sigcontext structure in fpu/stubs/asm/sigcontext.h because +it conflicted with sigcontext of other machines. This struct was never +used by bochs anyway. + +(FIXED, patch #414046: portable2) +move definition of missing library functions into osdep.h and osdep.cc, +include contents of macutils*. + +(FIXED, patch #414061: win32-rawcd) +CDROM drive letter for WIN32 should not be hardcoded. + +(FIXED, patch #414060: win32-rawfloppy) +Bypass fstat when opening WIN32 raw floppy disk. + +(FIXED, patch #414226: pit-panic) +WinME install dies with panic: +bochs: panic, pit: outp(43h): comm Bh, mode 00, bcd 00 unhandled +I think I had a similar problem. All three timers should support modes +0, 2, and 3. Other modes really aren't implemented. diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/COPYING.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/COPYING.txt new file mode 100644 index 0000000..223ede7 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/COPYING.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/LICENSE.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/LICENSE.txt new file mode 100644 index 0000000..008d147 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/LICENSE.txt @@ -0,0 +1,7 @@ +The following points clarify the Bochs license: + +1) Bochs as a whole is released under the GNU Lesser General Public License + +2) Parts of Bochs have specific licenses which are compatible with the + GNU Lesser General Public License. Hence each source file contains its + own licensing information. diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/README.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/README.txt new file mode 100644 index 0000000..e84f10f --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/README.txt @@ -0,0 +1,84 @@ +Bochs x86 Pentium+ Emulator +Updated: Mon Dec 24 10:52:00 CET 2007 +Version: 2.3.6 + +WHAT IS BOCHS? + +Bochs is a highly portable open source IA-32 (x86) PC emulator +written in C++, that runs on most popular platforms. It includes +emulation of the Intel x86 CPU, common I/O devices, and a custom +BIOS. Currently, Bochs can be compiled to emulate a 386, 486, +Pentium/PentiumII/PentiumIII/Pentium4 or x86-64 CPU, including optional +MMX, SSEx and 3DNow! instructions. Bochs is capable of running +most Operating Systems inside the emulation, for example Linux, DOS, +Windows 95/98/NT/2000/XP or Windows Vista. +Bochs was written by Kevin Lawton and is currently maintained by +the Bochs project at "http://bochs.sourceforge.net". + +Bochs can be compiled and used in a variety of modes, some which are +still in development. The 'typical' use of bochs is to provide +complete x86 PC emulation, including the x86 processor, hardware +devices, and memory. This allows you to run OS's and software within +the emulator on your workstation, much like you have a machine +inside of a machine. Bochs will allow you to run Windows +applications on a Solaris machine with X11, for example. + +Bochs is distributed under the GNU LGPL. See COPYING for details. + +GETTING CURRENT SOURCE CODE + +Source code for Bochs is available from the Bochs home page at +http://bochs.sourceforge.net. You can download the most recent +release, use CVS to get the latest sources, or grab a CVS +snapshot which is updated nightly. The releases contain the most +stable code, but if you want the very newest features try the +CVS version instead. + +WHERE ARE THE DOCS? + +The Bochs documentation is written in Docbook. Docbook is a text +format that can be rendered to many popular browser formats such +as HTML, PDF, and Postscript. Each binary release contains the +HTML rendering of the documentation. Also, you can view the +latest documentation on the web at + http://bochs.sf.net/doc/docbook/index.html + +Some information has not yet been transferred from the older +HTML docs. These can be found at http://bochs.sf.net/docs-html + +WHERE CAN I GET MORE INFORMATION? HOW DO I REPORT PROBLEMS? + +Both the documentation and the Bochs website have instructions on how +to join the bochs-developers mailing list, which is the primary +forum for discussion of Bochs. The main page of the website also +has links to bug reports and feature requests. You can browse and +add to the content in these areas even if you do not have a (free) +SourceForge account. We need your feedback so that we know what +parts of Bochs to improve. + +There is a patches section on the web site too, if you have made +some changes to Bochs that you want to share. + +HOW CAN I HELP? + +If you would like contribute to the Bochs project, a good first step +is to join the bochs-developers mailing list, and read the archive +of recent messages to see what's going on. + +If you are a technical person (can follow hardware specs, can write +C/C++) take a look at the list of open bug reports and feature +requests to see if you are interested in working on any of the +problems that are mentioned in them. If you check out the CVS +sources, make some changes, and create a patch, one of the +developers will be very happy to apply it for you. Developers who +frequently submit patches, or who embark on major changes in the +source can get write access to CVS. Be sure to communicate with the +bochs-developers list to avoid several people working on the same +thing without realizing it. + +If you are a Bochs user, not a hardware/C++ guru, there are still +many ways you could help out. For example: + - write instructions on how to install a particular operating system + - writing/cleaning up documentation + - testing out Bochs on every imaginable operating system and + reporting how it goes. diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/SeaBIOS-README.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/SeaBIOS-README.txt new file mode 100644 index 0000000..66103c4 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/SeaBIOS-README.txt @@ -0,0 +1,16 @@ +SeaBIOS is an open source implementation of a 16bit X86 BIOS. SeaBIOS +can run in an emulator or it can run natively on X86 hardware with the +use of coreboot (http://www.coreboot.org/). + +SeaBIOS is the default BIOS for qemu (http://www.qemu.org/) and +kvm (http://www.linux-kvm.org/). + +The coreboot SeaBIOS (http://www.coreboot.org/SeaBIOS) page has +information on using SeaBIOS in coreboot. Please see the +releases page for information on recent releases. See the +download page to obtain SeaBIOS. + +SeaVGABIOS is a sub-project of SeaBIOS. + +Please join the mailing list to contribute to SeaBIOS. Information on +the internals of SeaBIOS is available on the Developer Documentation page. diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/SeaVGABIOS-README.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/SeaVGABIOS-README.txt new file mode 100644 index 0000000..bbf0d28 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/SeaVGABIOS-README.txt @@ -0,0 +1,35 @@ +SeaVGABIOS is a sub-project of the SeaBIOS project - it is an open +source implementation of a 16bit X86 VGA BIOS +(http://en.wikipedia.org/wiki/Video_BIOS). SeaVGABIOS is the +default VGA BIOS on QEMU (http://www.qemu.org/). SeaVGABIOS can also +run natively on some X86 VGA hardware with coreboot (http://www.coreboot.org/). + +Building SeaVGABIOS +=================== + +To build SeaVGABIOS, obtain the code, run `make +menuconfig` and select the type of VGA BIOS to build in the "VGA ROM" +menu. Once selected, run `make` and the final VGA BIOS binary will be +located in "out/vgabios.bin". + +The choice of available VGA BIOSes within "make menuconfig" is +dependent on whether CONFIG_QEMU, CONFIG_COREBOOT, or CONFIG_CSM is +selected. Also, the debug options under the "Debugging" menu apply to +SeaVGABIOS. All other options found in "make menuconfig" apply only to +SeaBIOS and will not impact the SeaVGABIOS build. + +If SeaVGABIOS is needed for multiple different devices (eg, QEMU's +cirrus emulation and QEMU's "dispi" emulation), then one must compile +SeaVGABIOS multiple times with the appropriate config for each build. + +SeaVGABIOS code +=============== + +The source code for SeaVGABIOS is located in the SeaBIOS +git repository. The main VGA BIOS code is located in the "vgasrc/" +directory. The VGA BIOS code is always compiled in 16bit mode. + +The SeaVGABIOS builds to a separate binary from the main SeaBIOS +binary, and much of the VGA BIOS code is separate from the main BIOS +code. However, much of the SeaBIOS developer documentation applies to +SeaVGABIOS. To contribute, please join the SeaBIOS mailing list. diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/TESTFORM.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/TESTFORM.txt new file mode 100644 index 0000000..65e35f9 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/TESTFORM.txt @@ -0,0 +1,124 @@ +------------------------------------------------------------- +BOCHS TESTING FORM Version 0.3 +------------------------------------------------------------- + +Because of the variety of platforms and configurations that Bochs +supports, it is difficult for any one person to test it thoroughly. +This form is intended to help the Bochs developers keep track of test +results from different sources. To avoid confusion, this form should +be submitted once for each combination of host OS and guest OS you +try. For example: your host OS is Debian Linux and you get both Win95 +and FreeDOS to start up. You would send one form for +Win95-under-Debian and a second form for FreeDOS-under-Debian. In +this case it would save time to fill in the host OS part, copy it a +few times and fill out the guest OS part for each copy. + +To fill in a blank such as [__], replace the underlines and leave +the brackets. Example: [Sun Ultrasparc 10]. To fill in a +multiple-choice, just put an X in the brackets. Example: [X] +Mail completed forms to bochs-testing@tlw.com. + + +What is the date? +[__] + +What is your name? +[__] + +What is your email address? +[__] + +Do you mind if your name and email address are placed on a testing results +web page so that people with a similar setup can write to you? + [ ] Ok, put it on a web page + [ ] No, keep my address private. + +What type of hardware are you using, e.g. 500MHz Intel Celeron. +[__] + +What operating system are you using? Please be specific, e.g. +Redhat Linux 6.2 with 2.2.16 kernel. +[__] + +What version of bochs are you using? + [ ] compiled from version 2.1.1 + [ ] compiled from version [_____] + [ ] I compiled it from the CVS sources from date: [__] + [ ] other source distribution from URL: [__] + [ ] binary distribution from URL: [__] + +Please fill in the next few questions only if you compiled Bochs +yourself, as opposed to downloading a binary. + +Did the configure script run ok, and detect your hardware and +operating system? + [ ] Yes + [ ] No, configure crashed. + [ ] No, configure ran ok but produced a bad configuration. + [ ] No, I cannot run configure on my platform (win32 and mac). + +If you used configure, what arguments did you give it? If you used a +.conf.* script, give the name of the .conf script instead. +[__] + +What compiler did you use? (Please include version.) +[__] + +Did Bochs compile clean without any hacking? + [ ] Yes + [ ] No + +If you had to make changes to compile, please summarize the problems you +had or include diffs. +[__] + +End of compile-specific questions! + +What guest operating system are you using inside bochs? +[__] + +Are you booting from a floppy or hard disk? + [ ] floppy image + [ ] raw floppy drive + [ ] hard drive image + [ ] raw hard drive (is this even possible?) + [ ] other [__] + +Did the guest operating system boot successfully? + [ ] Yes + [ ] No + +If no, what error messages do you see on the console or in the log file? +[__] + +What applications worked under this guest operating system? +[__] + +What applications failed under this guest operating system? Did the +application function incorrectly, crash Bochs, or what? If you got a +panic, paste in the panic message that you received with some +description of what was happening at the time. +[__] + +The remaining questions are about Bochs features that you may not have +used. If you tried out the feature, move the X to the "works" or +"fails" column. + + Not Works + tested ok Fails Comments? +keyboard [ ] [ ] [ ] [__] +floppy disk [X] [ ] [ ] [__] +raw floppy disk [X] [ ] [ ] [__] +hard disk [X] [ ] [ ] [__] +floating point [X] [ ] [ ] [__] +mouse [X] [ ] [ ] [__] +cdrom [X] [ ] [ ] [__] +sb16 [X] [ ] [ ] [__] +ne2000 [X] [ ] [ ] [__] +i440FX pci [X] [ ] [ ] [__] +debugger [X] [ ] [ ] [__] +external loader [X] [ ] [ ] [__] +VGA [X] [ ] [ ] [__] + +Thank you for your contribution in the Bochs testing effort! Please +mail completed forms to bochs-testing@tlw.com. diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/TODO.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/TODO.txt new file mode 100644 index 0000000..8e7f699 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/TODO.txt @@ -0,0 +1,270 @@ +This is the "roadmap" posted in the mailing list, augmented by +comments from the mailing list and the irc chat. +Anybody is welcome to work on any of these issues. Some of +these items are rather simple and can be implemented by single +individuals. Other items are quite complex and development needs +to be coordonated. So, if you want to contribute, please drop +us a note in the mailing list, so you can get help or exchange +ideas. +Christophe Bothamy. + +0. Donations +Source Forge recently set up a donation system for hosted projects. +Should we accept donations ? What could we do with the money ? +- give to EFF, FSF or other +- fund Kevin to continue the work on plex86 so we can use it +- bounties for somebody write optimized win9x/NT/XFree/linux/*BSD + drivers for our vga/net/ide cards +- other ? +Status in Bochs 2.3: +No decisions about this yet. + +1. Speed +Speed (well lack of) is one of the biggest criticism made by users +who'd like to see Bochs run as fast as Virtual PC. +Paths we can explore to get more speed : +4.1 virtualization : plex86 +4.2 dynamic translation : qemu, patch from h.johansson +Status: +Some work has been done for Bochs 2.3.6 but still long way is ahead. + +2. Plugin architecture +2.1 The plugin architecture can be reworked if we want to support +multiple similar devices like seral net or vga cards. +We currently have two "types" of plugins: "core" and "optional". +Maybe we could add "classes" of plugins. The current version of +Bochs supports the classes "display_library" and "io_device". +New classes can be "config_interface", "net_lowlevel" and +"sound_lowlevel" +2.2 Stanislav wrote : +Plugin architecture should be rewritten like real plugin architecture s.t. +Bochs VGA plugin for example will be real plugin. I mean that replacement +of plugin dll in already compiled Bochs will replace Bochs VGA card and +the new card will be detected automatically. +This will allow for example developing of plugins separately from Bochs. +2.3 Michael Brown wrote : +If the configuration interface is to be reworked, could we also make it so +that plugins are self-contained, rather than needing to pollute config.cc +with code for defining and parsing plugin-specific options +Status: +A little bit of the basic work is done now: The config parameter handling has +been rewritten to a parameter tree and user-defined bochsrc options are now +supported. The main plugin architecture rewrite is not done yet. + +3. PCI host<->guest proxy +Being able to use a real pci device from inside Bochs would be a +great feature of Bochs. It would ease reverse engineering of non +documented cards, or one could even use a real spare vga card. +Frank Cornellis has done a great job on this subject, and we began +integrating his changes. +Status: +The pcidev device is present in CVS and it has been updated for the new PCI +infrastructure, but the new code is untested yet. + +4. Subdirectories in iodev +The iodev directory contains the various implemented iodevice. +With the new pci devices, new harddrives and new net access methods, +it could be interesting to add new subdirectories like : +iodev/video/... --> for standard vga and new card emulation +iodev/disks/... --> for the ata/atapi classes, hd/cd classes and host accesses +iodev/net/... --> for ne2k and host net access +isa and pci devices would be mixed in the directories, but this should +be manageable. +Status: +Not done yet. + +5 multithreading. Conn Clark wrote : +Threading might be nice too, for those of us who have SMP/SMT machines. +I have a patch from Mathis (who hangs out on the IRC channel all the +time) that puts the video card interface in its own thread. It has +troubles though that I have not resolved. It may also be easier to debug +a threaded peripheral. +I also think that it might be possible to thread a chunk of the CPU +emulation to improve performance on a SMP/SMT machine. Specificaly +write_virtual_dword, write_virtual_word, write_virtual_byte, etc... +might just be able to be threaded. I think the threading overhead might +be less than the protection and address translation code. We would have +to try it to find out. I'm also sure there can be some nasty hurdles to +overcome. +Status: +Third party proup started a para-Bochs project exacly to reach above goals, +some beta version is already released. +The home page of the project: http://grid.hust.edu.cn/cluster/VirtualMachine/index.html + +6. CPU +6.1 This was asked in the ml, and I believe it's a good idea to provide +a configure switch to set the cpu model, for example : +--with-cpu-386 +--with-cpu-486dx +--with-cpu-pentium +--with-cpu-pentium-mmx +--with-cpu-k6-iii +--with-cpu-amd64 +and so on. The main difficulty here is to set up the list of features +by cpu model. I started such a list, available at +http://cbothamy.free.fr/projects/bochs/CPU_Features.sxc +The configure script will then set up constants on features to compile in, +ISA, FPU, MMX, 3DNOW, SSE, etc... Most of the feature flags already +exists in config.h, so this should be easy. It would also be a good +idea to clean up the cpuid function beased on those flags. +We also have to keep in mind that some features are also enablable +by the guest os. +Please note the all features are still not supported/complete in Bochs. +6.2 Stanislav thinks that configure --with-cpu-pentium-mmx --enable-cpu-level-4 +would create lots of conflicts in the generated config.h. He suggests +that we should write an external GUI configure script that would propose +standard or custom cpus and would detect conflicts. +Status: +Not done yet. + +7. VGA +For SVGA emulation we have Bochs VBE and the Cirrus adapter. We should have +a look at the voodoo3 (specs http://v3tv.sourceforge.net/docs.php). +Status: +Not done yet. + +8. Random thoughts on disk emulation improvements : +8.1 lba48 support +8.2 autodetection of disk size / geometry +8.3 uml cow disk image support +8.4 compressed disk image support +8.5 extend redolog-disk specification to add coherency check of the flat +image file, by storing its fstat-mtime field in the redolog. +Status: +Autodetection now works for all image types created with bximage and vmware3 +images. LBA48 and vmware4 disk images support was added in Bochs 2.3.5 release. +The other items are not done yet. + +9. net +9.1 bootable ethernet rom ? +see etherboot, Micheal Brown wrote : +This already works; you can build an Etherboot rom image with the pnic +driver, specify it as an option ROM in bochsrc and it will boot. I'm +using this extensively at the moment in Etherboot development. +In the Etherboot project's CVS, in the contrib/bochs directory, you can +find a working bochsrc file and an up-to-date README with step-by-step +instructions on getting this working. +Status: +The pnic device is present in CVS, but the status is unknown. + +10. Bios +10.1 our bios is quite heavy on stack space (notably during int13 functions). +Some parts can be rewritten in assembler, to save stack space and +make code smaller. +Status: +New BIOS supporting ACPI was introduced in Bochs 2.3.5 release. + +10.2 add "jump table placeholder" and log missing function calls in the bios. +Check completness with Ralf Brown interrupt list. +Status: +Not done yet. + +11. LGPL VGABios +11.1 Video parameters table +There is a very nice parameter table in 3dfx banshee document +http://www2.lm-sensors.nu/~lm78/pdfs/Banshee_2d_spec.PDF +see also http://www.xyzzy.claranet.de/dos/vgacrt.c +Status: +The new version 0.6a of the LGPL'd VGABIOS has minimal support for the video +parameter table. + +12. Optimized Guest drivers still needed : VGA, IDE, NET +We have a specific VGA driver for winNT/2K, but still +lack drivers for other OSes. +Status: +Not done yet. + +13. USB support +Ben Lunt has been working on USB support. The USB mouse and keypad code +is present in Bochs and almost stable. USB flash disk support has been +started and the runtime device change support should be completed. +Status: +Under construction. + +14. Config file and dynamic menu +14.1 Benjamen R. Meyer wrote : +I think we should rework the .bochsrc file to be more standard across all +devices. I like how the USB configuration is done in it, and think we should +put something similar together for everything else. In otherwords, create +something that can be easily used for everything, and make it easier to +configure in the process. +From what I can tell right now, most of the configuration lines are randomly +thrown together as each gets implemented or added, instead of having +something that is based on a standard approach to the configuration. +The result should be something that would be able to easily auto-configured +by another program (a configuration editor?) with minimal changes necessary +when new devices/features are added. +14.2 Franck Cornelis wrote : the config system needs some work... +e.g. the main menu is static while it could be generated at run-time... +the main menu text lives somewhere in a file... while it should be generated +at run-time by iterating the main menu objects +Status: +The config options handling has been rewritten to a parameter tree. + +15. Save/Restore +Save/restore of config and log options and the hardware state is supported +in all Bochs configurations. Harddisk images are not handled yet. + +16. add to the roadmap that we should find some ideas to check +correctness of instructions emulation, especially system instructions. +arithmetic instructions could be validated with simply random testing +Status: +Not done yet. + +17. lowlevel serial support for Windows. +Volker is currently working on this. +Status: +Not yet complete (transmit works, receive is losing data). + +18. Parallel port +Conn Clark wrote : +I would like to see better parallel port support so I can use a dongle. +This is something I would find very useful as it would mean I wouldn't +have to boot back into windows ever again. I also recognize that this +may require a kernel module be written, which is beyond my current +skills. I know others will find this useful as I have had to tell a +few people that their parallel port driven peripherals that require a +bidirectional parallel port won't work. +Status: +Not done yet. + +19. Patches / Bug reports +There are dozens of patches floating around. Some are outdated, +don't apply cleanly, are obsolete/unneeded. We could try to do +some clean-up, and keep only relevent ones. +We should also clean up the SF bug tracker. Some bugreports are +very old and we asked for more information with no response. +Status: +There is some progress, but still a lot of work to do. + +20. Positions +If you want to help without coding, here are available positions : +20.1 Webmaster : update website (Jan Bruun Andersen offered to help) +22.2 patch coordonator : look at incoming patches (sourceforge and +mailing list) and upload / update in the cvs patches directory. +20.3 platform maintainers for macos / win32 +20.4 disk image maintainer : create and maintain our collection +of disk images. Usually, only the configuration file needs to be +updated, and old bios files have to be removed. Some packages +still contain very old bios files, they should definitely have +to be removed. +Status: +More active developers are needed to do the things described above. + +21. Bochs demo cd/dvd +With version 2.1, it is now technically possible to use disk images +on a read-only media, with a journal files on a read/write media. +It would be great to create a demo cd/dvd with executables for +supported platforms, configuration files and read-only disk +images, the journal files would be written in a temporary +directory on the harddisk. +Status: +Not done yet. + +22. Other CPU architectures : arm, ppc +This has been asked in the mailing list. I'm not really +interested, but other people might be. Should we propose to +host the new CPUs code in our source tree, or should we let +people fork ? +Status: +Not done yet. diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/Uninstall.exe b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/Uninstall.exe new file mode 100644 index 0000000..af62f9f Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/Uninstall.exe differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-elpin-2.40 b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-elpin-2.40 new file mode 100644 index 0000000..fc3d99d Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-elpin-2.40 differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-elpin-LICENSE.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-elpin-LICENSE.txt new file mode 100644 index 0000000..0ba5717 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-elpin-LICENSE.txt @@ -0,0 +1,9 @@ +The VGA BIOS from Elpin Systems, Inc. (http://www.elpin.com/) +is now permanently licensed for use with bochs, courtesy +of MandrakeSoft, creators of the leading "Linux-Mandrake" +distribution (http://www.linux-mandrake.com/). You may +freely use/distribute it with bochs, as long as it is used +in bochs for the intended use as a VGA BIOS. + +Please check out Elpin Systems. They make cool software games, +educational software, and VGA development products. diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-README.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-README.txt new file mode 100644 index 0000000..3b585e6 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-README.txt @@ -0,0 +1,214 @@ +Plex86/Bochs VGABios +-------------------- + +The goal of this project is to have a LGPL'd Video Bios in plex86, +Bochs and qemu. +This VGA Bios is very specific to the emulated VGA card. +It is NOT meant to drive a physical vga card. + + +Cirrus SVGA extension +--------------------- + +The Cirrus SVGA extension is designed for the Cirrus emulation in Bochs and +qemu. The initial patch for the Cirrus extension has been written by Makoto +Suzuki (suzu). + + +Install +------- +To compile the VGA Bios you will need : +- gcc +- bcc +- as86 +- ld86 + +Untar the archive, and type make. You should get a "VGABIOS-lgpl-latest.bin" +file. Alternatively, you can use the binary file "VGABIOS-lgpl-latest.bin", +i have compiled for you. + +Edit your plex86/bochs conf file, and modify the load-rom command in the +VGA BIOS section, to point to the new vgabios image file. + + +Debugging +--------- +You can get a very basic debugging system: messages printed by the vgabios. +You have to register the "unmapped" device driver in plex86 or bochs, and make +sure it grabs port 0xfff0. + +Comment the #undef DEBUG at the beginning of vgabios.c. +You can then use the "printf" function in the bios. + + +Testing +------- +Look at the "testvga.c" file in the archive. This is a minimal Turbo C 2.0 +source file that calls a few int10 functions. Feel free to modify it to suit +your needs. + + +Copyright and License +--------------------- +This program has been written by Christophe Bothamy +It is protected by the GNU Lesser Public License, which you should +have received a copy of along with this package. + + +Reverse Engineering +------------------- +The VGA Bios has been written without reverse-engineering any existing Bios. + + +Acknowledgment +-------------- +The source code contains code ripped from rombios.c of plex86, written +by Kevin Lawton + +The source code contains fonts from fntcol16.zip (c) by Joseph Gil avalable at : +ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip +These fonts are public domain + +The source code is based on information taken from : +- Kevin Lawton's vga card emulation for bochs/plex86 +- Ralf Brown's interrupts list avalaible at + http://www.cs.cmu.edu/afs/cs/user/ralf/pub/WWW/files.html +- Finn Thogersons' VGADOC4b available at http://home.worldonline.dk/~finth/ +- Michael Abrash's Graphics Programming Black Book +- Francois Gervais' book "programmation des cartes graphiques cga-ega-vga" + edited by sybex +- DOSEMU 1.0.1 source code for several tables values and formulas + + +Feedback +-------- +Please report any bugs, comments, patches for this VGA Bios to info@vruppert.de +You can find the latest release at : http://www.nongnu.org/vgabios/ +For any information on bochs, visit the website http://bochs.sourceforge.net/ +For any information on qemu, visit the website http://fabrice.bellard.free.fr/qemu/ + + +History +------- +vgabios-0.6a : Aug 19 2006 + - Volker + . added minimal support for the video parameter table (VPT) + . Cirrus SVGA now supports the "no clear" bit in Cirrus and VESA mode + . Bochs VBE protected mode interface improved + . save/restore video state support for Bochs VBE and standard VGA added + . generate vbetables.h dynamicly + . VBE video memory increased to 8 MB (VBE dispi ID changed to B0C4) + . lots of 4bpp VBE fixes (all 4bpp VBE modes now enabled) + . VGA compatible setup for VBE modes added + +vgabios-0.5d : Dec 29 2005 + - Volker + . Bochs VBE protected mode interface added (based on a patch by malc@pulsesoft.com) + . biossums utility now supports VGABIOS sizes up to 64 kBytes + . VGA mode 0x11: all color planes must be enabled in this 2-color VGA mode + +vgabios-0.5c : Jul 07 2005 + - Volker + . BIOS configuration word usually reports initial mode 80x25 color text + . vgabios function 0x0e (write teletype): linefeed (0x0a) only increments the + cursor row value + +vgabios-0.5b : May 24 2005 + - Volker + . fixed return value for the default case in the VBE section (non-debug mode) + . removed unused stuff + +vgabios-0.5a : Mar 07 2005 + - Volker + . Cirrus SVGA extension (initial patches from Makoto Suzuki, improvements + from Fabrice Bellard) + . vgabios image size is now exactly 32k with a checksum + . a lot of vgabios and vbe functions rewritten in assembler + . dynamicly generated VBE mode info list + . write character function for CGA and LINEAR8 modes + . read/write graphics pixel for some graphics modes + . text scroll feature for some graphics modes + . VBE 8-bit DAC support + +vgabios-0.4c : Nov 06 2003 + - Christophe + . fix font problem on initial screen of NT4 Loader + +vgabios-0.4b : Nov 04 2003 + - Volker + . fix offset of character tables + . optimizations of CRT controller accesses + . VBE i/o registers changed to 0x01CE/CF + (suggestion from Daniel Gimpelevich) + . "noclear" flag stored in BIOS area + . fix character height returned by get_font_info function + +vgabios-0.4a : Aug 17 2003 + - Volker + . VBE mode search rewritten (VBE modes with LFB bit removed) + . many bugfixes and optimizations + . write character function implemented for graphics modes + . support for 15bpp, 16bpp, 24bpp and 32bpp VBE modes added + . SVGA mode 0x6A added + . VBE modes 0x102, 0x117, 0x118 and 0x142 (Bochs specific) + +vgabios-0.3b : Nov 23 2002 + - Christophe + . added lfb-mode numbers (patch from mathis) + . updated the Makefile + . removed display of copyrights. + . changed the Copyright string to "LGPL VGABios developers" + - Volker + . set the cursor shape depending on the current font height + . clear BL before calling int 0x10 function 0x1103 in vgabios_init_func + . added some text font functions + - Jeroen + . Forced to new DISPI (0xb0c1) interface (requires latest bochs vbe code) + . Added multibuffering support + . Added new DISPI interface for: virt width, height, x offset, y offset + . Added LFB modes (to be used with the vbe-lfb patch in bochs) + see VBE_HAVE_LFB in vbe.c (currently default enabled) + . updated TODO & docs for changes after bochs 1.4 + +vgabios-0.3a : Mar 10 2002 + - Christophe + . Fixed bug in function ah=13 + - Jeroen + . updated vbebios implementation to new api + . added vbe_display_api documentation + . added 640x400x8, 640x480x8, 800x600x8, 1024x768 + (>640x480 needs a special bochs patch atm) + . added 320x200x8 vbe support (uses the standard 320x200x8 vga mode to + display, this allows for testing & having something on screen as well, + at least until bochs host side display is up & running) + . adding lfbprof (vbe) testprogram (+some small fixes to it) + . merging with vbebios 0.2 + +vgabios-0.2b : Nov 19 2001 + - Christophe + . Fixed bug in function ah=13 + +vgabios-0.2a : Nov 09 2001 + - Christophe + . Included bugfix from techt@pikeonline.net about grayscale summing + . Added the "IBM" string at org 0x1e as Bart Oldeman suggested + . Fixed DS and ES that where inverted in the int10 parameters list! + . The following have been implemented : + - function ax=1a00, ax=1a01, ah=1b + - function ax=1130 + . Added debug messages for unimplemented/unknown functions + Must be compiled with DEBUG defined. The output is trapped + by the unknown-ioport driver of plex/bochs (port 0xfff0 is used) + +vgabios-0.1a : May 8 2001 + - Christophe + . First release. The work has been focused only on text mode. + . The following have been implemented : + - inits + - int 10 handler + - functions ah=00, ah=01, ah=02, ah=03, ah=05, ah=06, ah=07, ah=08 + ah=09, ah=0a, ah=0e, ah=0f, ax=1000, ax=1001, ax=1002, ax=1003 + ax=1007, ax=1008, ax=1009, ax=1010, ax=1012, ax=1013, ax=1015 + ax=1017, ax=1018, ax=1019, ax=101a, ax=101b, ah=12 bl=10, + ah=12 bl=30, ah=12 bl=31, ah=12 bl=32, ah=12 bl=33, ah=12 bl=34 + ah=13 diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest new file mode 100644 index 0000000..1e0e5e1 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest-cirrus b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest-cirrus new file mode 100644 index 0000000..c129b71 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest-cirrus differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest-cirrus-debug b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest-cirrus-debug new file mode 100644 index 0000000..4e73c51 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest-cirrus-debug differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest-debug b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest-debug new file mode 100644 index 0000000..a1ea7f7 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/VGABIOS-lgpl-latest-debug differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bios.bin-1.13.0 b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bios.bin-1.13.0 new file mode 100644 index 0000000..f7bb4f4 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bios.bin-1.13.0 differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochs.exe b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochs.exe new file mode 100644 index 0000000..3248454 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochs.exe differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochs.ico b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochs.ico new file mode 100644 index 0000000..53b9b54 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochs.ico differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochsdbg.exe b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochsdbg.exe new file mode 100644 index 0000000..7bf6aeb Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochsdbg.exe differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochsrc-sample.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochsrc-sample.txt new file mode 100644 index 0000000..b7a6dea --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bochsrc-sample.txt @@ -0,0 +1,763 @@ +# You may now use double quotes around pathnames, in case +# your pathname includes spaces. + +#======================================================================= +# CONFIG_INTERFACE +# +# The configuration interface is a series of menus or dialog boxes that +# allows you to change all the settings that control Bochs's behavior. +# There are two choices of configuration interface: a text mode version +# called "textconfig" and a graphical version called "wx". The text +# mode version uses stdin/stdout and is always compiled in. The graphical +# version is only available when you use "--with-wx" on the configure +# command. If you do not write a config_interface line, Bochs will +# choose a default for you. +# +# NOTE: if you use the "wx" configuration interface, you must also use +# the "wx" display library. +#======================================================================= +#config_interface: textconfig +#config_interface: wx + +#======================================================================= +# DISPLAY_LIBRARY +# +# The display library is the code that displays the Bochs VGA screen. Bochs +# has a selection of about 10 different display library implementations for +# different platforms. If you run configure with multiple --with-* options, +# the display_library command lets you choose which one you want to run with. +# If you do not write a display_library line, Bochs will choose a default for +# you. +# +# The choices are: +# x use X windows interface, cross platform +# win32 use native win32 libraries +# carbon use Carbon library (for MacOS X) +# beos use native BeOS libraries +# macintosh use MacOS pre-10 +# amigaos use native AmigaOS libraries +# sdl use SDL library, cross platform +# svga use SVGALIB library for Linux, allows graphics without X11 +# term text only, uses curses/ncurses library, cross platform +# rfb provides an interface to AT&T's VNC viewer, cross platform +# wx use wxWidgets library, cross platform +# nogui no display at all +# +# NOTE: if you use the "wx" configuration interface, you must also use +# the "wx" display library. +# +# Specific options: +# Some display libraries now support specific option to control their +# behaviour. See the examples below for currently supported options. +#======================================================================= +#display_library: amigaos +#display_library: beos +#display_library: carbon +#display_library: macintosh +#display_library: nogui +#display_library: rfb, options="timeout=60" # time to wait for client +#display_library: sdl, options="fullscreen" # startup in fullscreen mode +#display_library: term +#display_library: win32, options="legacyF12" # use F12 to toggle mouse +#display_library: win32, options="windebug" # use experimental debugger gui +#display_library: wx +#display_library: x + +#======================================================================= +# ROMIMAGE: +# The ROM BIOS controls what the PC does when it first powers on. +# Normally, you can use a precompiled BIOS in the source or binary +# distribution called BIOS-bochs-latest. The ROM BIOS is usually loaded +# starting at address 0xf0000, and it is exactly 64k long. Another option +# is 128k BIOS which is loaded at address 0xe0000. +# You can also use the environment variable $BXSHARE to specify the +# location of the BIOS. +# The usage of external large BIOS images (up to 512k) at memory top is +# now supported, but we still recommend to use the BIOS distributed with +# Bochs. Now the start address can be calculated from image size. +#======================================================================= +romimage: file=$BXSHARE/BIOS-bochs-latest +#romimage: file=mybios.bin, address=0xfff80000 # 512k at memory top + +#======================================================================= +# CPU: +# This defines cpu-related parameters inside Bochs: +# +# COUNT: +# Set the number of processors:cores per processor:threads per core +# when Bochs is compiled for SMP emulation. +# Bochs currently supports up to 8 threads running simultaniosly. +# If Bochs is compiled without SMP support, it won't accept values +# different from 1. +# +# QUANTUM: +# Maximum amount of instructions allowed to execute by processor before +# returning control to another cpu. This option exists only in Bochs +# binary compiled with SMP support. +# +# RESET_ON_TRIPLE_FAULT: +# Reset the CPU when triple fault occur (highly recommended) rather than +# PANIC. Remember that if you trying to continue after triple fault the +# simulation will be completely bogus ! +# +# IPS: +# Emulated Instructions Per Second. This is the number of IPS that bochs +# is capable of running on your machine. You can recompile Bochs with +# --enable-show-ips option enabled, to find your workstation's capability. +# Measured IPS value will then be logged into your log file or status bar +# (if supported by the gui). +# +# IPS is used to calibrate many time-dependent events within the bochs +# simulation. For example, changing IPS affects the frequency of VGA +# updates, the duration of time before a key starts to autorepeat, and +# the measurement of BogoMips and other benchmarks. +# +# Examples: +# +# Bochs Machine/Compiler Mips +# ____________________________________________________________________ +# 2.2.6 2.6Ghz Intel Core 2 Duo with WinXP/g++ 3.4 21 to 25 Mips +# 2.2.6 2.1Ghz Athlon XP with Linux 2.6/g++ 3.4 12 to 15 Mips +# 2.0.1 1.6Ghz Intel P4 with Win2000/g++ 3.3 5 to 7 Mips +# 1.4 650Mhz Athlon K-7 with Linux 2.4.4/egcs-2.91.66 2 to 2.5 Mips +# 1.4 400Mhz Pentium II with Linux 2.0.36/egcs-1.0.3 1 to 1.8 Mips +#======================================================================= +cpu: count=1, ips=10000000, reset_on_triple_fault=1 + +#======================================================================= +# MEGS +# Set the number of Megabytes of physical memory you want to emulate. +# The default is 32MB, most OS's won't need more than that. +# The maximum amount of memory supported is 2048Mb. +#======================================================================= +#megs: 256 +#megs: 128 +#megs: 64 +megs: 32 +#megs: 16 +#megs: 8 + +#======================================================================= +# OPTROMIMAGE[1-4]: +# You may now load up to 4 optional ROM images. Be sure to use a +# read-only area, typically between C8000 and EFFFF. These optional +# ROM images should not overwrite the rombios (located at +# F0000-FFFFF) and the videobios (located at C0000-C7FFF). +# Those ROM images will be initialized by the bios if they contain +# the right signature (0x55AA) and a valid checksum. +# It can also be a convenient way to upload some arbitrary code/data +# in the simulation, that can be retrieved by the boot loader +#======================================================================= +#optromimage1: file=optionalrom.bin, address=0xd0000 +#optromimage2: file=optionalrom.bin, address=0xd1000 +#optromimage3: file=optionalrom.bin, address=0xd2000 +#optromimage4: file=optionalrom.bin, address=0xd3000 + +#optramimage1: file=/path/file1.img, address=0x0010000 +#optramimage2: file=/path/file2.img, address=0x0020000 +#optramimage3: file=/path/file3.img, address=0x0030000 +#optramimage4: file=/path/file4.img, address=0x0040000 + +#======================================================================= +# VGAROMIMAGE +# You now need to load a VGA ROM BIOS into C0000. +#======================================================================= +#vgaromimage: file=bios/VGABIOS-elpin-2.40 +vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest +#vgaromimage: file=bios/VGABIOS-lgpl-latest-cirrus + +#======================================================================= +# VGA: +# Here you can specify the display extension to be used. With the value +# 'none' you can use standard VGA with no extension. Other supported +# values are 'vbe' for Bochs VBE and 'cirrus' for Cirrus SVGA support. +#======================================================================= +#vga: extension=cirrus +vga: extension=vbe + +#======================================================================= +# FLOPPYA: +# Point this to pathname of floppy image file or device +# This should be of a bootable floppy(image/device) if you're +# booting from 'a' (or 'floppy'). +# +# You can set the initial status of the media to 'ejected' or 'inserted'. +# floppya: 2_88=path, status=ejected (2.88M 3.5" floppy) +# floppya: 1_44=path, status=inserted (1.44M 3.5" floppy) +# floppya: 1_2=path, status=ejected (1.2M 5.25" floppy) +# floppya: 720k=path, status=inserted (720K 3.5" floppy) +# floppya: 360k=path, status=inserted (360K 5.25" floppy) +# floppya: 320k=path, status=inserted (320K 5.25" floppy) +# floppya: 180k=path, status=inserted (180K 5.25" floppy) +# floppya: 160k=path, status=inserted (160K 5.25" floppy) +# floppya: image=path, status=inserted (guess type from image size) +# +# The path should be the name of a disk image file. On Unix, you can use a raw +# device name such as /dev/fd0 on Linux. On win32 platforms, use drive letters +# such as a: or b: as the path. The parameter 'image' works with image files +# only. In that case the size must match one of the supported types. +#======================================================================= +floppya: 1_44=/dev/fd0, status=inserted +#floppya: image=../1.44, status=inserted +#floppya: 1_44=/dev/fd0H1440, status=inserted +#floppya: 1_2=../1_2, status=inserted +#floppya: 1_44=a:, status=inserted +#floppya: 1_44=a.img, status=inserted +#floppya: 1_44=/dev/rfd0a, status=inserted + +#======================================================================= +# FLOPPYB: +# See FLOPPYA above for syntax +#======================================================================= +#floppyb: 1_44=b:, status=inserted +#floppyb: 1_44=b.img, status=inserted + +#======================================================================= +# ATA0, ATA1, ATA2, ATA3 +# ATA controller for hard disks and cdroms +# +# ata[0-3]: enabled=[0|1], ioaddr1=addr, ioaddr2=addr, irq=number +# +# These options enables up to 4 ata channels. For each channel +# the two base io addresses and the irq must be specified. +# +# ata0 and ata1 are enabled by default with the values shown below +# +# Examples: +# ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 +# ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15 +# ata2: enabled=1, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11 +# ata3: enabled=1, ioaddr1=0x168, ioaddr2=0x360, irq=9 +#======================================================================= +ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 +ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15 +ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11 +ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9 + +#======================================================================= +# ATA[0-3]-MASTER, ATA[0-3]-SLAVE +# +# This defines the type and characteristics of all attached ata devices: +# type= type of attached device [disk|cdrom] +# mode= only valid for disks [flat|concat|external|dll|sparse|vmware3] +# mode= only valid for disks [undoable|growing|volatile] +# path= path of the image +# cylinders= only valid for disks +# heads= only valid for disks +# spt= only valid for disks +# status= only valid for cdroms [inserted|ejected] +# biosdetect= type of biosdetection [none|auto], only for disks on ata0 [cmos] +# translation=type of translation of the bios, only for disks [none|lba|large|rechs|auto] +# model= string returned by identify device command +# journal= optional filename of the redolog for undoable and volatile disks +# +# Point this at a hard disk image file, cdrom iso file, or physical cdrom +# device. To create a hard disk image, try running bximage. It will help you +# choose the size and then suggest a line that works with it. +# +# In UNIX it may be possible to use a raw device as a Bochs hard disk, +# but WE DON'T RECOMMEND IT. In Windows there is no easy way. +# +# In windows, the drive letter + colon notation should be used for cdroms. +# Depending on versions of windows and drivers, you may only be able to +# access the "first" cdrom in the system. On MacOSX, use path="drive" +# to access the physical drive. +# +# The path is always mandatory. Disk geometry autodetection works with images +# created by bximage if CHS is set to 0/0/0 (cylinders are calculated using +# heads=16 and spt=63). For other hard disk images and modes the cylinders, +# heads, and spt are mandatory. +# +# Default values are: +# mode=flat, biosdetect=auto, translation=auto, model="Generic 1234" +# +# The biosdetect option has currently no effect on the bios +# +# Examples: +# ata0-master: type=disk, mode=flat, path=10M.sample, cylinders=306, heads=4, spt=17 +# ata0-slave: type=disk, mode=flat, path=20M.sample, cylinders=615, heads=4, spt=17 +# ata1-master: type=disk, mode=flat, path=30M.sample, cylinders=615, heads=6, spt=17 +# ata1-slave: type=disk, mode=flat, path=46M.sample, cylinders=940, heads=6, spt=17 +# ata2-master: type=disk, mode=flat, path=62M.sample, cylinders=940, heads=8, spt=17 +# ata2-slave: type=disk, mode=flat, path=112M.sample, cylinders=900, heads=15, spt=17 +# ata3-master: type=disk, mode=flat, path=483M.sample, cylinders=1024, heads=15, spt=63 +# ata3-slave: type=cdrom, path=iso.sample, status=inserted +#======================================================================= +ata0-master: type=disk, mode=flat, path="30M.sample" +#ata0-master: type=disk, mode=flat, path="30M.sample", cylinders=615, heads=6, spt=17 +#ata0-master: type=disk, mode=flat, path="c.img", cylinders=0 # autodetect +#ata0-slave: type=cdrom, path=D:, status=inserted +#ata0-slave: type=cdrom, path=/dev/cdrom, status=inserted +#ata0-slave: type=cdrom, path="drive", status=inserted +#ata0-slave: type=cdrom, path=/dev/rcd0d, status=inserted + +#======================================================================= +# BOOT: +# This defines the boot sequence. Now you can specify up to 3 boot drives, +# which can be 'floppy', 'disk', 'cdrom' or 'network' (boot ROM). +# Legacy 'a' and 'c' are also supported. +# Examples: +# boot: floppy +# boot: cdrom, disk +# boot: network, disk +# boot: cdrom, floppy, disk +#======================================================================= +#boot: floppy +boot: disk + +#======================================================================= +# CLOCK: +# This defines the parameters of the clock inside Bochs: +# +# SYNC: +# TO BE COMPLETED (see Greg explanation in feature request #536329) +# +# TIME0: +# Specifies the start (boot) time of the virtual machine. Use a time +# value as returned by the time(2) system call. If no time0 value is +# set or if time0 equal to 1 (special case) or if time0 equal 'local', +# the simulation will be started at the current local host time. +# If time0 equal to 2 (special case) or if time0 equal 'utc', +# the simulation will be started at the current utc time. +# +# Syntax: +# clock: sync=[none|slowdown|realtime|both], time0=[timeValue|local|utc] +# +# Example: +# clock: sync=none, time0=local # Now (localtime) +# clock: sync=slowdown, time0=315529200 # Tue Jan 1 00:00:00 1980 +# clock: sync=none, time0=631148400 # Mon Jan 1 00:00:00 1990 +# clock: sync=realtime, time0=938581955 # Wed Sep 29 07:12:35 1999 +# clock: sync=realtime, time0=946681200 # Sat Jan 1 00:00:00 2000 +# clock: sync=none, time0=1 # Now (localtime) +# clock: sync=none, time0=utc # Now (utc/gmt) +# +# Default value are sync=none, time0=local +#======================================================================= +#clock: sync=none, time0=local + + +#======================================================================= +# FLOPPY_BOOTSIG_CHECK: disabled=[0|1] +# Enables or disables the 0xaa55 signature check on boot floppies +# Defaults to disabled=0 +# Examples: +# floppy_bootsig_check: disabled=0 +# floppy_bootsig_check: disabled=1 +#======================================================================= +floppy_bootsig_check: disabled=0 + +#======================================================================= +# LOG: +# Give the path of the log file you'd like Bochs debug and misc. verbiage +# to be written to. If you don't use this option or set the filename to +# '-' the output is written to the console. If you really don't want it, +# make it "/dev/null" (Unix) or "nul" (win32). :^( +# +# Examples: +# log: ./bochs.out +# log: /dev/tty +#======================================================================= +#log: /dev/null +log: bochsout.txt + +#======================================================================= +# LOGPREFIX: +# This handles the format of the string prepended to each log line. +# You may use those special tokens : +# %t : 11 decimal digits timer tick +# %i : 8 hexadecimal digits of cpu current eip (ignored in SMP configuration) +# %e : 1 character event type ('i'nfo, 'd'ebug, 'p'anic, 'e'rror) +# %d : 5 characters string of the device, between brackets +# +# Default : %t%e%d +# Examples: +# logprefix: %t-%e-@%i-%d +# logprefix: %i%e%d +#======================================================================= +#logprefix: %t%e%d + +#======================================================================= +# LOG CONTROLS +# +# Bochs now has four severity levels for event logging. +# panic: cannot proceed. If you choose to continue after a panic, +# don't be surprised if you get strange behavior or crashes. +# error: something went wrong, but it is probably safe to continue the +# simulation. +# info: interesting or useful messages. +# debug: messages useful only when debugging the code. This may +# spit out thousands per second. +# +# For events of each level, you can choose to crash, report, or ignore. +# TODO: allow choice based on the facility: e.g. crash on panics from +# everything except the cdrom, and only report those. +# +# If you are experiencing many panics, it can be helpful to change +# the panic action to report instead of fatal. However, be aware +# that anything executed after a panic is uncharted territory and can +# cause bochs to become unstable. The panic is a "graceful exit," so +# if you disable it you may get a spectacular disaster instead. +#======================================================================= +panic: action=ask +error: action=report +info: action=report +debug: action=ignore +#pass: action=fatal + +#======================================================================= +# DEBUGGER_LOG: +# Give the path of the log file you'd like Bochs to log debugger output. +# If you really don't want it, make it /dev/null or '-'. :^( +# +# Examples: +# debugger_log: ./debugger.out +#======================================================================= +#debugger_log: /dev/null +#debugger_log: debugger.out +debugger_log: - + +#======================================================================= +# COM1, COM2, COM3, COM4: +# This defines a serial port (UART type 16550A). In the 'term' you can specify +# a device to use as com1. This can be a real serial line, or a pty. To use +# a pty (under X/Unix), create two windows (xterms, usually). One of them will +# run bochs, and the other will act as com1. Find out the tty the com1 +# window using the `tty' command, and use that as the `dev' parameter. +# Then do `sleep 1000000' in the com1 window to keep the shell from +# messing with things, and run bochs in the other window. Serial I/O to +# com1 (port 0x3f8) will all go to the other window. +# Other serial modes are 'null' (no input/output), 'file' (output to a file +# specified as the 'dev' parameter), 'raw' (use the real serial port - under +# construction for win32), 'mouse' (standard serial mouse - requires +# mouse option setting 'type=serial', 'type=serial_wheel' or 'type=serial_msys') +# and 'socket' (connect a networking socket). +# +# Examples: +# com1: enabled=1, mode=null +# com1: enabled=1, mode=mouse +# com2: enabled=1, mode=file, dev=serial.out +# com3: enabled=1, mode=raw, dev=com1 +# com3: enabled=1, mode=socket, dev=localhost:8888 +#======================================================================= +#com1: enabled=1, mode=term, dev=/dev/ttyp9 + + +#======================================================================= +# PARPORT1, PARPORT2: +# This defines a parallel (printer) port. When turned on and an output file is +# defined the emulated printer port sends characters printed by the guest OS +# into the output file. On some platforms a device filename can be used to +# send the data to the real parallel port (e.g. "/dev/lp0" on Linux, "lpt1" on +# win32 platforms). +# +# Examples: +# parport1: enabled=1, file="parport.out" +# parport2: enabled=1, file="/dev/lp0" +# parport1: enabled=0 +#======================================================================= +parport1: enabled=1, file="parport.out" + +#======================================================================= +# SB16: +# This defines the SB16 sound emulation. It can have several of the +# following properties. +# All properties are in the format sb16: property=value +# midi: The filename is where the midi data is sent. This can be a +# device or just a file if you want to record the midi data. +# midimode: +# 0=no data +# 1=output to device (system dependent. midi denotes the device driver) +# 2=SMF file output, including headers +# 3=output the midi data stream to the file (no midi headers and no +# delta times, just command and data bytes) +# wave: This is the device/file where wave output is stored +# wavemode: +# 0=no data +# 1=output to device (system dependent. wave denotes the device driver) +# 2=VOC file output, incl. headers +# 3=output the raw wave stream to the file +# log: The file to write the sb16 emulator messages to. +# loglevel: +# 0=no log +# 1=resource changes, midi program and bank changes +# 2=severe errors +# 3=all errors +# 4=all errors plus all port accesses +# 5=all errors and port accesses plus a lot of extra info +# dmatimer: +# microseconds per second for a DMA cycle. Make it smaller to fix +# non-continuous sound. 750000 is usually a good value. This needs a +# reasonably correct setting for the IPS parameter of the CPU option. +# +# For an example look at the next line: +#======================================================================= + +#sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, loglevel=2, log=sb16.log, dmatimer=600000 + +#======================================================================= +# VGA_UPDATE_INTERVAL: +# Video memory is scanned for updates and screen updated every so many +# virtual seconds. The default is 40000, about 25Hz. Keep in mind that +# you must tweak the 'cpu: ips=N' directive to be as close to the number +# of emulated instructions-per-second your workstation can do, for this +# to be accurate. +# +# Examples: +# vga_update_interval: 250000 +#======================================================================= +vga_update_interval: 300000 + +# using for Winstone '98 tests +#vga_update_interval: 100000 + +#======================================================================= +# KEYBOARD_SERIAL_DELAY: +# Approximate time in microseconds that it takes one character to +# be transfered from the keyboard to controller over the serial path. +# Examples: +# keyboard_serial_delay: 200 +#======================================================================= +keyboard_serial_delay: 250 + +#======================================================================= +# KEYBOARD_PASTE_DELAY: +# Approximate time in microseconds between attempts to paste +# characters to the keyboard controller. This leaves time for the +# guest os to deal with the flow of characters. The ideal setting +# depends on how your operating system processes characters. The +# default of 100000 usec (.1 seconds) was chosen because it works +# consistently in Windows. +# +# If your OS is losing characters during a paste, increase the paste +# delay until it stops losing characters. +# +# Examples: +# keyboard_paste_delay: 100000 +#======================================================================= +keyboard_paste_delay: 100000 + +#======================================================================= +# MOUSE: +# This option prevents Bochs from creating mouse "events" unless a mouse +# is enabled. The hardware emulation itself is not disabled by this. +# You can turn the mouse on by setting enabled to 1, or turn it off by +# setting enabled to 0. Unless you have a particular reason for enabling +# the mouse by default, it is recommended that you leave it off. +# You can also toggle the mouse usage at runtime (control key + middle +# mouse button on X11, SDL, wxWidgets and Win32). +# With the mouse type option you can select the type of mouse to emulate. +# The default value is 'ps2'. The other choices are 'imps2' (wheel mouse +# on PS/2), 'serial', 'serial_wheel' and 'serial_msys' (one com port requires +# setting 'mode=mouse'). To connect a mouse to an USB port, see the 'usb1' +# option (requires PCI and USB support). +# +# Examples: +# mouse: enabled=1 +# mouse: enabled=1, type=imps2 +# mouse: enabled=1, type=serial +# mouse: enabled=0 +#======================================================================= +mouse: enabled=0 + +#======================================================================= +# private_colormap: Request that the GUI create and use it's own +# non-shared colormap. This colormap will be used +# when in the bochs window. If not enabled, a +# shared colormap scheme may be used. Not implemented +# on all GUI's. +# +# Examples: +# private_colormap: enabled=1 +# private_colormap: enabled=0 +#======================================================================= +private_colormap: enabled=0 + +#======================================================================= +# fullscreen: ONLY IMPLEMENTED ON AMIGA +# Request that Bochs occupy the entire screen instead of a +# window. +# +# Examples: +# fullscreen: enabled=0 +# fullscreen: enabled=1 +#======================================================================= +#fullscreen: enabled=0 +#screenmode: name="sample" + +#======================================================================= +# ne2k: NE2000 compatible ethernet adapter +# +# Examples: +# ne2k: ioaddr=IOADDR, irq=IRQ, mac=MACADDR, ethmod=MODULE, ethdev=DEVICE, script=SCRIPT +# +# ioaddr, irq: You probably won't need to change ioaddr and irq, unless there +# are IRQ conflicts. +# +# mac: The MAC address MUST NOT match the address of any machine on the net. +# Also, the first byte must be an even number (bit 0 set means a multicast +# address), and you cannot use ff:ff:ff:ff:ff:ff because that's the broadcast +# address. For the ethertap module, you must use fe:fd:00:00:00:01. There may +# be other restrictions too. To be safe, just use the b0:c4... address. +# +# ethdev: The ethdev value is the name of the network interface on your host +# platform. On UNIX machines, you can get the name by running ifconfig. On +# Windows machines, you must run niclist to get the name of the ethdev. +# Niclist source code is in misc/niclist.c and it is included in Windows +# binary releases. +# +# script: The script value is optional, and is the name of a script that +# is executed after bochs initialize the network interface. You can use +# this script to configure this network interface, or enable masquerading. +# This is mainly useful for the tun/tap devices that only exist during +# Bochs execution. The network interface name is supplied to the script +# as first parameter +# +# If you don't want to make connections to any physical networks, +# you can use the following 'ethmod's to simulate a virtual network. +# null: All packets are discarded, but logged to a few files. +# arpback: ARP is simulated. Disabled by default. +# vde: Virtual Distributed Ethernet +# vnet: ARP, ICMP-echo(ping), DHCP and read/write TFTP are simulated. +# The virtual host uses 192.168.10.1. +# DHCP assigns 192.168.10.2 to the guest. +# TFTP uses the ethdev value for the root directory and doesn't +# overwrite files. +# +#======================================================================= +# ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=fbsd, ethdev=en0 #macosx +# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xl0 +# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0 +# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=win32, ethdev=MYCARD +# ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0 +# ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun0, script=./tunconfig +# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=null, ethdev=eth0 +# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vde, ethdev="/tmp/vde.ctl" +# ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vnet, ethdev="c:/temp" + +#======================================================================= +# KEYBOARD_MAPPING: +# This enables a remap of a physical localized keyboard to a +# virtualized us keyboard, as the PC architecture expects. +# If enabled, the keymap file must be specified. +# +# Examples: +# keyboard_mapping: enabled=1, map=gui/keymaps/x11-pc-de.map +#======================================================================= +keyboard_mapping: enabled=0, map= + +#======================================================================= +# KEYBOARD_TYPE: +# Type of keyboard return by a "identify keyboard" command to the +# keyboard controler. It must be one of "xt", "at" or "mf". +# Defaults to "mf". It should be ok for almost everybody. A known +# exception is french macs, that do have a "at"-like keyboard. +# +# Examples: +# keyboard_type: mf +#======================================================================= +#keyboard_type: mf + +#======================================================================= +# USER_SHORTCUT: +# This defines the keyboard shortcut to be sent when you press the "user" +# button in the headerbar. The shortcut string is a combination of maximum +# 3 key names (listed below) separated with a '-' character. The old-style +# syntax (without the '-') still works for the key combinations supported +# in Bochs 2.2.1. +# Valid key names: +# "alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc", +# "f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup", +# "plus", "right", "shift", "space", "tab", "up", "win" and "print". +# +# Example: +# user_shortcut: keys=ctrl-alt-del +#======================================================================= +#user_shortcut: keys=ctrl-alt-del + +#======================================================================= +# I440FXSUPPORT: +# This option controls the presence of the i440FX PCI chipset. You can +# also specify the devices connected to PCI slots. Up to 5 slots are +# available now. These devices are currently supported: ne2k, pcivga, +# pcidev and pcipnic. If Bochs is compiled with Cirrus SVGA support +# you'll have the additional choice 'cirrus'. +# +# Example: +# i440fxsupport: enabled=1, slot1=pcivga, slot2=ne2k +#======================================================================= +i440fxsupport: enabled=1 + +#======================================================================= +# USB1: +# This option controls the presence of the USB root hub which is a part +# of the i440FX PCI chipset. With the portX option you can connect devices +# to the hub (currently supported: 'mouse', 'tablet', 'keypad' and 'disk'). +# If you connect the mouse or tablet to one of the ports, Bochs forwards the +# mouse movement data to the USB device instead of the selected mouse type. +# When connecting the keypad to one of the ports, Bochs forwards the input of +# the numeric keypad to the USB device instead of the PS/2 keyboard. +# To connect a flat image as an USB hardisk you can use the 'disk' device with +# the path to the image separated with a colon (see below). +#======================================================================= +#usb1: enabled=1 +#usb1: enabled=1, port1=mouse, port2=disk:usbdisk.img + +#======================================================================= +# CMOSIMAGE: +# This defines image file that can be loaded into the CMOS RAM at startup. +# The rtc_init parameter controls whether initialize the RTC with values stored +# in the image. By default the time0 argument given to the clock option is used. +# With 'rtc_init=image' the image is the source for the initial time. +# +# Example: +# cmosimage: file=cmos.img, rtc_init=image +#======================================================================= +#cmosimage: file=cmos.img, rtc_init=time0 + +#======================================================================= +# MAGIC_BREAK: +# This enables the "magic breakpoint" feature when using the debugger. +# The useless cpu instruction XCHG BX, BX causes Bochs to enter the +# debugger mode. This might be useful for software development. +# +# Example: +# magic_break: enabled=1 +#======================================================================= +#magic_break: enabled=1 + +#======================================================================= +# other stuff +#======================================================================= +#load32bitOSImage: os=nullkernel, path=../kernel.img, iolog=../vga_io.log +#load32bitOSImage: os=linux, path=../linux.img, iolog=../vga_io.log, initrd=../initrd.img +#text_snapshot_check: enabled=1 +#print_timestamps: enabled=1 + +#------------------------- +# PCI host device mapping +#------------------------- +#pcidev: vendor=0x1234, device=0x5678 + +#======================================================================= +# GDBSTUB: +# Enable GDB stub. See user documentation for details. +# Default value is enabled=0. +#======================================================================= +#gdbstub: enabled=0, port=1234, text_base=0, data_base=0, bss_base=0 + +#======================================================================= +# IPS: +# The IPS directive is DEPRECATED. Use the parameter IPS of the CPU +# directive instead. +#======================================================================= +#ips: 10000000 + +#======================================================================= +# for Macintosh, use the style of pathnames in the following +# examples. +# +# vgaromimage: :bios:VGABIOS-elpin-2.40 +# romimage: file=:bios:BIOS-bochs-latest, address=0xf0000 +# floppya: 1_44=[fd:], status=inserted +#======================================================================= diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bxcommit.exe b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bxcommit.exe new file mode 100644 index 0000000..23a6502 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bxcommit.exe differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bxhub.exe b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bxhub.exe new file mode 100644 index 0000000..46e4e7a Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bxhub.exe differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bximage.exe b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bximage.exe new file mode 100644 index 0000000..4608534 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/bximage.exe differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/bochsrc.bxrc b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/bochsrc.bxrc new file mode 100644 index 0000000..cdefcc9 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/bochsrc.bxrc @@ -0,0 +1,46 @@ +############################################################### +# bochsrc.txt file for DLX Linux disk image. +############################################################### + +# how much memory the emulated machine will have +megs: 32 + +# filename of ROM images +romimage: file=../BIOS-bochs-latest +vgaromimage: file=../VGABIOS-lgpl-latest + +# what disk images will be used +floppya: 1_44=floppya.img, status=inserted +floppyb: 1_44=floppyb.img, status=inserted + +# hard disk +ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 +ata0-master: type=disk, path="hd10meg.img", cylinders=306, heads=4, spt=17 + +# choose the boot disk. +boot: c + +# default config interface is textconfig. +#config_interface: textconfig +#config_interface: wx + +#display_library: x +# other choices: win32 sdl wx carbon amigaos beos macintosh nogui rfb term svga + +# where do we send log messages? +log: bochsout.txt + +# disable the mouse, since DLX is text only +mouse: enabled=0 + +# enable key mapping, using US layout as default. +# +# NOTE: In Bochs 1.4, keyboard mapping is only 100% implemented on X windows. +# However, the key mapping tables are used in the paste function, so +# in the DLX Linux example I'm enabling keyboard_mapping so that paste +# will work. Cut&Paste is currently implemented on win32 and X windows only. + +#keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-us.map +#keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-fr.map +#keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-de.map +#keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-es.map diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/hd10meg.img b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/hd10meg.img new file mode 100644 index 0000000..0857b96 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/hd10meg.img differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/readme.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/readme.txt new file mode 100644 index 0000000..1ca1a0b --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/readme.txt @@ -0,0 +1,24 @@ +DLX Linux hard disk image +------------------------- + +DLX is a version of Linux which was small enough to distribute along with +the Bochs Windows binary release. Because of its small size, a limited +number of linux commands are available. + +To boot with the DLX Linux disk image, cd to the dlxlinux directory +and run bochs. + +Linux will boot and reach a login: prompt. Type root followed by RETURN +to log in, and you get a linux command prompt (#). Have fun! When you +are done, type reboot at the "#" prompt. Bochs should exit after stopping +all the tasks on the system. + +A collection of larger (and therefore more useful) disk images is at + + http://bochs.sourceforge.net/diskimages.html + +CREDITS: +The official DLX site is at http://www.wu-wien.ac.at/usr/h93/h9301726/dlx.html +DLX was created by Erich and Hannes Boehm. + +Bryce Denney converted the floppy into a small hard disk image for bochs. diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/run.bat b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/run.bat new file mode 100644 index 0000000..064d59e --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/run.bat @@ -0,0 +1,2 @@ +cd "C:\software\Bochs-2.3.6\dlxlinux" +..\bochs -q -f bochsrc.bxrc diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/testform.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/testform.txt new file mode 100644 index 0000000..65e35f9 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/dlxlinux/testform.txt @@ -0,0 +1,124 @@ +------------------------------------------------------------- +BOCHS TESTING FORM Version 0.3 +------------------------------------------------------------- + +Because of the variety of platforms and configurations that Bochs +supports, it is difficult for any one person to test it thoroughly. +This form is intended to help the Bochs developers keep track of test +results from different sources. To avoid confusion, this form should +be submitted once for each combination of host OS and guest OS you +try. For example: your host OS is Debian Linux and you get both Win95 +and FreeDOS to start up. You would send one form for +Win95-under-Debian and a second form for FreeDOS-under-Debian. In +this case it would save time to fill in the host OS part, copy it a +few times and fill out the guest OS part for each copy. + +To fill in a blank such as [__], replace the underlines and leave +the brackets. Example: [Sun Ultrasparc 10]. To fill in a +multiple-choice, just put an X in the brackets. Example: [X] +Mail completed forms to bochs-testing@tlw.com. + + +What is the date? +[__] + +What is your name? +[__] + +What is your email address? +[__] + +Do you mind if your name and email address are placed on a testing results +web page so that people with a similar setup can write to you? + [ ] Ok, put it on a web page + [ ] No, keep my address private. + +What type of hardware are you using, e.g. 500MHz Intel Celeron. +[__] + +What operating system are you using? Please be specific, e.g. +Redhat Linux 6.2 with 2.2.16 kernel. +[__] + +What version of bochs are you using? + [ ] compiled from version 2.1.1 + [ ] compiled from version [_____] + [ ] I compiled it from the CVS sources from date: [__] + [ ] other source distribution from URL: [__] + [ ] binary distribution from URL: [__] + +Please fill in the next few questions only if you compiled Bochs +yourself, as opposed to downloading a binary. + +Did the configure script run ok, and detect your hardware and +operating system? + [ ] Yes + [ ] No, configure crashed. + [ ] No, configure ran ok but produced a bad configuration. + [ ] No, I cannot run configure on my platform (win32 and mac). + +If you used configure, what arguments did you give it? If you used a +.conf.* script, give the name of the .conf script instead. +[__] + +What compiler did you use? (Please include version.) +[__] + +Did Bochs compile clean without any hacking? + [ ] Yes + [ ] No + +If you had to make changes to compile, please summarize the problems you +had or include diffs. +[__] + +End of compile-specific questions! + +What guest operating system are you using inside bochs? +[__] + +Are you booting from a floppy or hard disk? + [ ] floppy image + [ ] raw floppy drive + [ ] hard drive image + [ ] raw hard drive (is this even possible?) + [ ] other [__] + +Did the guest operating system boot successfully? + [ ] Yes + [ ] No + +If no, what error messages do you see on the console or in the log file? +[__] + +What applications worked under this guest operating system? +[__] + +What applications failed under this guest operating system? Did the +application function incorrectly, crash Bochs, or what? If you got a +panic, paste in the panic message that you received with some +description of what was happening at the time. +[__] + +The remaining questions are about Bochs features that you may not have +used. If you tried out the feature, move the X to the "works" or +"fails" column. + + Not Works + tested ok Fails Comments? +keyboard [ ] [ ] [ ] [__] +floppy disk [X] [ ] [ ] [__] +raw floppy disk [X] [ ] [ ] [__] +hard disk [X] [ ] [ ] [__] +floating point [X] [ ] [ ] [__] +mouse [X] [ ] [ ] [__] +cdrom [X] [ ] [ ] [__] +sb16 [X] [ ] [ ] [__] +ne2000 [X] [ ] [ ] [__] +i440FX pci [X] [ ] [ ] [__] +debugger [X] [ ] [ ] [__] +external loader [X] [ ] [ ] [__] +VGA [X] [ ] [ ] [__] + +Thank you for your contribution in the Bochs testing effort! Please +mail completed forms to bochs-testing@tlw.com. diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/about-the-code.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/about-the-code.html new file mode 100644 index 0000000..93b7df0 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/about-the-code.html @@ -0,0 +1,182 @@ + +About the code
Bochs Developers Guide
PrevNext

Chapter 2. About the code

2.1. Overview

The initial versions of some sections in this chapter are based on a document +written by Peter "Firefly" Lund. It was added and updated in January 2006.

The Bochs virtual PC consists of many pieces of hardware. At a bare minimum +there are always a CPU, a PIT (Programmable Interval Timer), a PIC +(Programmable Interrupt Controller), a DMA controller, some memory (this +includes both RAM and BIOS ROMs), a video card (usually VGA), a keyboard port +(also handles the mouse), an RTC with battery backed NVRAM, and some extra +motherboard circuitry.

There might also be a NE2K ethernet card, a PCI controller, a Sound Blaster 16, +an IDE controller (+ harddisks/CDROM), a SCSI controller (+ harddisks), a +floppy controller, an APIC ..

There may also be more than one CPU.

Most of these pieces of hardware have their own C++ class - and if Bochs is +configured to have more than one piece of a type of hardware, each will have +its own object.

The pieces of hardware communicates over a couple of buses with each other - +some of the things that the buses carry are reads and writes in memory space, +reads and writes in I/O space, interrupt requests, interrupt acknowledges, DMA +requests, DMA acknowledges, and NMI request/acknowledge. How that is simulated +is explained later.

Other important pieces of the puzzle are: the options object (reads/writes +configuration files, can be written to and queried while Bochs is running) and +the GUI object. There are many different but compatible implementations of the +GUI object, depending on whether you compile for X (Unix/Linux), Win32, +Macintosh (two versions: one for Mac OS X and one for older OS's), BeOS, Amiga, +etc.

And then there is the supporting cast: debugger, config menu, panic handler, +disassembler, tracer, instrumentation.


PrevHomeNext
Ideas for other sections Directory Structure
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/add-keymapping.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/add-keymapping.html new file mode 100644 index 0000000..901b950 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/add-keymapping.html @@ -0,0 +1,176 @@ + +How to add keymapping in a GUI client
Bochs Developers Guide
PrevChapter 2. About the codeNext

2.10. How to add keymapping in a GUI client

Christophe Bothamy, wrote the keymapping code for Bochs, provided these +instructions to help developers to add keymapping to a GUI.

Bochs creates a bx_keymap_c object named bx_keymap.
+This object allows you to :
+  - load the configuration specified keymap file
+  - get the translated BX_KEY_* from your GUI key
+
+You have to provide a translation function from string to your Bit32u key
+constant. Casting will be necessary if your key constants are not Bit32u typed.
+The function must be "static Bit32u (*)(const char *)" typed, and must return
+BX_KEYMAP_UNKNOWN if it can not translate the parameter string.
+
+What you have to do is :
+  - call once "void loadKeymap(Bit32u (*)(const char*))", 
+    providing your translation function, to load the keymap
+  - call "Bit32u getBXKey(Bit32u)" that returns the BX_KEY_*
+    constant, for each key you want to map.
+
+The file gui/x.cc implements this architecture, so you can refer to it
+as an example.

PrevHomeNext
Harddisk Images based on redologsUpDebugger
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/available-tools.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/available-tools.html new file mode 100644 index 0000000..78909e7 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/available-tools.html @@ -0,0 +1,137 @@ + +available tools
Bochs Developers Guide
PrevChapter 5. Webmastering 

5.6. available tools

sources, tmp +


PrevHome 
other contentUp 
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/cmos-map.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/cmos-map.html new file mode 100644 index 0000000..03c53eb --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/cmos-map.html @@ -0,0 +1,275 @@ + +Bochs's CMOS map
Bochs Developers Guide
PrevChapter 2. About the codeNext

2.7. Bochs's CMOS map

In addition to the default CMOS RAM layout, the Bochs BIOS uses some additional +registers for harddisk parameters and the boot sequence. The following table +shows all CMOS registers and their meaning.

Legend:
+S	- set by the emulator (Bochs)
+B	- set by the bios
+U	- unused by the bios
+
+LOC	NOTES	MEANING
+0x00	S	rtc seconds
+0x01	B	second alarm
+0x02	S	rtc minutes
+0x03	B	minute alarm
+0x04	S	rtc hours
+0x05	B	hour alarm
+
+0x06	S,U	day of week
+0x07	S,B	date of month
+0x08	S,B	month
+0x09	S,B	year
+
+0x0a	S,B	status register A
+0x0b	S,B	status register B
+0x0c	S	status register C
+0x0d	S	status register D
+
+0x0f	S	shutdown status
+    values:
+	0x00: normal startup
+	0x09: normal
+	0x0d+: normal
+	0x05: eoi ?
+	else: unimpl
+
+0x10	S	fd drive type (2 nibbles: high=fd0, low=fd1)
+    values:
+	1: 360K 5.25"
+	2: 1.2MB 5.25"
+	3: 720K 3.5"
+	4: 1.44MB 3.5"
+	5: 2.88MB 3.5"
+
+!0x11	configuration bits!!
+
+0x12	S	how many disks first (hd type)
+
+!0x13	advanced configuration bits!!
+
+0x14	S,U	equipment byte (?)
+	bits	where		what
+	7-6	floppy.cc
+	5-4	vga.cc		0 = vga
+	2	keyboard.cc	1 = enabled
+	0	floppy.cc
+
+0x15	S,U	base memory - low
+0x16	S,U	base memory - high
+
+0x17	S,U	extended memory in k - low
+0x18	S,U	extended memory in k - high
+
+0x19	S	hd0: extended type
+0x1a	S	hd1: extended type
+
+0x1b	S,U	hd0:cylinders - low
+0x1c	S,U	hd0:cylinders - high
+0x1d	S,U	hd0:heads
+0x1e	S,U	hd0:write pre-comp - low
+0x1f	S,U	hd0:write pre-comp - high
+0x20	S,U	hd0:retries/bad_map/heads>8
+0x21	S,U	hd0:landing zone - low
+0x22	S,U	hd0:landing zone - high
+0x23	S,U	hd0:sectors per track
+
+0x24	S,U	hd1:cylinders - low
+0x25	S,U	hd1:cylinders - high
+0x26	S,U	hd1:heads
+0x27	S,U	hd1:write pre-comp - low
+0x28	S,U	hd1:write pre-comp - high
+0x29	S,U	hd1:retries/bad_map/heads>8
+0x2a	S,U	hd1:landing zone - low
+0x2b	S,U	hd1:landing zone - high
+0x2c	S,U	hd1:sectors per track
+
+0x2d	S	boot from (bit5: 0:fd, 1:hd)
+
+0x2e	S,U	standard cmos checksum (0x10->0x2d) - high
+0x2f	S,U	standard cmos checksum (0x10->0x2d) - low
+
+0x30	S	extended memory in k - low
+0x31	S	extended memory in k - high
+
+0x32	S	rtc century
+
+0x34	S	extended memory in 64k - low
+0x35	S	extended memory in 64k - high
+
+0x37	S	ps/2 rtc century (copy of 0x32, needed for winxp)
+
+0x38	S	eltorito boot sequence + boot signature check
+	bits
+	0	floppy boot signature check (1: disabled, 0: enabled)
+	7-4	boot drive #3 (0: unused, 1: fd, 2: hd, 3:cd, else: fd)
+
+0x39	S	ata translation policy - ata0 + ata1
+	bits
+	1-0	ata0-master (0: none, 1: LBA, 2: LARGE, 3: R-ECHS)
+	3-2	ata0-slave
+	5-4	ata1-master
+	7-6	ata1-slave
+
+0x3a	S	ata translation policy - ata2 + ata3 (see above)
+
+0x3d	S	eltorito boot sequence (see above)
+	bits
+	3-0	boot drive #1
+	7-4	boot drive #2


PrevHomeNext
timersUpSound Blaster 16 Emulation
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/coding.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/coding.html new file mode 100644 index 0000000..dc25cd2 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/coding.html @@ -0,0 +1,229 @@ + +Coding
Bochs Developers Guide
PrevNext

Chapter 4. Coding

4.1. Coding guidelines

  • Don't make use of any external C++ classes.

    They are not offered on all platforms and this would make Bochs non-portable. +There is use of such classes in the optional debugger. I plan on removing this use.

  • Don't use fancy C++ features.

    Bochs is incredibly performance sensitive, and will be increasingly so as +more speed enhancements are added. There's a time and place for most everything +and this is not it. Some advanced features create overhead in the generated code +that you don't see. They also convolute the code, and sometimes occlude that is +really going on. +

    • Don't use templates

    • Don't use virtual functions if not strictly required

    • Don't use C++ exceptions

    • Don't use overloading of any kind

  • Use soft tabs.

    At least when you submit code, convert all hard tabs to spaces. +There is no uniform way to handle tabs properly.

  • Please do compile with all warnings turned on.

    It's really difficult to spot interesting warnings when a compile is littered +with non-interesting ones.

  • Don't use signed ints where unsigned will do.

  • Make sure that contributed code / patches are LGPL compatible.


PrevHomeNext
I/O Interface to Bochs Debugger patches:
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/configure-scripting.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/configure-scripting.html new file mode 100644 index 0000000..f385213 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/configure-scripting.html @@ -0,0 +1,149 @@ + +Configure Scripting
Bochs Developers Guide
PrevChapter 2. About the codeNext

2.4. Configure Scripting

+ configure script, makefiles, header files +


PrevHomeNext
Emulator ObjectsUpLog Functions
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/cvs-release.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/cvs-release.html new file mode 100644 index 0000000..d1c3a57 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/cvs-release.html @@ -0,0 +1,506 @@ + +Building a Bochs release
Bochs Developers Guide
PrevChapter 4. CodingNext

4.3. Building a Bochs release

4.3.1. Preparing source files and CVS

Update version number and strings in configure.in. +
VERSION="2.2.pre2"
+VER_STRING="2.2.pre2"
+REL_STRING="Build from CVS snapshot on March 25, 2005"
+In the README file you have to update version number and date. Add some +information about new features if necessary. +
Bochs x86 Pentium+ Emulator
+Updated: Fri Mar 25 10:33:15 CET 2005
+Version: 2.2.pre2
+Check date, update/sumup info in CHANGES. Run autoconf to regenerate configure and check them in. +Create a CVS tag to mark which revision of each file was used in the release. +For prereleases I make a normal CVS tag like this: +
  cvs tag REL_2_2_pre2_FINAL
+But for a real release, I make a CVS branch tag AND a normal tag. +
  cvs tag REL_2_2_BASE
+  cvs tag -b REL_2_2
+The base tag marks where the branch split off of the main trunk. +This is very useful in maintaining the branch since you can do diffs +against it. +
   cvs diff -r REL_2_2_BASE -r HEAD
+   cvs diff -r REL_2_2_BASE -r REL_2_0
+   cvs upd -j REL_2_2_BASE -j HEAD file
+   etc.
+The release and all bugfix releases after it are on the REL_2_2 branch. +When the release is actually finalized, you can do this: +
  cvs tag REL_2_2_FINAL
+Now you can start building packages based on the created release tag.

4.3.2. Building the release on win32

These instructions require cygwin and MSVC++.

In Cygwin: +
  sh .conf.win32-vcpp         # runs configure 
+  make win32_snap             # unzip workspace, make a win32 source ZIP
+Copy the source ZIP to a windows machine, if necessary.

Open up Visual C++ and load the workspace file Bochs.dsw. Check +the Build:Set Active Project Configuration is set the way you want it. +For releases I use "Win32 Release".

To create "bochsdbg.exe" with Bochs debugger support, manually change two +lines in config.h to turn on the debugger. +
#define BX_DEBUGGER 1
+#define BX_DISASM 1
+VC++ will rebuild Bochs with debugger and overwrite bochs.exe. To avoid +trashing the non-debug version, move it out of the way while the debugger +version is being built. Then rename the debugger version to bochsdbg.exe. +
cd obj-release
+mv bochs.exe bochs-normal.exe
+(build again with BX_DEBUGGER=1 this time)
+mv bochs.exe bochsdbg.exe
+mv bochs-normal.exe bochs.exe

To get the docbook installed, you need to do something like this: +

  • make dl_docbook

  • copy up to date doc files

+Then you can do +
cd doc/docbook; touch */*.html
+Do make install_win32 into /tmp or someplace: +
make install_win32 prefix=/tmp/bochs-2.2.pre2
+This copies all the files into /tmp/bochs-2.2.pre2 and then creates a +binary ZIP at /tmp/bochs-2.2.pre2.zip. Rename that bochs-2.2.pre2.win32-bin.zip.

Now make the NSIS installer package (the current script is known to work with NSIS 2.03) +
cd build/win32/nsis
+Unzip the binary ZIP file into bochs-$VERSION (must match Makefile) and +then run make. +
unzip ~/bochs-2.2.pre2.zip
+make
+That gives an installer called Bochs-2.2.pre2.exe. Test and upload it.

4.3.3. Building the release on Linux

Do a clean checkout using anonymous cvs, so that the source tarball +will be all set up for anonymous cvs. First I'll create a clean +directory called "clean-anon". +
cvs -d:pserver:anonymous@bochs.cvs.sourceforge.net:/cvsroot/bochs login
+cvs -z3 -d:pserver:anonymous@bochs.cvs.sourceforge.net:/cvsroot/bochs \
+  checkout -d clean-anon bochs
+Start with clean-anon which tracks the CVS head. Change its sticky tag +so that it sticks to the release tag. +
cp -a clean-anon bochs-2.2.pre2
+cd bochs-2.2.pre2
+cvs upd -P -r REL_2_2_pre2_FINAL
+cd ..
+tar czvf bochs-2.2.pre2.tar.gz --exclude CVS --exclude .cvsignore bochs-2.2.pre2
+The source TAR file bochs-2.2.pre2.tar.gz is ready to upload.

The RPM will be building using the configuration in .conf.linux with +a few parameters from build/redhat/make-rpm. Make any last minute changes +to .conf.linux. Any changes will go into the source RPM. +WARNING : do not build in /tmp/bochs-XXX... +
./build/redhat/make-rpm | tee ../build.txt
+This produces two rpm files in the current directory. Test and upload.

4.3.4. Uploading files and creating a file release on SF

When you are ready with creating release packages you have to upload them to SF +using anonymous FTP using this location: +
upload.sourceforge.net/incoming
+Note that you cannot modify or delete files after uploading them. If you don't do +anything with the uploaded files, they will be deleted by SF after 24 hours.

To create or edit a file release you have to log in to the Admin +section on the SF project page of Bochs. Then you have to go to the +File Releases page and follow the instructions there.


PrevHomeNext
patches:UpWebmastering
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-advanced.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-advanced.html new file mode 100644 index 0000000..cacff79 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-advanced.html @@ -0,0 +1,349 @@ + +Advanced debugger usage
Bochs Developers Guide
PrevNext

Chapter 3. Advanced debugger usage

3.1. I/O Interface to Bochs Debugger

This device was added by Dave Poirier (eks@void-core.2y.net).

Compiling Bochs with iodebug support +

./configure --enable-iodebug
+make
+Other optional fields may be added to the ./configure line, see Bochs +documentation for all the information. To enable the iodebug plugin at runtime, +it must be loaded with the 'plugin_ctrl' bochsrc option.

Using the I/O Interface to the debugger
+
+port range:  0x8A00 - 0x8A01
+
+Port 0x8A00 servers as command register. You can use it to enable the i/o interface,
+change which data register is active, etc.
+
+Port 0x8A01 is used as data register for the memory monitoring.

3.1.1. Commands supported by port 0x8A00


0x8A00
+
+ Used to enable the device. Any I/O to the debug module before this command is sent
+ is sent will simply be ignored.
+
+
+0x8A01
+
+ Selects register 0: Memory monitoring range start address (inclusive)
+
+
+0x8A02
+
+ Selects register 1: Memory monitoring range end address (exclusive)
+
+
+0x8A80
+
+ Enable address range memory monitoring as indicated by register 0 and 1 and
+ clears both registers
+
+
+0x8AE0 - Return to Debugger Prompt
+
+ If the debugger is enabled (via --enable-debugger), sending 0x8AE0 to port 0x8A00
+ after the device has been enabled will return the Bochs to the debugger prompt.
+ Basically the same as doing CTRL+C.
+
+
+0x8AE2 - Instruction Trace Disable
+
+ If the debugger is enabled (via --enable-debugger), sending 0x8AE2 to port 0x8A00
+ after the device has been enabled will disable instruction tracing
+
+
+0x8AE3 - Instruction Trace Enable
+
+ If the debugger is enabled (via --enable-debugger), sending 0x8AE3 to port 0x8A00
+ after the device has been enabled will enable instruction tracing
+
+
+0x8AE4 - Register Trace Disable
+
+ If the debugger is enabled (via --enable-debugger), sending 0x8AE4 to port 0x8A00
+ after the device has been enabled will disable register tracing.
+
+
+0x8AE5 - Register Trace Enable
+
+ If the debugger is enabled (via --enable-debugger), sending 0x8AE5 to port 0x8A00
+ after the device has been enabled will enable register tracing. This currently
+ output the value of all the registers for each instruction traced.
+ Note: instruction tracing must be enabled to view the register tracing
+
+
+0x8AFF
+
+ Disable the I/O interface to the debugger and the memory monitoring functions.
+

Note: all accesses must be done using word

+

Note: reading this register will return 0x8A00 if currently activated, otherwise 0

3.1.2. Access to port 0x8A01 (write-only)

All accesses to this port must be done using words. Writing to this port will shift +to the left by 16 the current value of the register and add the provided value to it. +

Sample:
+
+reg0 = 0x01234567
+
+out port: 0x8A01 data: 0xABCD
+
+reg0 = 0x4567ABCD

3.1.3. Sample

Enable memory monitoring on first page of text screen (0xb8000-0xb8fa0): +add in bochrc file: optromimage1: file="asmio.rom", address=0xd0000 +

/*
+ *      Make asmio ROM file:
+ *      gcc -c asmio.S
+ *      objcopy -O binary asmio.o asmio.rom
+ */
+        .text
+        .global start
+        .code16
+
+/* ROM Header */
+        .byte 0x55
+        .byte 0xAA
+        .byte 1                 /* 512 bytes long */
+
+start:
+/* Monitor memory access on first page of text screen */
+        mov     $0x8A00,%dx     /* Enable iodebug (0x8A00->0x8A00) */
+        mov     %dx,%ax
+        out     %ax,%dx
+        mov     $0x8A01,%ax     /* Select register 0 start addr (0x8A01->0x8A00) */
+        out     %ax,%dx
+        mov     $0x8A01,%dx     /* Write start addr 0xB8000 (high word first) */
+        mov     $0xB,%ax
+        out     %ax,%dx
+        mov     $0x8000,%ax     /* Write start addr (low word) */
+        out     %ax,%dx
+
+        mov     $0x8A02,%ax     /* Select register 1 end addr (0x8A02->0x8A00) */
+        mov     $0x8A00,%dx
+        out     %ax,%dx
+        mov     $0x8A01,%dx     /* Write end addr 0xB8FA0 (high word first) */
+        mov     $0xB,%ax
+        out     %ax,%dx
+        mov     $0x8FA0,%ax     /* Write end addr (low word) */
+        out     %ax,%dx
+
+        mov     $0x8A00,%dx     /* Enable addr range memory monitoring (0x8A80->0x8A00) */
+        mov     $0x8A80,%ax
+        out     %ax,%dx
+
+        mov     $0x8A00,%dx     /* Return to Bochs Debugger Prompt (0x8AE0->0x8A00) */
+        mov     $0x8AE0,%ax
+        out     %ax,%dx
+        lret
+
+        .byte 0x6b              /* Checksum (code dependent!, update it as needed) */
+        .align 512              /* NOP follow */


PrevHomeNext
How to add keymapping in a GUI client The instrumentation feature
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-commands.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-commands.html new file mode 100644 index 0000000..f530704 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-commands.html @@ -0,0 +1,148 @@ + +command reference
Bochs Developers Guide
PrevChapter 3. DebuggerNext


PrevHomeNext
get started in debuggerUptechniques
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-get-started.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-get-started.html new file mode 100644 index 0000000..be1ad93 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-get-started.html @@ -0,0 +1,148 @@ + +get started in debugger
Bochs Developers Guide
PrevChapter 3. DebuggerNext


PrevHomeNext
DebuggerUpcommand reference
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-internals.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-internals.html new file mode 100644 index 0000000..3bd05de --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-internals.html @@ -0,0 +1,147 @@ + +Bochs debugger internals
Bochs Developers Guide
PrevChapter 3. Advanced debugger usageNext

3.3. Bochs debugger internals

Not written yet (take stuff from bxdebugger.html).


PrevHomeNext
The instrumentation featureUpCoding
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-techniques.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-techniques.html new file mode 100644 index 0000000..bd8e4c5 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger-techniques.html @@ -0,0 +1,148 @@ + +techniques
Bochs Developers Guide
PrevChapter 3. DebuggerNext


PrevHomeNext
command referenceUpI/O Interface to Bochs Debugger
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger.html new file mode 100644 index 0000000..8b8a3ff --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/debugger.html @@ -0,0 +1,149 @@ + +Debugger
Bochs Developers Guide
PrevNext


PrevHomeNext
How to add keymapping in a GUI client get started in debugger
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/development.dbk b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/development.dbk new file mode 100644 index 0000000..4a8ecae --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/development.dbk @@ -0,0 +1,3445 @@ + + + +%bochsdefs; + +]> + + + Bochs Developers Guide + + KevinLawton + BryceDenney + ChristopheBothamy + MichaelCalabrese + + + + +Resources for developers + +The development guide describes resources that are intended for developers +in particular. Many Bochs resources are also covered in the User Guide, +including compile instructions, bochsrc options, how to find the mailing +lists, etc. + + +
Setting up SVN write access + +If you are an official SourceForge developer, then you can use SVN with write +access. The SVN contains the most recent copy of the source code, and with +write access you can upload any changes you make to the SVN server for others +to use. The SVN checkout command is identical to the one for normal users, but +you might want to get the whole tree to work with branches and tags. + + + + svn co https://svn.code.sf.net/p/bochs/code bochs-svn + + + +Depending on your network connection this may take a long time, since it downloads all +files from all branches and tags that exist in the repository at the current revision. + + +
+ +
Using SVN write access + +
Checking in files + +Once you have a Bochs directory, you can compile the files, edit them, test them, etc. +See the documentation section, Tracking the source code with SVN +for more info on SVN, in the User Manual. But what's new and different is that +you can now do SVN commits. When a file is all fixed and ready to share with the rest of +the world, you run a commit command to upload your version to the server. +First, it's good to do a SVN update to make sure nobody else has changed it +since you downloaded it last. At the first commit you'll always have to specify your +SF username and type your password. + + + + $ svn update file.cc + $ svn commit --username sfusername file.cc + [editor opens. type log message, save, and exit.] + Login area: <https://svn.code.sf.net:443> SourceForge Subversion area + Username: sfusername + Password for 'sfusername': <--type your password + Sending file.cc + Transmitting file data . + Committed revision 10. + + + +When SVN starts an editor, The default is usually vi. If you want a different +editor, set the EDITOR environment variable to the name of your preferred +editor. When you're done, just save the file and quit the editor. Unless +there's some problem, you will see a message that says what the new SVN revision +number is, and then "done". If while you're editing the log message, you decide +that you don't want to commit after all, don't save the file. Quit the editor, +and when it asks where the log message went, tell it to abort. + + + +Here is an example of a successful checkin: + + + $ svn commit misc.txt + [edit log msg] + Sending misc.txt + Transmitting file data . + Committed revision 6. + + +And here is an aborted one: + + + $ svn commit misc.txt + [quit editor without saving] + Log message unchanged or not specified + a)bort, c)ontinue, e)dit: + a + + + +
+ +
Creating a backup of the SVN repository + +Backups of the SVN repository can be made with the rsync utility. +In case of data corruption or other problems on the server, the repository with all +revisions, branches and tags can be restored easily. It is recommended to update this +backup frequently. The following example creates a folder called +bochs-svn-rsync that contains the repository. + + rsync -av svn.code.sf.net::p/bochs/code bochs-svn-rsync + + +
+ +
Setting SVN commit notifications + +The Bochs SVN repository is set up to send a notification email to the "bochs-cvs" +mailing list after each successful commit. This email contains the log message, a list +of the modified files and a diff against the previous revision. The diff of large +commits will be truncated at 96 kByte. + + +After each commit the SVN server runs the script post-commit located +in the hooks folder. On SourceForge, this script forces a refresh +of the Allura code browser and it can call a script post-commit-user +for addition operations if it exists. For Bochs we have set up this script and call +svnnotify from it to create the notification email. + +#!/bin/sh + +svnnotify --repos-path $1 --revision $2 -O -C -d -e 98304 -t bochs-cvs@lists.sourceforge.net + + +
+ +
+ +
Ideas for other sections + + +Ideas: +- how to browse code with the Allura code browser +- how to find an identifier, variable, or specific text in the code +- how to make patches with SVN + + +
+ +
+ +About the code + +
Overview + +The initial versions of some sections in this chapter are based on a document +written by Peter "Firefly" Lund. It was added and updated in January 2006. + + +The Bochs virtual PC consists of many pieces of hardware. At a bare minimum +there are always a CPU, a PIT (Programmable Interval Timer), a PIC +(Programmable Interrupt Controller), a DMA controller, some memory (this +includes both RAM and BIOS ROMs), a video card (usually VGA), a keyboard port +(also handles the mouse), an RTC with battery backed NVRAM, and some extra +motherboard circuitry. + + +There might also be an ethernet card, a PCI controller, a soundcard, +an IDE controller (+ harddisks/CDROM), a SCSI controller (+ harddisks), a +floppy controller, an APIC ... + + +There may also be more than one CPU. + + +Most of these pieces of hardware have their own C++ class - and if Bochs is +configured to have more than one piece of a type of hardware, each will have +its own object. + + +The pieces of hardware communicates over a couple of buses with each other - +some of the things that the buses carry are reads and writes in memory space, +reads and writes in I/O space, interrupt requests, interrupt acknowledges, DMA +requests, DMA acknowledges, and NMI request/acknowledge. How that is simulated +is explained later.&FIXME; + + +In addition to the simulator itself, some other components are required for +the communication with the user. The most important parts are these: + +the window that simulates the monitor and receives keyboard / mouse events +the configuration interface that allows to adjust simulation settings +the simulator interface for the communication between the other componnents +the parameter tree (for configuration settings and save/restore) +the logfunctions class (handle and configure panic/error/info/debug) + +These componnents of Bochs are optional: + +the plugin interface +the builtin debugger +the disassembler +the instrumentation feature + + + +The simulation window is handled by the GUI object (other terms used in the +sources are "display library", "VGAW"). There are many different but compatible +implementations of the GUI object, depending on whether you compile for X (Unix/Linux), +Win32, Macintosh (two versions: one for Mac OS X and one for older OS's), Amiga, +etc. The cross-platform libraries SDL and wxWidgets are also supported. + + +For the configuration interface there are also some different implementations: textconfig +(text menus only), wxdialog (wxWidgets port), win32dialog/win32paramdlg (Windows port). + +
+ +
Directory Structure + + +Directory structure + + + +Location +Meaning + + + +biosSystem and VGA BIOS images, system BIOS sources and makefile +buildadditional stuff required for building Bochs on different platforms +bx_debugthe builtin Bochs debugger +cputhe cpu emulation sources +cpu/avxsources for emulating AVX instructions +cpu/cpudbsources for emulating different cpu models +cpu/fputhe fpu emulation sources +disasmthe disassembler for the Bochs debugger +doc/docbookthe Bochs documentation in DocBook format +doc/manBochs manual pages +docs-htmlold Bochs documentation in HTML (will be replaced by DocBook) +guidisplay libraries (guis), the simulator interface and text mode config interface +gui/bitmapsbitmaps for the headerbar +gui/fontthe default VGA font used by most of the display libraries +gui/keymapskeymaps for the keyboard mapping feature +hosthost specific drivers (currently only used by the pcidev kernel module for Linux) +instrumentdirectory tree for the instrumentation feature +iodevstandard PC devices, PCI core devices +iodev/displaydisplay adapters (vga, cirrus, voodoo) +iodev/hdimagesupport for different disk image types and lowlevel cdrom access +iodev/networkingnetworking devices and lowlevel modules +iodev/soundsound devices and lowlevel modules +iodev/usbUSB HCs and pluggable devices +memorymemory management and ROM loader +miscuseful utilities (e.g. bximage, niclist) +misc/sb16tool to control the SB16 emulation from the guest side +patchespending patches + + +
+
+
+ +
Emulator Objects +
Weird macros and other mysteries + +Bochs has many macros with inscrutable names. One might even go as far as to +say that Bochs is macro infested. +Some of them are gross speed hacks, to cover up the slow speed that C++ causes. +Others paper over differences between the simulated PC configurations. +Many of the macros exhibit the same problem as C++ does: too much stuff happens +behind the programmer's back. More explicitness would be a big win. + +
+
Static methods hack + +C++ methods have an invisible parameter called the this pointer - otherwise the +method wouldn't know which object to operate on. In many cases in Bochs, there +will only ever be one object - so this flexibility is unnecessary. There is a +hack that can be enabled by #defining BX_USE_CPU_SMF to 1 in config.h + that makes most methods static, which means they have a "special +relationship" with the class they are declared in but apart from that are +normal C functions with no hidden parameters. Of course they still need access +to the internals of an object, so the single object of their class has a globally +visible name that these functions use. It is all hidden with macros. + + +Declaration of a class, from iodev/pic.h: + + +... +#if BX_USE_PIC_SMF +# define BX_PIC_SMF static +# define BX_PIC_THIS thePic-> +#else +# define BX_PIC_SMF +# define BX_PIC_THIS this-> +#endif +... +class bx_pic_c : public bx_pic_stub_c { + +public: + bx_pic_c(); + ~bx_pic_c(); +... + BX_PIC_SMF void service_master_pic(void); + BX_PIC_SMF void service_slave_pic(void); + BX_PIC_SMF void clear_highest_interrupt(bx_pic_t *pic); +}; + + +And iodev/pic.cc: + + +... +#define LOG_THIS thePic-> + +bx_pic_c *thePic = NULL; +... +void bx_pic_c::service_master_pic(void) +{ + Bit8u unmasked_requests; + int irq; + Bit8u isr, max_irq; + Bit8u highest_priority = BX_PIC_THIS s.master_pic.lowest_priority + 1; + if(highest_priority > 7) + highest_priority = 0; + + if (BX_PIC_THIS s.master_pic.INT) { /* last interrupt still not acknowleged */ + return; + } + + isr = BX_PIC_THIS s.master_pic.isr; + if (BX_PIC_THIS s.master_pic.special_mask) { + /* all priorities may be enabled. check all IRR bits except ones + * which have corresponding ISR bits set + */ + max_irq = highest_priority; + } + else { /* normal mode */ + /* Find the highest priority IRQ that is enabled due to current ISR */ + max_irq = highest_priority; +... +} +... + + +Ugly, isn't it? If we use static methods, methods prefixed with BX_PIC_SMF are +declared static and references to fields inside the object, which are prefixed +with BX_PIC_THIS, will use the globally visible object, thePic->. If we don't +use static methods, BX_PIC_SMF evaluates to nothing and BX_PIC_THIS becomes this->. +Making it evaluate to nothing would be a lot cleaner, but then the scoping rules +would change slightly between the two Bochs configurations, which would be a load +of bugs just waiting to happen. Some classes use BX_SMF, others have their own +version of the macro, like BX_PIC_SMF above. + +
+
CPU und memory objects in UP/SMP configurations + +The CPU class is a special case of the above: if Bochs is simulating a uni- +processor machine then there is obviously only one bx_cpu_c object and the +static methods trick can be used. If, on the other hand, Bochs is simulating an +smp machine then we can't use the trick. The same seems to be true for memory: +for some reason, we have a memory object for each CPU object. This might become +relevant for NUMA machines, but they are not all that common -- and even the +existing IA-32 NUMA machines bend over backwards to hide that fact: it should +only be visible in slightly worse timing for non-local memory and non-local +peripherals. Other than that, the memory map and device map presented to each +CPU will be identical. + + +In a UP configuration, the CPU object is declared as bx_cpu. In an SMP +configuration it will be an array of pointers to CPU objects (bx_cpu_array[]). +For memory that would be bx_mem and bx_mem_array[], respectively. +Each CPU object contains a pointer to its associated memory object. +Access of a CPU object often goes through the BX_CPU(x) macro, which either +ignores the parameter and evaluates to &bx_cpu, or evaluates to bx_cpu_array +[n], so the result will always be a pointer. The same goes for BX_MEM(x). +If static methods are used then BX_CPU_THIS_PTR evaluates to BX_CPU(0)->. Ugly, +isn't it? + +
+
The configuration parameter tree + +Starting with version 1.3, the Bochs configuration parameters are stored in parameter +objects. These objects have get/set methods with min/max checks and it is possible +to define parameter handlers to perform side effects and to override settings. +Each parameter type has it's own object type with specific features (numeric, +boolean, enum, string and file name). A special object type containing a list of +parameters is designed for building and managing configuration menus or dialogs +automatically. In the original implementation the parameters could be accessed +only with their unique id from a static list or a special structure containing +pointers to all parameters. + + +Starting with version 2.3, the Bochs parameter object handling has been rewritten +to a parameter tree. There is now a root list containing child lists, and these +lists can contain lists or parameters and so on. The parameters are now accessed +by a name build from all the list names in the path and finally the parameter +name separated by periods. + +Bit32u megs = SIM->get_param_num("memory.standard.ram.size")->get(); + + + +The example above shows how to get the memory size in megabytes from the simulator +interface. In the root list (".") there is child list named "memory" containing +a child list "standard". It's child list "ram" contains the numeric parameter type +"size". The SIM->get_param_num() methods returns the object pointer and the get() +method returns the parameter value. + + +The table below shows all parameter types used by the Bochs configuration interface. + +Parameter types + + + +Type +Description + + + + +bx_object_c +Base class for all the other parameter types. It contains the unique parameter id and the object type value. + + +bx_param_c +Generic parameter class. It contains the name, label, description and the input/output formats. + + +bx_param_num_c +Numerical (decimal/hex) config settings are stored in this parameter type. + + +bx_param_bool_c +This parameter type is based on bx_param_num_c, but it is designed for boolean values. A dependency +list can be defined to enable/disable other parameters depending on the value change. + + +bx_param_enum_c +Based on bx_param_num_c this parameter type contains a list of valid values. + + +bx_param_string_c +Configuration strings are stored in this type of parameter. + + +bx_param_filename_c +Based on bx_param_string_c this parameter type is used for file names. + + +bx_list_c +Contains a list of pointers to parameters (bx_param_*_c and bx_list_c). +In the config interface it is used for menus/dialogs. + + + +
+
+
+
The save/restore feature + +The save/restore feature is based on an extension to the parameter tree concept. +A subtree (list) called "bochs" appears in the root of the parameter tree +and some new "shadow" parameter types store pointers to values instead of the values +itself. All the hardware objects have register_state() methods to register pointers +to the device registers and switches that need to be saved. The simulator interface +saves the registered data in text format to the specified folder (usually one file +per item in the save/restore list). Large binary arrays are registered with a +special parameter type, so they are saved as separate files. The filename is then +created from the full parameter path without the prefix "bochs.". + + +The table below shows the additional parameter types for save/restore. + +Save/restore parameter types + + + +Type +Description + + + + +bx_shadow_num_c +Based on bx_param_num_c this type stores a pointer to a numerical variable. + + +bx_shadow_bool_c +This parameter type stores a pointer to a boolean variable (bit #0 only) or +a numerical one (only one selected bit). + + +bx_shadow_data_c +This special parameter type stores pointer size of a binary array. The data is +saved in a separate file and the text file uses the file name as the value. + + +bx_shadow_filedata_c +This special parameter type stores the descriptor of an open file +(added in Bochs 2.5). + + + +
+
+ +It is also possible to use the bx_param_num_c object with parameter save/restore +handlers. With this special way several device settings can be saved to and restored +from one single parameter. The disk image state is also handled this way (see below). + + +All devices can uses these two save/restore specific methods: + +register_state() is called after the device init() to register the device members for save/restore +after_restore_state() is an optional method to do things directly after restore (e.g. vga: force a display update) + + + +To implement save/restore for hard drive images, the new method register_state() has +been added to the base class of the disk image objects. It creates a bx_param_bool_c +object called "image" and installs static save and restore handlers. The save +operation finally sets the parameter's value (1 = success) and the save/restore +handlers are doing the main job. The static handlers call the class-specific code. +Depending on the image "mode" they copy either the whole image file or the file +containing changes (journal). The files are saved similar to binary arrays with +the same naming convention. The restore methods are doing some format or coherency +checks, close the open image, copy the file(s) and finally re-open the image. + +
+
+ +
Configure Scripting + +Like many other open source projects, Bochs uses a configure script created with +autoconf. The configure script generates all makefiles and a +set of header and support files from templates. + + +This example shows how to add an option to the template file configure.in. +The resulting configure script sets up symbols like +in the output file config.h and replaces +entries in the makefile output. + +BUSM_OBJS='' +AC_MSG_CHECKING(for Busmouse support) +AC_ARG_ENABLE(busmouse, + AS_HELP_STRING([--enable-busmouse], [enable Busmouse support (InPort)]), + [if test "$enableval" = yes; then + AC_MSG_RESULT(yes) + AC_DEFINE(BX_SUPPORT_BUSMOUSE, 1) + BUSM_OBJS='busmouse.o' + else + AC_MSG_RESULT(no) + AC_DEFINE(BX_SUPPORT_BUSMOUSE, 0) + fi], + [ + AC_DEFINE(BX_SUPPORT_BUSMOUSE, 0) + AC_MSG_RESULT(no)] + ) +AC_SUBST(BUSM_OBJS) + + + +These output files are generated by the configure script in addition to the makefiles. + +config.h - the main header file +ltdlconf.h - header file required for compiling with libtool +bxversion.h - header file containing version strings +bxversion.rc - resource file for Windows with version information +build/linux/bochs-dlx - DLX Linux shortcut script (Linux only) +build/macosx/Info.plist - property list file for MacOSX +build/win32/nsis/bochs.nsi - NSIS script for creating Windows installer package + + +
+ +
Log Functions + +The logfunctions class is one of the base classes of Bochs. +It supports 4 log levels (debug, info, error, panic) and 4 possible "actions" +that can be done when a log event occurs. Most of the higher level C++ classes of Bochs +inherit this class to make the logging configuration per object (here called "module") +possible. In the Bochs sources the log events appear as macros (BX_DEBUG, BX_INFO, +BX_ERROR, BX_PANIC) and they call the related logfunction methods, unless the +symbol BX_NO_LOGGING is set to 1. This is the definition in bochs.h: + +typedef class BOCHSAPI logfunctions +{ + char *name; + char *prefix; + int onoff[N_LOGLEV]; + class iofunctions *logio; + // default log actions for all devices, declared and initialized + // in logio.cc. + BOCHSAPI_CYGONLY static int default_onoff[N_LOGLEV]; +public: + logfunctions(void); + logfunctions(class iofunctions *); + ~logfunctions(void); + + void info(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3); + void error(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3); + void panic(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3); + void ldebug(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3); + void fatal (const char *prefix, const char *fmt, va_list ap, int exit_status); + void ask (int level, const char *prefix, const char *fmt, va_list ap); + void put(const char *p); + void put(const char *n, const char *p); + void setio(class iofunctions *); + void setonoff(int loglev, int value) { + assert (loglev >= 0 && loglev < N_LOGLEV); + onoff[loglev] = value; + } + const char *get_name() const { return name; } + const char *getprefix() const { return prefix; } + int getonoff(int level) const { + assert (level>=0 && level<N_LOGLEV); + return onoff[level]; + } + static void set_default_action(int loglev, int action) { + assert (loglev >= 0 && loglev < N_LOGLEV); + assert (action >= 0 && action < N_ACT); + default_onoff[loglev] = action; + } + static int get_default_action(int loglev) { + assert (loglev >= 0 && loglev < N_LOGLEV); + return default_onoff[loglev]; + } +} logfunc_t; + + +
Methods + +Here is a short description of some logfunctions methods. + + +The constructor registers a new log module with default values. +The module's log prefix is empty and the log levels are set up with default actions. + + + +The destructor removes the log module from the table. + + + +The info(), error(), panic() +and ldebug() methods are called via macros to create a log event +of the related level. + + + +The fatal() method is called if a log event occurs and it's +action is set to "fatal". It is used to shut down the Bochs simulation. + + + +The ask() method is called if a log event occurs and it's +action is set to "ask". It sends an event to the simulator interface and depending +on the return value the simulation continues or it is terminated by calling +fatal(). The simulator interface either prompts the user on +the console or calls some platform / gui specific code to handle the +ask request. + + + +The put() methods are used to set up the log module prefix in +that appears in the log file and the log module name that appears in the config +interface. If the name is not specified, the prefix is used instead. + + +The setio() method sets up the iofunctions +class for the log file output. This method is only used by the logfunctions +constructors. + + +The getonoff() and setonoff() methods +are used by the config interface to display and change the log actions for a +Bochs facility. + + +The get_default_action() and set_default_action() +methods are also used by the config interface to set up the default action for a +log level. + + +The get_name() and getprefix() methods return +the strings set up with the put() method. The config interface +is also using them to build the menu / dialog to set up the log functions. + + + +
+
+ +
Internal timers +
Overview + +The Bochs internal timers are required to provide timer features in the device +emulation and for the interaction between simulator and gui. They are implemented +in the bx_pc_system_c class and driven by the cpu. When +programming a timer the interval is specified in useconds and the timer code +translates the value to cpu ticks using the IPS +value. In the original implementation the cpu object calls a timer method to increment +the system time by one tick after completing one instruction. If a timer has +expired, the related timer handler function is called. Now it is also possible +to execute a number of cpu instructions, finally update the timer subsystem +with this number and possibly call several timer handlers. Here are some +examples for timers in the devices and gui code: + +the PIT (i82C54) system timer at 18.2 Hz +the CMOS RTC one-second-timer +the display update timer (set up with "vga: update_freq=X") +the devices timer (polls keyboard/mouse events from the gui every 1 emulated msecond) +the LED auto-off timer (indicating data transfer for min 0.5 seconds) +the synchronization timers (realtime/slowdown) are also based on the standard timers + + + +These are the capabilities of the Bochs internal timers: + +register / unregister at runtime +activate / deactivate at runtime +timer period changeable +one-shot or continuous mode + + +
+
Timer definitions, members and methods + +Here are the timer-related definitions and members in pc_system.h: + +#define BX_MAX_TIMERS 64 +#define BX_NULL_TIMER_HANDLE 10000 + +typedef void (*bx_timer_handler_t)(void *); + + struct { + bx_bool inUse; // Timer slot is in-use (currently registered). + Bit64u period; // Timer periodocity in cpu ticks. + Bit64u timeToFire; // Time to fire next (in absolute ticks). + bx_bool active; // 0=inactive, 1=active. + bx_bool continuous; // 0=one-shot timer, 1=continuous periodicity. + bx_timer_handler_t funct; // A callback function for when the + // timer fires. + void *this_ptr; // The this-> pointer for C++ callbacks + // has to be stored as well. +#define BxMaxTimerIDLen 32 + char id[BxMaxTimerIDLen]; // String ID of timer. + Bit32u param; // Device-specific value assigned to timer (optional) + } timer[BX_MAX_TIMERS]; + + unsigned numTimers; // Number of currently allocated timers. + unsigned triggeredTimer; // ID of the actually triggered timer. + Bit32u currCountdown; // Current countdown ticks value (decrements to 0). + Bit32u currCountdownPeriod; // Length of current countdown period. + Bit64u ticksTotal; // Num ticks total since start of emulator execution. + Bit64u lastTimeUsec; // Last sequentially read time in usec. + Bit64u usecSinceLast; // Number of useconds claimed since then. + + // A special null timer is always inserted in the timer[0] slot. This + // make sure that at least one timer is always active, and that the + // duration is always less than a maximum 32-bit integer, so a 32-bit + // counter can be used for the current countdown. + static const Bit64u NullTimerInterval; + static void nullTimer(void* this_ptr); + + + +These are the public timer-related methods for timer control, driving the timers +with the cpu and retrieving the internal time implemented in the bx_pc_system_c +class: + + void initialize(Bit32u ips); + int register_timer(void *this_ptr, bx_timer_handler_t, Bit32u useconds, + bx_bool continuous, bx_bool active, const char *id); + bx_bool unregisterTimer(unsigned timerID); + void setTimerParam(unsigned timerID, Bit32u param); + void start_timers(void); + void activate_timer(unsigned timer_index, Bit32u useconds, bx_bool continuous); + void deactivate_timer(unsigned timer_index); + unsigned triggeredTimerID(void) { + return triggeredTimer; + } + Bit32u triggeredTimerParam(void) { + return timer[triggeredTimer].param; + } + static BX_CPP_INLINE void tick1(void) { + if (--bx_pc_system.currCountdown == 0) { + bx_pc_system.countdownEvent(); + } + } + static BX_CPP_INLINE void tickn(Bit32u n) { + while (n >= bx_pc_system.currCountdown) { + n -= bx_pc_system.currCountdown; + bx_pc_system.currCountdown = 0; + bx_pc_system.countdownEvent(); + // bx_pc_system.currCountdown is adjusted to new value by countdownevent(). + } + // 'n' is not (or no longer) >= the countdown size. We can just decrement + // the remaining requested ticks and continue. + bx_pc_system.currCountdown -= n; + } + + int register_timer_ticks(void* this_ptr, bx_timer_handler_t, Bit64u ticks, + bx_bool continuous, bx_bool active, const char *id); + void activate_timer_ticks(unsigned index, Bit64u instructions, + bx_bool continuous); + Bit64u time_usec(); + Bit64u time_usec_sequential(); + static BX_CPP_INLINE Bit64u time_ticks() { + return bx_pc_system.ticksTotal + + Bit64u(bx_pc_system.currCountdownPeriod - bx_pc_system.currCountdown); + } + + static BX_CPP_INLINE Bit32u getNumCpuTicksLeftNextEvent(void) { + return bx_pc_system.currCountdown; + } + + + +This private method is called when the function handling the clock ticks finds +that an event has occurred: + + void countdownEvent(void); + + +
+
Detailed functional description + +The Bochs timer implementation requires at least one timer to be active. That's why +there is a so-called nullTimer to make it work. It is +initialized in the constructor on the first timer slot with the highest possible +timer interval and it's handler is an empty function. + + +The most important variables of the timer subsystem are initialized on startup +with the nullTimer values and updated after each timer +modification (register / unregister / activate / deactivate / processing +handler). + +ticksTotal: number of ticks total from emulator +startup to the last update of timer subsystem +currCountdownPeriod: length of the period +from ticksTotal to the next timer event +currCountdown: number of ticks remaining +until the next timer event occurs + +The number if ticks since emulator startup is calculated with the formula +ticksTotal + currCountdownPeriod - currCountdown and +returned with the time_ticks() method. The number of +useconds since emulator startup is returned with the time_usec() +method computed from the return value of time_ticks() and +the IPS value. + + +&FIXME; To be continued + +
+
+ +
Bochs's CMOS map + +In addition to the default CMOS RAM layout, the Bochs BIOS uses some additional +registers for harddisk parameters and the boot sequence. The following table +shows all CMOS registers and their meaning. + + + +Legend: +S - set by the emulator (Bochs) +Q - set by the emulator (Qemu) +B - set by the bios +U - unused by the bios + +LOC NOTES MEANING +0x00 S rtc seconds +0x01 B second alarm +0x02 S rtc minutes +0x03 B minute alarm +0x04 S rtc hours +0x05 B hour alarm + +0x06 S,U day of week +0x07 S,B date of month +0x08 S,B month +0x09 S,B year + +0x0a S,B status register A +0x0b S,B status register B +0x0c S status register C +0x0d S status register D + +0x0f S shutdown status + values: + 0x00: normal startup + 0x09: normal + 0x0d+: normal + 0x05: eoi ? + else: unimpl + +0x10 S fd drive type (2 nibbles: high=fd0, low=fd1) + values: + 1: 360K 5.25" + 2: 1.2MB 5.25" + 3: 720K 3.5" + 4: 1.44MB 3.5" + 5: 2.88MB 3.5" + +!0x11 configuration bits!! + +0x12 S how many disks first (hd type) + +!0x13 advanced configuration bits!! + +0x14 S,U equipment byte (?) + bits where what + 7-6 floppy.cc + 5-4 vga.cc 0 = vga + 2 keyboard.cc 1 = enabled + 0 floppy.cc + +0x15 S,U base memory - low +0x16 S,U base memory - high + +0x17 S,U extended memory in k - low +0x18 S,U extended memory in k - high + +0x19 S hd0: extended type +0x1a S hd1: extended type + +0x1b S,U hd0:cylinders - low +0x1c S,U hd0:cylinders - high +0x1d S,U hd0:heads +0x1e S,U hd0:write pre-comp - low +0x1f S,U hd0:write pre-comp - high +0x20 S,U hd0:retries/bad_map/heads>8 +0x21 S,U hd0:landing zone - low +0x22 S,U hd0:landing zone - high +0x23 S,U hd0:sectors per track + +0x24 S,U hd1:cylinders - low +0x25 S,U hd1:cylinders - high +0x26 S,U hd1:heads +0x27 S,U hd1:write pre-comp - low +0x28 S,U hd1:write pre-comp - high +0x29 S,U hd1:retries/bad_map/heads>8 +0x2a S,U hd1:landing zone - low +0x2b S,U hd1:landing zone - high +0x2c S,U hd1:sectors per track + +0x2d S boot from (bit5: 0:hd, 1:fd) + +0x2e S,U standard cmos checksum (0x10->0x2d) - high +0x2f S,U standard cmos checksum (0x10->0x2d) - low + +0x30 S extended memory in k - low +0x31 S extended memory in k - high + +0x32 S rtc century + +0x34 S extended memory in 64k - low +0x35 S extended memory in 64k - high + +0x37 S ps/2 rtc century (copy of 0x32, needed for winxp) + +0x38 S eltorito boot sequence + boot signature check + bits + 0 floppy boot signature check (1: disabled, 0: enabled) + 7-4 boot drive #3 (0: unused, 1: fd, 2: hd, 3:cd, else: fd) + +0x39 S ata translation policy - ata0 + ata1 + bits + 1-0 ata0-master (0: none, 1: LBA, 2: LARGE, 3: R-ECHS) + 3-2 ata0-slave + 5-4 ata1-master + 7-6 ata1-slave + +0x3a S ata translation policy - ata2 + ata3 (see above) + +0x3b S ata biosdetect flags - ata0 + ata1 (unimplemented) + bits + 1-0 ata0-master (0: auto, 1: cmos, 2: none) + 3-2 ata0-slave + 5-4 ata1-master + 7-6 ata1-slave + +0x3c S ata biosdetect flags - ata2 + ata3 (unimplemented) + +0x3d S eltorito boot sequence (see above) + bits + 3-0 boot drive #1 + 7-4 boot drive #2 + +0x3f S BIOS options + bits + 0 fastboot (skip boot menu delay) + 7-1 reserved + +0x5b S extra memory above 4GB +0x5c S extra memory above 4GB +0x5d S extra memory above 4GB +0x5f Q number of processors + + +
+ +
+ +Sound Blaster 16 Emulation + + +This section is a detailed description for configuring Sound Blaster 16 from +source. If you have a binary and all you want to know is what to put in your +bochsrc file, see the sb16 +bochsrc option in the user guide. + + + +The original version of the Sound Blaster 16 (SB16) emulation for Bochs was +written and donated by Josef Drexler. The entire set of his SB16 patches have +been integrated into Bochs, however, so you can find everything you need here. + + +
How well does it work? + +Right now, MPU401 emulation is next to perfect. It supports UART +and SBMIDI mode, because the SB16's MPU401 ports can't do anything else as well. + + + +The digital audio basically works, but the emulation is too slow for fluent +output unless the application doesn't do much in the background (or the +foreground, really). The sound tends to looping or crackle on slower +computer, but the emulation appears to be correct. Even a MOD +player works, although only for lower sampling speeds. + + +The OPL3 chip now also produces output. The source code has been ported from +DOSBox and the output data is polled from the mixer thread. + + +Also, the MIDI data running through the MPU401 ports can be written +into a SMF, that is the standard midi file. The wave output +can be written into a VOC file, which has a format defined by +Creative Labs. Output to a WAV file and dual output (device and file +at the same time) is now also supported. + +
+ +
Output to a sound card + + +Output to the host sound system is supported on Windows, Linux, FreeBSD, MacOS 9, +MacOSX and platforms supported by SDL. + + +On Linux using OSS, the output goes to any file or device. If you have a +wavetable synthesizer, midi can go to /dev/midi00, +otherwise you may need a midi interpreter. For example, the midid program from +the DosEmu project would work. Wave output should go to /dev/dsp. +These devices are assumed to be OSS devices, if they're not some of the ioctl's +might fail. If ALSA is present on Linux and the sound driver is set to +alsa, Bochs uses it's default PCM output device and MIDI +sequencer. + + +On Windows, midi and wave output go to the midi mapper and the wave mapper, +respectively. The device ID for the midi is now selectable. A future version +might also have selectable wave output devices. + + +See the next section for more information about the sound lowlevel interface. + +
+ +
Configuring Bochs + + +You need to configure Bochs using the +option. +There are a few values in config.h that are relevant to the +sound functions. Editing config.h after running configure +is usually not necessary, since it detects the available drivers and enables them +for the compilation. + + + +BX_USE_SB16_SMF should be 1 unless you intend to have several sound cards +running at the same time. + + + +BX_SOUND_LOWLEVEL_NAME is the name of the driver used as the "default" one for +all features. The default value of this setting is the dummy driver with no output. +The configure script usually changes this value. The following are supported at +the moment: + + + + alsa Output for Linux with ALSA PCM and sequencer interface + oss Output for Linux, to /dev/dsp and /dev/midi00 + osx Output for MacOSX midi and wave device + sdl Wave output with SDL/SDL2 + win Output for Windows midi and wave mappers + file Wave and midi output to file + dummy Dummy functions, no output + + + +Setup the SB16 emulation in your bochsrc, according to instructions +in that file (see sb16 option +in the user guide). + +
+ +
Runtime configuration + + +The source and the DOS executable for the SB16CTRL program that is used to modify +the runtime behaviour of the SB16 emulator is included in +misc/sb16. + + + +See the section SB16CTRL +in the user documentation for information about the commands of SB16CTRL. + +
+ +
+ +
+The sound lowlevel interface + + +This file is intended for programmers who would like to port the sound +output routines to their platform. It gives a short outline what services +have to be provided. + + +You should also have a look at the exisiting files, SOUNDLOW.CC, +SOUNDMOD.CC and e.g. SOUNDLNX.CC for Linux +or SOUNDWIN.CC for Windows and their respective header files +to get an idea about how these things really work. + + +
Files + +The main include file for a lowlevel sound driver is iodev.h. +It has all definitions for the system-independent functions that a sound driver +uses. The sound driver also needs to include soundlow.h for +the definitions of the base classes bx_sound_lowlevel_c, +bx_soundlow_waveout_c, bx_soundlow_wavein_c +and bx_soundlow_midiout_c. + + + +Additionally, every output driver will have an include file, which should be +included on top of soundmod.cc to allow the emulator +to use that driver. The code to initialize the object for the selected drivers +can be found in that file, so a soundcard emulation does not need to include +the specific driver headers. + + + +To actually make the emulator use any specific driver as the default, +BX_SOUND_LOWLEVEL_NAME has to be set to the name of the +respective driver. + + + +Note that if your class contains any system-specific statements, +include-files and so on, you should enclose both the include-file and +the CC-file in an #if defined (OS-define) construct. +Also don't forget to add your file to the list of lowlevel sound object +files (SOUNDLOW_OBJS) in the file configure.in +and to regenerate the configure script, + +
+ +
Defines and strutures + + +#define BX_SOUNDLOW_WAVEPACKETSIZE 19200 + +#define BX_SOUNDLOW_OK 0 +#define BX_SOUNDLOW_ERR 1 + +typedef struct { + Bit16u samplerate; + Bit8u bits; + Bit8u channels; + Bit8u format; + Bit16u volume; +} bx_pcm_param_t; + +const bx_pcm_param_t default_pcm_param = {44100, 16, 2, 1}; + + + +The maximum size of a wave data packet, the return values of the lowlevel +functions, the structure for the PCM parameters and the default parameter +set are also important for the sound driver development. They can be found +in the main include file soundlow.h. + + +All lowlevel sound methods called from the device code have to return either +BX_SOUNDLOW_OK if the function was successful, or +BX_SOUNDLOW_ERR if not. If any of the initialization +functions fail, the device emulation should disable the affected feature. + +
+ +
Classes + +The following classes are involved with the sound lowlevel interface: + + + +bx_soundmod_ctl_c is a pseudo device that is used to +initialize the sound drivers depending on the configuration. + + + +bx_sound_lowlevel_c is the base class of the +lowlevel sound support. It has methods to return pointers to the objects for +the available services waveout, wavein +and midiout. The base class returns NULL for all services. + + + +bx_sound_dummy_c is derived from bx_sound_lowlevel_c. +It returns vaild pointers for all services, but the output classes are only +implemented as stubs and the wavein service returns silence. +This "dummy" driver is used whenever a OS specific driver does not implement +all services. + + + +bx_soundlow_waveout_c, bx_soundlow_wavein_c +and bx_soundlow_midiout_c are the base classes for the +services provided by the Bochs lowlevel sound support. Some methods are stubs +and used by the "dummy" sound driver, others are helper methods and used by +the OS specific implementations derived from these base classes. + + + +bx_sound_OS_c is derived from bx_sound_lowlevel_c. +It returns vaild pointers for all services it implements for the selected +OS (operating system / library) or NULL for services it does +not implement. In the second case the Bochs sound init code falls back to the +"dummy" driver. + + +
+ +
The base class <emphasis>bx_sound_lowlevel_c</emphasis> + + +class bx_sound_lowlevel_c : public logfunctions { +public: + bx_sound_lowlevel_c(); + virtual ~bx_sound_lowlevel_c(); + + virtual bx_soundlow_waveout_c* get_waveout() {return NULL;} + virtual bx_soundlow_wavein_c* get_wavein() {return NULL;} + virtual bx_soundlow_midiout_c* get_midiout() {return NULL;} + +protected: + bx_soundlow_waveout_c *waveout; + bx_soundlow_wavein_c *wavein; + bx_soundlow_midiout_c *midiout; +}; + + + +The base class for sound lowlevel support is derived from the logfunctions +class to make the Bochs logging capabilities available in the sound driver code. +The constructor of this base class only initializes all pointers to NULL and +the destructor deletes the objects if necessary. + +
+ +
The <emphasis>waveout</emphasis> base class <emphasis>bx_soundlow_waveout_c</emphasis> + + +class bx_soundlow_waveout_c : public logfunctions { +public: + bx_soundlow_waveout_c(); + virtual ~bx_soundlow_waveout_c(); + + virtual int openwaveoutput(const char *wavedev); + virtual int set_pcm_params(bx_pcm_param_t *param); + virtual int sendwavepacket(int length, Bit8u data[], bx_pcm_param_t *src_param); + virtual int get_packetsize(); + virtual int output(int length, Bit8u data[]); + virtual int closewaveoutput(); + + virtual int register_wave_callback(void *, get_wave_cb_t wd_cb); + virtual void unregister_wave_callback(int callback_id); + + virtual bx_bool mixer_common(Bit8u *buffer, int len); +protected: + void convert_pcm_data(Bit8u *src, int srcsize, Bit8u *dst, int dstsize, bx_pcm_param_t *param); + void start_mixer_thread(void); + + bx_pcm_param_t emu_pcm_param, real_pcm_param; + int cvt_mult; + + int cb_count; + struct { + void *device; + get_wave_cb_t cb; + } get_wave[BX_MAX_WAVE_CALLBACKS]; + int pcm_callback_id; +}; + + + +The base class for wave output support is also derived from the +logfunctions class. In addition to wave output methods +used from sound devices, it contains everything required for the mixer thread +feature (register PCM sources, convert data formats, start mixer). + + +The constructor should not allocate the output devices. +This should be done in openwaveoutput(). + + +This table shows the waveout class methods, where are they called from and +if a platform / library specific implementation is required. + +Waveout methods + + + +Method +Called from +Platform code + + + +openwaveoutput()Sound init codeRequired +set_pcm_params()openwaveoutput() and sendwavepacket()Required +sendwavepacket()Sound device emulationOptional +get_packetsize()Mixer threadOptional +output()Mixer threadRequired +closewaveoutput()Sound device emulationOptional +register_wave_callback()openwaveoutput() and sound device emulationOptional +unregister_wave_callback()class destructor and sound device emulationOptional +mixer_common()Mixer threadOptional +convert_pcm_data()InternalNo +start_mixer_thread()InternalNo + + +
+ +
+ +
int openwaveoutput(const char *wavedev) + + +openwaveoutput() is called when the sound output subsystem +initializes. It should do the following: + + + + +Set up the default PCM parameters for output. + + +Open the given device, and prepare it for wave output. + + +Register the callback function for the PCM buffer queue (sendwavepacket() +adds the output to the queue and the mixer thread gets it from there). + + +Start the mixer thread, unless the sound library has it's own one (e.g. SDL). + + + + +openwaveoutput() will only be called once, whereas +set_pcm_params() is called whenever the PCM samplerate +has been changed. + + +The parameters are the following: + + + +wavedev is the wave output device selected by the user. +It is strictly system-dependent. Some sound libraries currently ignore this +value and use the default one instead. The value is that of the waveout=device +configuration parameter of the sound bochsrc option. + + + + +Note that only one wave output device will be used at any one time. +wavedev may not have the same value throughout one session, +but it will be closed before it is changed. + +
+ +
+int set_pcm_params(bx_pcm_param_t *param) + + +This function should called from openwaveoutput() to initialize +the output device with the default parameters and from sendwavepacket() +whenever the samplerate has been changed in the emulated sound device. +It should do the following: + + + + +Open the wave output device, unless openwaveoutput() did that +already. + + + +Prepare the device for data and set the device parameters to those given +in the function call. + + + + +The parameters are the following: + + + + +param is a pointer to a structure containing the set of +parameters required to set up a sound device for PCM output. + + + + +The members of the structure bx_pcm_param_t are these: + + + + +samplerate is the desired frequency of the +output. Because of the capabities of the soundcards, it can have any value +between 5000 and 48,000. + + + +bits is either 8 or 16, denoting the resolution +of one sample. + + + +channels is the number of channels (2 for stereo output, +or 1 for mono output. + + + +format is a bit-coded value (see below). + + + +volume is the output volume to be used by the mixer code. +The 16 bit value consists of two 8 bit values for each channel. + + + + + +format bits + + + +Bit number +Meaning + + + + 0 (LSB) 0: unsigned data + 1: signed data + 1..6 Type of codec (see below) + 7 0: no reference byte + 1: with reference byte + 8..x reserved (0) + + +
+ + +codecs + + + +Value +Meaning + + + + 0 PCM (raw data) + 1 reserved + 2 2-bit ADPCM (Creative Labs format) + 3 2.4-bit (3-bit) ADPCM (Creative Labs format) + 4 4-bit ADPCM (Creative Labs format) + + +
+
+ +Other codecs are not supported by the SB hardware. In fact, most applications will +translate their data into raw data, so that in most cases the codec will be zero. + + +The number of bytes per sample can be calculated from this as (bits / 8) * channels. + +
+ + +
+int sendwavepacket(int length, Bit8u data[], bx_pcm_param_t *src_param) + + +This function is called whenever a data packet of at most +BX_SOUNDLOW_WAVEPACKETSIZE is ready at the soundcard +emulation. It should then do the following: + + + + +Add this wave packet to the waveout buffer chain after converting to 16 bit signed +little endian. If the samplerate has been changed set_pcm_params() +should be called to update the sound hardware settings. + + + + +Parameters: + + + + +length is the number of data bytes in +the data stream. It will never be larger than BX_SOUNDLOW_WAVEPACKETSIZE. + + + +data is the array of data bytes. + + + +src_param is a pointer to a structure containing the PCM parameters +(see above). + + + + +The order of bytes in the data stream is the same as that in the Wave file format: + + +wave output types + + + +Output type +Sequence of data bytes + + + + 8 bit mono Sample 1; Sample 2; Sample 3; etc. + 8 bit stereo Sample 1, Channel 0; Sample 1, Channel 1; Sample 2, Channel 0; Sample 2, Channel 1; etc. + 16 bit mono Sample 1, LSB; Sample 1, MSB; Sample 2, LSB; Sample 2, MSB; etc. + 16 bit stereo Sample 1, LSB, Channel 0; Sample 1, MSB, Channel 0; Sample 1, LSB, Channel 1; Sample 1, MSB, Channel 1; etc. + + +
+
+ + +Typically 8 bit data will be unsigned with values from 0 to 255, and +16 bit data will be signed with values from -32768 to 32767, although the +soundcard emulations are not limited to this. +site. + +
+ +
int get_packetsize() + +This function is called from the mixer thread to retrieve the size of a wave data +packet based on the current samplerate. By default the packet size is big enough +to send output for 0.1 seconds. If the host sound driver / library uses a different +value, this value should be returned with this method. + +
+ +
int output(int length, Bit8u data[]) + +This function is called from the mixer thread to send the mixed PCM output to +the host sound hardware. + + +Parameters: + + + + +length is the number of data bytes in +the data stream. It will never be larger than the value returned from get_packetsize. + + + +data is the array of data bytes. + + +
+ +
int closewaveoutput() + +This function is currently only called from the soundcard emulation if the "file" +driver is used. This makes the runtime change of the output file possible. +By default this method does nothing and the wave output device is closed in the +destructor of the specific class. + +
+ +
int register_wave_callback(void *arg, get_wave_cb_t wd_cb) + +This function is called from openwaveoutput() to register +the function to retrieve data from the PCM output buffer chain. Other sound +emulation devices (e.g. OPL3, PC speaker) can register a function to poll the +data from the device emulation. The return value is the ID of the registered +function and it is usually used to unregister the source. + + +Parameters: + + + + +arg is the pointer to the device emulation object. + + + +wd_cb is the pointer to a static function that returns +wave data from the device emulation. This function is usually called from the +mixer_common() method. + + +
+ +
void unregister_wave_callback(int callback_id) + +This function is usually called from the destructor of the sound emulation +device to unregister it's registered function to poll PCM data. If the +driver / library doesn't use the default mixer thread, a specific implementation +of this method my be required. + + +Parameter: + + + + +callback_id is the ID of the function to unregister. + + +
+ +
bx_bool mixer_common(Bit8u *buffer, int len) + +This is the main wave output mixing function. It is called from the mixer +thread, it polls the wave data from all registered sources and it mixes the +data using a simple algorithm (addition and clipping). The return value +indicates whether or not wave data is available for output. + + +Parameters: + + + + +buffer is the output buffer for the wave data. + + + +len is the maximum length of the output buffer. + + +
+ +
void convert_pcm_data(Bit8u *src, int srcsize, Bit8u *dst, int dstsize, bx_pcm_param_t *param) + +This function converts the PCM data sent from the sound device emulation to the +16 bit stereo signed little endian format. It should be called in sendwavepacket() +after allocating the output buffer in the buffer queue. Future versions might +also perform resampling here. + + +Parameters: + + + + +src is the buffer containing data sent from the sound emulation. + + + +srcsize is the amount of wave data to be converted. + + + +dst is the buffer for the converted wave data. + + + +dstsize is the size of the destination buffer. + + + +param is a pointer to the struture containing the format +parameters of the source data. + + +
+ +
void start_mixer_thread() + +This function starts the mixer thread and it should be called in openwaveoutput() +unless the sound driver / library has it's own way to do this (e.g. SDL). This +function also initializes the mutex required for locking the mixer thread when +adding data to the buffer chain or unregistering a source. + +
+
+ +
The <emphasis>wavein</emphasis> base class <emphasis>bx_soundlow_wavein_c</emphasis> + + +class bx_soundlow_wavein_c : public logfunctions { +public: + bx_soundlow_wavein_c(); + virtual ~bx_soundlow_wavein_c(); + + virtual int openwaveinput(const char *wavedev, sound_record_handler_t rh); + virtual int startwaverecord(bx_pcm_param_t *param); + virtual int getwavepacket(int length, Bit8u data[]); + virtual int stopwaverecord(); + + static void record_timer_handler(void *); + void record_timer(void); +protected: + int record_timer_index; + int record_packet_size; + sound_record_handler_t record_handler; +}; + + + +The base class for wave input support is also derived from the +logfunctions class. It contains the framework for wave +input (recording) support. The base class is used by the "dummy" sound driver +and returns silence to let the input mechanism of the soundcard emulation work. +The soundcard emulator object needs to implement a callback function to notifies +the emulation about available data. This function usually calls the driver method +to get the wave data packet. The driver objects has a periodic timer with an +interval of 0.1 emulated seconds that is active during recording. The timer +handler processes the wave data recorded with platform or library specific +function and finally notifies the emulator. + + +The constructor of the base class only initializes the timer ID. OS specific +implementations should initialize other required members here. + + +The destructor of the base class only calls stopwaverecord(). +OS specific implementations should close the input device here if necessary. + + +
int openwaveinput(char *device, sound_record_handler_t rh) + +openwaveinput() is called when the sound emulation first +receives a sound recording command. It should do the following: + + + + +Open the given device, and prepare it for wave input + + + +or + + + +Store the device name so that the device can be opened in startwaverecord(). + + + + +In addition to this the record handler value should be stored and the record timer +should be registered. This is the definition of record handler callback function: + +typedef Bit32u (*sound_record_handler_t)(void *arg, Bit32u len); + + + + +openwaveinput() will only be called once, whereas +startwaverecord() is called for every new wave input +command to the soundcard emulation. If feasible, it could be useful to open +and/or lock the input device in startwaverecord() as +opposed to openwaveinput() to ensure that it can be used +by other applications while Bochs doesn't need it. + + +The parameters are the following: + + + +device is the wave device selected by the user. It is +strictly system-dependent. The value is that of the wavein=device +configuration parameter of the sound bochsrc option. + + +rh is a pointer to the record handler method of the sound +emulation. When sound recording is active, this handler is called periodicly to +notify the sound emulation about newly available data. + + + + +Note that only one wave input device will be used at any one time. +device may not have the same value throughout one session, +but it will be closed before it is changed. + +
+ +
+int startwaverecord(bx_pcm_param_t *param) + +This method receives a pointer to the required PCM parameters (samplerate, +data format) as the argument and it should set up the input device for recording, +calculate the size of the recording packet for 0.1 second and start the record +timer. + +
+ +
+int getwavepacket(int length, Bit8u data[]) + +This method is called from the record handler method of the sound emulation device +to retrieve the recorded wave data packet. + +
+ +
int stopwaverecord() + +This method is called to stop the wave recording. It deactivates the timer that +calls the method to perform the recording. + +
+ +
+ +
The <emphasis>midiout</emphasis> base class <emphasis>bx_soundlow_midiout_c</emphasis> + + +class bx_soundlow_midiout_c : public logfunctions { +public: + bx_soundlow_midiout_c(); + virtual ~bx_soundlow_midiout_c(); + + virtual int openmidioutput(const char *mididev); + virtual int midiready(); + virtual int sendmidicommand(int delta, int command, int length, Bit8u data[]); + virtual int closemidioutput(); +}; + + + +The base class for MIDI output support is also derived from the +logfunctions class. + + +OS specific implementations should initialize required members in the constructor. + + +The destructor of the base class only calls closemidioutput(). +OS specific implementations should close the input device here if necessary. + + +
int openmidioutput(char *device) + + + +openmidioutput() is called when the first midi output starts. +It is only called if the midi output to the driver is active (midimode 1). It should +prepare the given MIDI hardware for receiving midi commands. + + + + +Description of the parameters: + + + + + + +mididev is a system-dependent variable. +The value is that of the midiout=device +configuration parameter of the sound bochsrc option. + + + +Note that only one midi output device will be used at any one time. +device +may not have the same value throughout one session, but it will be closed +before it is changed. + + + +
+ +
int midiready() + + +midiready() is called whenever the applications asks if the +midi queue can accept more data. + + + +Return values: + + + + +BX_SOUNDLOW_OK if the midi output device is ready. + + + +BX_SOUNDLOW_ERR if it isn't ready. + + + + +Note: midiready() will be called a few times +before the device is opened. If this is the case, it should +always report that it is ready, otherwise the application (not Bochs) +will hang. + +
+ +
int sendmidicommand(int delta, int command, int length, Bit8u data[]) + + +sendmidicommand()is called whenever a complete midi command has +been written to the emulator. It should then send the given midi command to the midi hardware. +It will only be called after the midi output has been opened. Note that +if at all possible it should not wait for the completion of the command +and instead indicate that the device is not ready during the execution +of the command. This is to avoid delays in the program while it is +generating midi output. + + + +Description of the parameters: + + + + +delta is the number of delta ticks that +have passed since the last command has been issued. It is always zero for +the first command. There are 24 delta ticks per quarter, and 120 quarters +per minute, thus 48 delta ticks per second. + + + +command is the midi command byte (sometimes +called status byte), in the usual range of 0x80..0xff. For more information +please see the midi standard specification. + + + +length is the number of data bytes that +are contained in the data structure. This does not include the status +byte which is not replicated in the data array. It can only be greater +than 3 for SysEx messages (commands 0xF0 and 0xF7) + + + +data[] is the array of these data bytes, +in the order they have in the standard MIDI specification. +Note, it might be NULL if length==0. + + +
+ +
int closemidioutput() + + +closemidioutput() is called before shutting down Bochs or +when the +emulator gets the stop_output command through the emulator port. +After this, no more output will be necessary until openmidioutput() +is called again, but midiready() might still be called. It should +do the following: + + + + +Wait for all remaining messages to be completed + + +Reset and close the midi output device + + +
+ +
+ +
+ +
Harddisk Images based on redologs + +This section describes how the three new disk images "undoable", "growing", and "volatile" are +implemented in Bochs 2.1. It also applies to the write support the "vvfat" disk +image mode in Bochs 2.4.6. + + + +undoable -> base r/o file, plus growing, commitable, rollbackable redolog file + + +growing -> growing files, all previously unwritten sectors go to the end of file + + +volatile -> base r/o file, plus hidden growing redolog + + +vvfat -> virtual VFAT disk created from directory, plus hidden growing redolog + + + + + + +
+ + Description + + +The idea behind volatile and undoable disk images is to have a read-only base +file, associated with one redolog file. In case of vvfat, a directory is +associated with the redolog file. + + +Reading a sector is done from the redolog file if it contains +the sector, or from the base file / vvfat directory otherwise. + + +Sectors written go to the redolog, +so base image files are opened in read only mode in this configuration. + + +The redolog is designed in a way so it starts as a small file +and grows with every new sectors written to it. Previously written +sectors are done in place. Redolog files can not shrink. + + +The redolog is a growing file that can be created on the fly. + + +Now, it turns out that if you only use a redolog without any +base image file, you get a "growing" disk image. + + +So "undoable", "volatile", "growing" and "vvfat" harddisk images classes +are implemented on top of a redolog class. + +
+ +
+ + How redologs works ? + + + +At the start of a redolog file, there is a header, so Bochs can check whether +a file is consistent. +This header is also checked when the automatic type and size detection is +selected. + + +The generic part of the header contains values like type of image, and +spec version number. + + +The header also has a specific part. +For redologs, the number +of entries of the catalog, the extent, bitmap and disk size are stored. + + + +In a redolog, the disk image is divided in a number of equal size "extents". +Each extent is a collection of successive 512-bytes sectors of the disk image, +preceeded by a n*512bytes bitmap. + + + +the n*512bytes bitmap defines the presence (data has been written to it) +of a specific sector in the extent, one bit for each sector. +Therefore with a 512bytes bitmap, each extent can hold up to 4k blocks + + + +Typically the catalog can have 256k entries. +With a 256k entries catalog and 512bytes bitmaps, the redolog can hold up to 512GiB + + + + +All data is stored on images as little-endian values + + +
+ + Header + + +At the start of a redolog file, there is a header. This header is designed +to be reusable by other disk image types. + + +The header length is 512 bytes. It contains : + +Generic header description + + + +Start position in bytes +Length in bytes +Data type +Description +Possible values + + + + 0 32 string magical value Bochs Virtual HD Image + 32 16 string type of file Redolog + 48 16 string subtype of file Undoable, Volatile, Growing + 64 4 Bit32u version of used specification 0x00010000, 0x00020000 + 68 4 Bit32u header size 512 + + +
+
+ +The current version of the header is 0x00020000 (2.0) - see below for details. + +Redolog specific header description + + + +Start position in bytes +Length in bytes +Data type +Description + + + + 72 4 Bit32u number of entries in the catalog + 76 4 Bit32u bitmap size in bytes + 80 4 Bit32u extent size in bytes + 84 4 Bit32u timestamp in FAT format ("undoable" mode only - otherwise reserved) + 88 8 Bit64u disk size in bytes + + +
+
+ +The reserved field between "extent" and "disk" has been added in redolog version +2.0 to fix an alignment bug on some platforms. It is now used for consistency +check of the "undoable" mode. When creating the redolog file, the timestamp of +the read-only file is stored there (in FAT format). After that, the "undoable" +mode init code compares the timestamp of the r/o file with the one stored in +the redolog. + +
+ +
+ + Catalog + + +Immediately following the header, there is a catalog containing +the position number (in extents) where each extent is located in the file. + + +Each position is a Bit32u entity. + +
+ +
+ + Bitmap + + +Each extent starts with a bitmap block of n*512 bytes size. Each byte of the +bitmap stores the write status of 8 coresponding disk sectors in the extent +(1 = data written). + +
+ +
+ + Extent + + +This is a collection of successive 512-bytes sectors of the disk image. +The bitmap preceeding this data block contains the write status of each sector. + +
+
+ +
+Parameters + + +The following tables shows what parameters are used when creating redologs or creating "growing" images : + + + How number of entries in the catalog and number of blocks by extents are computed + + + + +Catalog entries Catalog size(KiB) Bitmap size (B) Extent size (KiB) Disk Max Size + + + + + +512 2 1 4 2MiB + + +512 2 2 8 4MiB + + +1k 4 2 8 8MiB + + +1k 4 4 16 16MiB + + +2k 8 4 16 32MiB + + +2k 8 8 32 64MiB + + +4k 16 8 32 128MiB + + +4k 16 16 64 256MiB + + +8k 32 16 64 512MiB + + +8k 32 32 128 1GiB + + +16k 64 32 128 2GiB + + +16k 64 64 256 4GiB + + +32k 128 64 256 8GiB + + +32k 128 128 512 16GiB + + +64k 256 128 512 32GiB + + +64k 256 256 1024 64GiB + + +128k 512 256 1024 128GiB + + +128k 512 512 2048 256GiB + + +256k 1024 512 2048 512GiB + + +256k 1024 1024 4096 1TiB + + +512k 2048 1024 4096 2TiB + + +512k 2048 2048 8192 4TiB + + +1024k 4096 2048 8192 8TiB + + +1024k 4096 4096 16384 16TiB + + +2048k 8192 4096 16384 32TiB + + + +
+
+ +
+ +
+ + Redolog class description + + +The class redolog_t(); implements the necessary +methods to create, open, close, read and write data to a redolog. +It also contains methods for the subtype and consistency check and +for the save/restore support. Managment of header catalog and sector +bitmaps is done internally by the class. + +
+ + Constants + + + +#define STANDARD_HEADER_MAGIC "Bochs Virtual HD Image" +#define STANDARD_HEADER_VERSION (0x00020000) +#define STANDARD_HEADER_SIZE (512) + +These constants are used in the generic part of the header. + + + + +#define REDOLOG_TYPE "Redolog" +#define REDOLOG_SUBTYPE_UNDOABLE "Undoable" +#define REDOLOG_SUBTYPE_VOLATILE "Volatile" +#define REDOLOG_SUBTYPE_GROWING "Growing" + +These constants are used in the specific part of the header. + + + + +#define REDOLOG_PAGE_NOT_ALLOCATED (0xffffffff) + +This constant is used in the catalog for an unwritten extent. + + +
+ +
Methods + +redolog_t(); instanciates a new redolog. + + +int make_header(const char* type, Bit64u size); creates a header +structure in memory, and sets its type and parameters based on the +disk image size. Returns 0. + + +int create(const char* filename, const char* type, Bit64u size); +creates a new empty redolog file, with header and catalog, named filename +of type type for a size bytes image. +Returns 0 for OK or -1 if a problem occurred. + + +int create(int filedes, const char* type, Bit64u size); +creates a new empty redolog file, with header and catalog, in a previously +opened file described by filedes, of type type +for a size bytes image. +Returns 0 for OK or -1 if a problem occurred. + + +int open(const char* filename, const char* type, Bit64u size); +opens a redolog file named filename, and checks +for consistency of header values against a type and +size. +Returns 0 for OK or -1 if a problem occurred. + + +int open(const char* filename, const char* type, Bit64u size, int flags); +opens a redolog file with flags applied. This allows to +open a redolog in read-only mode. All other parameters and the return value are +similar to the default open() method above. + + +void close(); +closes a redolog file. + + +off_t lseek(off_t offset, int whence); +seeks at logical data offset offset in a redolog. +offset must be a multiple of 512. +Only SEEK_SET and SEEK_CUR are supported for whence. +Returns -1 if a problem occurred, or the current logical offset in +the redolog. + + +ssize_t read(void* buf, size_t count); +reads count bytes of data of the redolog, from current logical offset, +and copies it into buf. +count must be 512. +Returns the number of bytes read, that can be 0 if the data +has not previously be written to the redolog. + + +ssize_t write(const void* buf, size_t count); +writes count bytes of data from buf +to the redolog, at current logical offset. +count must be 512. +Returns the number of bytes written. + + +Bit64u get_size(); +returns the size stored in the "disk" field in the header. This is used for size +autodetection feature ("growing" mode) and the consistency check ("undoable" +mode). + + +Bit32u get_timestamp(); +returns the value of the "timestamp" field in the header (only used by the +"undoable" mode). + + +bx_bool set_timestamp(Bit32u timestamp); +writes the timestamp to the header. This is done +by the "undoable" mode init code if get_timestamp() returns +0 or the redolog is newly created. + + +static int check_format(int fd, const char *subtype); +checks the format of the file with descriptor fd. Returns +HDIMAGE_FORMAT_OK if the subtype +matches the requested one. This is used for for the image mode autodetection +feature. + + +bx_bool save_state(const char *backup_fname); +copies the redolog file to a new file backup_fname. This is +used by the hdimage save/restore feature. + +
+ +
+ +
+ + Disk image classes description + + +"volatile" and "undoable" disk images are easily implemented +by instanciating a device_image_t object (base image) +and a redolog_t object (redolog). + + +"growing" disk images only instanciates a redolog_t object. + + +Class names are undoable_image_t, volatile_image_t +and growing_image_t. + + +When using these disk images, the underlying data structure and layout +is completely hidden to the caller. Then, all offset and size values are +"logical" values, as if the disk was a flat file. + +
+ + Constants + + + +#define UNDOABLE_REDOLOG_EXTENSION ".redolog" +#define UNDOABLE_REDOLOG_EXTENSION_LENGTH (strlen(UNDOABLE_REDOLOG_EXTENSION)) +#define VOLATILE_REDOLOG_EXTENSION ".XXXXXX" +#define VOLATILE_REDOLOG_EXTENSION_LENGTH (strlen(VOLATILE_REDOLOG_EXTENSION)) + +These constants are used when building redolog file names + +
+ +
+ + undoable_image_t methods + + + +undoable_image_t(Bit64u size, const char* redolog_name); + +instanciates a new undoable_image_t +object. This disk image logical length is size bytes and +the redolog filename is redolog_name. + + + + +int open(const char* pathname); + +opens the disk image pathname in read-only mode, +as an undoable disk image. The image mode of this base image is auto-detected. +All supported disk image modes can be used here. The associated +redolog will be named pathname with a +UNDOABLE_REDOLOG_EXTENSION suffix, unless set in the +constructor. Returns 0 for OK or -1 if a problem occurred. + + + + +void close(); + +closes the base image and its redolog. + + + + +off_t lseek(off_t offset, int whence); + +seeks at logical data position offset in +the undoable disk image. +Only SEEK_SET and SEEK_CUR are supported for whence. +Returns -1 if a problem occurred, or the current logical +offset in the undoable disk image. + + + + +ssize_t read(void* buf, size_t count); + +reads count bytes of data +from the undoable disk image, from current logical offset, +and copies it into buf. +count must be 512. +Returns the number of bytes read. +Data will be read from the redolog if it has +been previously written or from the base image +otherwise. + + + + +ssize_t write(const void* buf, size_t count); + +writes count bytes of data from buf +to the undoable disk image, at current logical offset. +count must be 512. +Returns the number of bytes written. +Data will always be written to the redolog. + + + + +bx_bool save_state(const char *backup_fname); + +calls the related redolog_t method to save the image state. + + + + +void restore_state(const char *backup_fname); +called by the hdimage restore code. Copies the backup file to the original +location and overwrites the existing redolog file. + + +
+ +
+ + volatile_image_t methods + + + +volatile_image_t(Bit64u size, const char* redolog_name); + +instanciates a new volatile_image_t +object. This disk image logical length is size bytes and +the redolog filename is redolog_name plus a +random suffix. + + + + +int open(const char* pathname); + +opens the disk image pathname in read-only mode, +as a volatile disk image. The image mode is auto-detected. The associated +redolog will be named pathname with a random suffix, +unless set in the constructor. Returns 0 for OK or -1 if a problem occurred. + + + + +void close(); + +closes the base image and its redolog. +The redolog is deleted/lost after close is called. + + + + +off_t lseek(off_t offset, int whence); + +seeks at logical data position offset in +the volatile disk image. +Only SEEK_SET and SEEK_CUR are supported for whence. +Returns -1 if a problem occurred, or the current logical offset in +the volatile disk image. + + + + +ssize_t read(void* buf, size_t count); + +reads count bytes of data +from the volatile disk image, from current logical offset, +and copies it into buf. +count must be 512. +Returns the number of bytes read. +Data will be read from the redolog if it has +been previously written or from the base image +otherwise. + + + + +ssize_t write(const void* buf, size_t count); + +writes count bytes of data from buf +to the volatile disk image, at current logical offset. +count must be 512. +Returns the number of bytes written. +Data will always be written to the redolog. + + + + +bx_bool save_state(const char *backup_fname); + +calls the related redolog_t method to save the image state. + + + + +void restore_state(const char *backup_fname); +called by the hdimage restore code. Copies the backup file to the original +location and overwrites the existing redolog file. + + +
+ +
+ + growing_image_t methods + + + +growing_image_t(Bit64u size); + +instanciates a new growing_image_t +object. This disk image logical length is size bytes. + + + + +int open(const char* pathname); + +opens the growing disk image pathname, +Returns 0 for OK or -1 if a problem occurred. + + + + +void close(); + +closes the growing disk image. + + + + +off_t lseek(off_t offset, int whence); + +seeks at logical data position offset in +the growable disk image. +Only SEEK_SET and SEEK_CUR are supported for whence. +Returns -1 if a problem occurred, or the current logical offset in +the grwoing image. + + + + +ssize_t read(void* buf, size_t count); + +reads count bytes of data +from the growing disk image, from current logical offset, +and copies it into buf. +count must be 512. +Returns the number of bytes read. +The buffer will be filled with null bytes if data +has not been previously written to the growing image. + + + + +ssize_t write(const void* buf, size_t count); + +writes count bytes of data from buf +to the growing disk image, at current logical offset. +count must be 512. +Returns the number of bytes written. + + + + +static int check_format(int fd, Bit64u imgsize); + +checks the format of the file with descriptor fd. Returns +HDIMAGE_FORMAT_OK if the file format matches the "growing" +one. This is used for the image mode autodetection feature. + + + + +bx_bool save_state(const char *backup_fname); + +calls the related redolog_t method to save the image state. + + + + +void restore_state(const char *backup_fname); +called by the hdimage restore code. Copies the backup file to the original +location and overwrites the existing redolog file. + + +
+ +
+ +
+ +
How to add keymapping in a GUI client + +Christophe Bothamy, wrote the keymapping code for Bochs, provided these +instructions to help developers to add keymapping to a GUI. + + + +Bochs creates a bx_keymap_c object named bx_keymap. +This object allows you to : + - load the configuration specified keymap file + - get the translated BX_KEY_* from your GUI key + +You have to provide a translation function from string to your Bit32u key +constant. Casting will be necessary if your key constants are not Bit32u typed. +The function must be "static Bit32u (*)(const char *)" typed, and must return +BX_KEYMAP_UNKNOWN if it can not translate the parameter string. + +What you have to do is : + - call once "void loadKeymap(Bit32u (*)(const char*))", + providing your translation function, to load the keymap + - call "Bit32u getBXKey(Bit32u)" that returns the BX_KEY_* + constant, for each key you want to map. + +The file gui/x.cc implements this architecture, so you can refer to it +as an example. + + +
+
The Bochs BIOS +
The biossums utility +
Intention + +Writing a BIOS for a pc-compatible includes the task of embedding various +checksums. At least there is the overall bios checksum stored in the very +last byte of the program. Depending on the number and types of services the +bios provides there are others, e.g. + + + +a checksum for the PCI BIOS extensions + + +a checksum for the PCI interrupt routing table + + +a checksum for the plug and play BIOS extensions + + + +All these checksums have one common point: using the usual assembler directives +they are hard (if not impossible) to compute at compile time. You can either +compute them by hand --- a tedious, error-prone task, where in addition you +often have to make unreliable assumptions about the memory layout of the +entire BIOS. Or you patch them directly into your compiled BIOS image. Apart +from computing the checksums this is what biossums does for you. + +
+
Checksums + +With the exception of the overall BIOS checksum, in a modern PC BIOS checksums +are not used to ensure data integrity. Instead they are used in conjunction +with certain signatures to securely identify the entry points or the addresses +of important data of some BIOS extensions. Because these services are often +invoked from x86 protected mode the original method via interrupts is not +applicable. Scanning (even only parts) of the BIOS for (short) signatures and +solely relying on this is insecure though, cause the found signature might not +refer to the sought service but rather be some obscure machine code resembling +the signature by accident. + + +Since signatures are usually part of a larger header or table the above +mentioned problem is being circumvented by checksumming over this header and +comparing the result to a checksum stored next to the signature. In practice the +checksum is often part of the header, chosen in a way that the contents of the +header add up to zero. + +
+
Usage + +biossums is very simple and straightforward. The only (and mandatory) +argument is the file name of the BIOS image. The file is being read, patched and written. +So if you want to keep your original file for reference, use biossums +on a copy of your BIOS image. + + +For now, biossums can only rely on signatures to find the locations +of the accompanying checksums. Therefore biossums refuses to set any +checksums if it finds more than one signature of the same type. + +
+
Example output + +Running upon the current BIOS-bochs-legacy biossums displays: + +PCI-Bios header at: 0x9610 +Current checksum: 0x17 +Calculated checksum: 0x17 + + +$PIR header at: 0x99C0 +Current checksum: 0x37 +Calculated checksum: 0x37 + + +$PnP header at: 0x9C80 +Current checksum: 0xD1 +Calculated checksum: 0x0F Setting checksum. + + +Bios checksum at: 0xFFFF +Current checksum: 0x00 +Calculated checksum: 0x28 Setting checksum. + + + +If we patch in a second "_32_" signature at offset 0x9F00 and reset the $PIR +checksum to 0x00 we get: + + + +PCI-Bios header at: 0x9610 +Current checksum: 0x17 +Calculated checksum: 0x17 + +PCI-Bios header at: 0x9F00 +Current checksum: 0x00 +Calculated checksum: 0x00 Multiple PCI headers! No checksum set. + + +$PIR header at: 0x99C0 +Current checksum: 0x00 +Calculated checksum: 0x37 Setting checksum. + + +$PnP header at: 0x9C80 +Current checksum: 0x0F +Calculated checksum: 0x0F + + +Bios checksum at: 0xFFFF +Current checksum: 0x28 +Calculated checksum: 0x05 Setting checksum. + + +
+
Possible enhancements + +Although biossums takes care of all checksums being used by +the BIOS of the Bochs project (as of version 2.02) there are more to cover, e.g. +the checksums for "Plug and Play" BIOS extension. + + +In addition it was planned to provide further information to biossums +via map-/symbol-files to verify the locations of checksums apart from scanning for +signatures. For now this seems not to be necessary; in practice no double +signatures have been observed yet. + +
+
+
+ +
+ +Advanced debugger usage +
I/O Interface to Bochs Debugger + +This device was added by Dave Poirier (eks@void-core.2y.net). + + +Compiling Bochs with iodebug support + +./configure --enable-iodebug +make + +Other optional fields may be added to the ./configure line, see Bochs +documentation for all the information. To enable the iodebug plugin at runtime, +it must be loaded with the 'plugin_ctrl' bochsrc option. + + + + +Using the I/O Interface to the debugger + +port range: 0x8A00 - 0x8A01 + +Port 0x8A00 servers as command register. You can use it to enable the i/o interface, +change which data register is active, etc. + +Port 0x8A01 is used as data register for the memory monitoring. + + +
Commands supported by port 0x8A00 + + + +0x8A00 + + Used to enable the device. Any I/O to the debug module before this command is sent + is sent will simply be ignored. + + +0x8A01 + + Selects register 0: Memory monitoring range start address (inclusive) + + +0x8A02 + + Selects register 1: Memory monitoring range end address (exclusive) + + +0x8A80 + + Enable address range memory monitoring as indicated by register 0 and 1 and + clears both registers + + +0x8AE0 - Return to Debugger Prompt + + If the debugger is enabled (via --enable-debugger), sending 0x8AE0 to port 0x8A00 + after the device has been enabled will return the Bochs to the debugger prompt. + Basically the same as doing CTRL+C. + + +0x8AE2 - Instruction Trace Disable + + If the debugger is enabled (via --enable-debugger), sending 0x8AE2 to port 0x8A00 + after the device has been enabled will disable instruction tracing + + +0x8AE3 - Instruction Trace Enable + + If the debugger is enabled (via --enable-debugger), sending 0x8AE3 to port 0x8A00 + after the device has been enabled will enable instruction tracing + + +0x8AE4 - Register Trace Disable + + If the debugger is enabled (via --enable-debugger), sending 0x8AE4 to port 0x8A00 + after the device has been enabled will disable register tracing. + + +0x8AE5 - Register Trace Enable + + If the debugger is enabled (via --enable-debugger), sending 0x8AE5 to port 0x8A00 + after the device has been enabled will enable register tracing. This currently + output the value of all the registers for each instruction traced. + Note: instruction tracing must be enabled to view the register tracing + + +0x8AFF + + Disable the I/O interface to the debugger and the memory monitoring functions. + +all accesses must be done using word +reading this register will return 0x8A00 if currently activated, otherwise 0 + +
+
Access to port 0x8A01 (write-only) + +All accesses to this port must be done using words. Writing to this port will shift +to the left by 16 the current value of the register and add the provided value to it. + +Sample: + +reg0 = 0x01234567 + +out port: 0x8A01 data: 0xABCD + +reg0 = 0x4567ABCD + + +
+
Sample + +Enable memory monitoring on first page of text screen (0xb8000-0xb8fa0): +add in bochrc file: optromimage1: file="asmio.rom", address=0xd0000 + +/* + * Make asmio ROM file: + * gcc -c asmio.S + * objcopy -O binary asmio.o asmio.rom + */ + .text + .global start + .code16 + +/* ROM Header */ + .byte 0x55 + .byte 0xAA + .byte 1 /* 512 bytes long */ + +start: +/* Monitor memory access on first page of text screen */ + mov $0x8A00,%dx /* Enable iodebug (0x8A00->0x8A00) */ + mov %dx,%ax + out %ax,%dx + mov $0x8A01,%ax /* Select register 0 start addr (0x8A01->0x8A00) */ + out %ax,%dx + mov $0x8A01,%dx /* Write start addr 0xB8000 (high word first) */ + mov $0xB,%ax + out %ax,%dx + mov $0x8000,%ax /* Write start addr (low word) */ + out %ax,%dx + + mov $0x8A02,%ax /* Select register 1 end addr (0x8A02->0x8A00) */ + mov $0x8A00,%dx + out %ax,%dx + mov $0x8A01,%dx /* Write end addr 0xB8FA0 (high word first) */ + mov $0xB,%ax + out %ax,%dx + mov $0x8FA0,%ax /* Write end addr (low word) */ + out %ax,%dx + + mov $0x8A00,%dx /* Enable addr range memory monitoring (0x8A80->0x8A00) */ + mov $0x8A80,%ax + out %ax,%dx + + mov $0x8A00,%dx /* Return to Bochs Debugger Prompt (0x8AE0->0x8A00) */ + mov $0x8AE0,%ax + out %ax,%dx + lret + + .byte 0x6b /* Checksum (code dependent!, update it as needed) */ + .align 512 /* NOP follow */ + + +
+
+
The instrumentation feature + +&FIXME; Not written yet. + +
+
Bochs debugger internals + +&FIXME; Not written yet (take stuff from bxdebugger.html). + +
+
+ +Coding +
Coding guidelines + + +Don't make use of any external C++ classes. +They are not offered on all platforms and this would make Bochs non-portable. +There is use of such classes in the optional debugger. I plan on removing this use. + +Don't use fancy C++ features. +Bochs is incredibly performance sensitive, and will be increasingly so as +more speed enhancements are added. There's a time and place for most everything +and this is not it. Some advanced features create overhead in the generated code +that you don't see. They also convolute the code, and sometimes occlude that is +really going on. + +Don't use templates +Don't use virtual functions if not strictly required +Don't use C++ exceptions + +Use soft tabs. +At least when you submit code, convert all hard tabs to spaces. +There is no uniform way to handle tabs properly. +Please do compile with all warnings turned on. +It's really difficult to spot interesting warnings when a compile is littered +with non-interesting ones. +Don't use signed ints where unsigned will do. +Make sure that contributed code / patches are LGPL compatible. + + +
+
Building a Bochs release +
Preparing source files and SVN + +Update version number and strings in configure.in. + +VERSION="2.6.9" +VER_MAJOR=2 +VER_MINOR=6 +VER_REVISION=9 +VER_SVN=0 +REL_STRING="Build from SVN snapshot on April 9, 2017" + +In the README file you have to update version number and date. Add some +information about new features if necessary. + +Bochs x86 Pentium+ Emulator +Updated: Sun Apr 9 08:45:00 CEST 2017 +Version: 2.6.9 + +In the file bochs.manifest you have to update the version +number for the Windows build. + + version="2.6.9.0" + +Check date, update/sumup info in CHANGES. Run autoconf to regenerate configure and check them in. +Create an SVN tag that contains all files of the revision that was used in the release. +For prereleases I create a normal SVN tag like this: + + svn mkdir tags/REL_2_5_pre1_FINAL + svn copy trunk/bochs tags/REL_2_5_pre1_FINAL/bochs + svn commit + +But for a real release, I make an SVN branch tag AND a normal tag. + + svn mkdir tags/REL_2_5_FINAL + svn copy trunk/bochs tags/REL_2_5_FINAL/bochs + svn mkdir branches/REL_2_5 + svn copy trunk/bochs branches/REL_2_5/bochs + svn commit + +The tag marks where the branch split off of the main trunk. +This is very useful in maintaining the branch since you can do diffs +against it. + + svn diff tags/REL_2_5_FINAL/bochs trunk/bochs + svn diff tags/REL_2_5_FINAL/bochs branches/REL_2_5 + etc. + +All bugfix-only releases after the final release should be created from the REL_2_5 branch. +Now you can start building packages with the sources from the created release tag. + +
+ +
Anonymous SVN checkout and platform-independent sources + +An anonymous SVN checkout from the release tag is the base for all official +release packages. Do this checkout from the release tag and specify a not yet +existing directory name with the version number as the destination. Then create +the source package from this new directory. These steps can be done both on +Linux and Windows (Cygwin). + + svn co http://svn.code.sf.net/p/bochs/code/tags/REL_2_5_FINAL/bochs bochs-2.5 + tar czvf bochs-2.5.tar.gz --exclude=.svn bochs-2.5 + +The source TAR file bochs-2.5.tar.gz is ready for upload. + +
+ +
Building the release on Linux + +The RPM will be building using the configuration in .conf.linux with +a few parameters from build/redhat/make-rpm. Make any last +minute changes to .conf.linux. Any changes will go into the source RPM. The +DLX Linux demo package will be downloaded from the Bochs website to the Bochs +root directory if it is not already present there. + + ./build/redhat/make-rpm | tee ../build.txt + +This produces two rpm files in the current directory. Test and upload. + +
+ +
Building the release on win32 + +These instructions require cygwin and MSVC++. Use the Bochs sources from +the SVN checkout or unpack the TAR file. + + +In Cygwin: + + sh .conf.win32-vcpp # runs configure + make win32_snap # unzip workspace, make a win32 source ZIP + +The source ZIP is present in the parent directory of the Bochs root and now +ready for upload. To build the binary package, copy it to a Windows machine, +if necessary. + + +Open up Visual C++ and load the workspace file Bochs.sln. Check +the Build:Set Active Project Configuration is set the way you want it. +For releases I use "Win32 Release". + + +To create "bochsdbg.exe" with Bochs debugger support, manually change these +lines in config.h to turn on the debugger and the enhanced debugger gui. + +#define BX_DEBUGGER 1 +#define BX_DISASM 1 +#define BX_DEBUGGER_GUI 1 + +One of the optimization features must be turned off, since it is currently +not compatible with the debugger. + +#define BX_SUPPORT_HANDLERS_CHAINING_SPEEDUPS 0 + +VC++ will rebuild Bochs with debugger and overwrite bochs.exe. To avoid +trashing the non-debug version, move it out of the way while the debugger +version is being built. Then rename the debugger version to bochsdbg.exe. + + cd obj-release + mv bochs.exe bochs-normal.exe + (build again with BX_DEBUGGER=1 this time) + mv bochs.exe bochsdbg.exe + mv bochs-normal.exe bochs.exe + + + +Do make install_win32 into the NSIS folder in the Bochs +source tree: + + make install_win32 INSTDIR=./build/win32/nsis/bochs-2.5 + +This downloads and unpacks both the DLX Linux demo and the HTML docs from the +Bochs website, copies all the files into ./build/win32/nsis/bochs-2.5 +and then creates a binary ZIP file in the NSIS folder. + + +Now make the NSIS installer package (the current script is known to work with NSIS 3.04) + + cd build/win32/nsis + make + +That gives an installer called Bochs-2.5.exe. Test and upload it. + +
+ +
Creating a file release and uploading files on SF + +When you are ready with creating release packages you have to upload them using +the SF file manager feature. Create a subdirectory with the version number in +the bochs directory. Point the download destination to the +new directory and start uploading packages. The top of the CHANGES +file should be used as the release notes. After setting up the file properties the +new release is ready for download. + + +After having all files set up in the download area, don't forget to post an announcement +containing a brief summary of changes to the bochs-announce mailing list and the "Project +News" section on SF. + +
+ +
+ +
+ +Webmastering + +
Bochs project webspace + +The Bochs project webspace is stored under the SF directory /home/project-web/bochs. +It can be accessed from the SF shell using SSH or with the commands sftp, +scp and rsync. Some parts of the directory +structure must be updated from the local CVS repository, others from Bochs SVN +(directories bochs and sfsite). +The online documentation, disk images and screenshots must be uploaded manually. + +Directory structure + + + +Location +Meaning + + + +cgi-binCGI scripts for the website +htdocsroot directory of the website +htdocs/doc/docbookBochs online documentation +htdocs/docs-htmlold Bochs documentation +htdocs/guestosdisk images directly stored on the Bochs website +htdocs/screenshotscreenshots of Bochs running several guest operating systems +htdocs/svn-snapshotlink to current snapshot +htdocs/techspectechnical specifications of several hardware components +lxrBochs source browser +sfsite-cvsrootlocal CVS repository +sitebinshell scripts (e.g. for snapshot generation) +sitemanwebsite manual pages +snapshotSVN snapshot storage area +tmptemp directory for shell scripts + + +
+
+
+ +
Updating the Bochs website content + +The main HTML content of the Bochs website (except online documentation) is stored +in the sfsite directory of the Bochs SVN repository. Unlike +other SF projects you don't need to upload these files to the Bochs project webspace. +Running a simple SVN update on the SF shell is enough after the files have been +updated in the repository. Please see Setting +up SVN write access for general instructions. The only difference is the +directory name sfsite instead of bochs. +The example below shows how to start the SF shell with SSH and to update the +HTML files. + +ssh -t vruppert,bochs@shell.sourceforge.net create +vruppert,bochs@shell.sourceforge.net's password: + +Requesting a new shell for "vruppert" and waiting for it to start. +queued... starting... + +This is an interactive shell created for user vruppert,bochs. +Use the "timeleft" command to see how much time remains before shutdown. +Use the "shutdown" command to destroy the shell before the time limit. +For path information and login help, type "sf-help". + +[vruppert@shell-24002 ~]$ svnserve -d -r /home/svn/p/bochs/code +[vruppert@shell-24002 ~]$ cd /home/project-web/bochs/htdocs/ +[vruppert@shell-24002 htdocs]$ svn update +U index.html +Updated to revision 10752 +[vruppert@shell-24002 htdocs]$ shutdown +Requesting that your shell be shut down. +This request will be processed soon. +[vruppert@shell-24002 htdocs]$ +Broadcast message from root (Mon Oct 31 09:45:04 2011): + +The system is going down for system halt NOW! +Connection to shell-24002 closed by remote host. +Connection to shell-24002 closed. +Connection to shell.sourceforge.net closed. + + +
+ +
Updating the SVN snapshot + +The SVN snapshot + +The SVN snapshot link can be found on the bottom of the page +getcurrent.html. + +can be updated with SF shell access using SSH. There is a script +called update-svn-snapshot.sh that can do all the required steps +(checking out SVN, packing the source tree into one archive, updating the website +link). See previous section how to create a shell. + +cd /home/project-web/bochs/sitebin/ +./update-svn-snapshot.sh + + +
+ +
Updating the online documentation + +To update the online documentation, a file called bochsdoc.tar.gz +must be generated with the make. This file must be uploaded +to the location of the online documentation on SF using scp. + +cd doc/docbook +make bochsdoc.tar.gz +scp bochsdoc.tar.gz vruppert,bochs@web.sf.net:htdocs/doc/docbook + +After a successful upload, the HTML files must be unpacked from the SF shell. +See section Updating the Bochs website content +how to create a shell. + +cd /home/project-web/bochs/htdocs/doc/docbook +tar xvzf bochsdoc.tar.gz + +The updated files can be accessed from the sidebar of the Bochs website. + +
+ +
other content + + &FIXME; sources, tmp + +
+ +
available tools + + &FIXME; sources, tmp + +
+ +
+
diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/directory-structure.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/directory-structure.html new file mode 100644 index 0000000..e450b14 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/directory-structure.html @@ -0,0 +1,302 @@ + +Directory Structure
Bochs Developers Guide
PrevChapter 2. About the codeNext

2.2. Directory Structure

Table 2-1. Directory structure

LocationMeaning
biosSystem and VGA BIOS images, system BIOS sources and makefile
buildadditional stuff required for building Bochs on different platforms
bx_debugthe builtin Bochs debugger
cputhe cpu emulation sources
disasmthe disassembler for the Bochs debugger
doc/docbookthe Bochs documentation in DocBook format
doc/manBochs manual pages
docs-htmlold Bochs documentation in HTML (will be replaced by DocBook)
dynamicempty directory (reserved for dynamic translation code)
fontthe default VGA font used by most of the display libraries
fputhe fpu emulation sources
guidisplay libraries (guis), the simulator interface and text mode config interface
gui/bitmapsbitmaps for the headerbar
gui/keymapskeymaps for the keyboard mapping feature
hosthost specific drivers (currently only used by the pcidev kernel module for Linux)
instrumentdirectory tree for the instrumentation feature
iodevstandard PC devices, PCI devices, lowlevel networking and sound drivers
memorymemory management and ROM loader
miscuseful utilities (e.g. bximage, bxcommit, niclist)
misc/sb16tool to control the SB16 emulation from the guest side
patchespending patches
plex86plex86 directory structure (possibly outdated)


PrevHomeNext
About the codeUpEmulator Objects
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/emulator-objects.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/emulator-objects.html new file mode 100644 index 0000000..319b61a --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/emulator-objects.html @@ -0,0 +1,498 @@ + +Emulator Objects
Bochs Developers Guide
PrevChapter 2. About the codeNext

2.3. Emulator Objects

2.3.1. Weird macros and other mysteries

Bochs has many macros with inscrutable names. One might even go as far as to +say that Bochs is macro infested. +Some of them are gross speed hacks, to cover up the slow speed that C++ causes. +Others paper over differences between the simulated PC configurations. +Many of the macros exhibit the same problem as C++ does: too much stuff happens +behind the programmer's back. More explicitness would be a big win.

2.3.2. Static methods hack

C++ methods have an invisible parameter called the this pointer - otherwise the +method wouldn't know which object to operate on. In many cases in Bochs, there +will only ever be one object - so this flexibility is unnecessary. There is a +hack that can be enabled by #defining BX_USE_CPU_SMF to 1 in config.h that makes most methods static, which means they have a "special +relationship" with the class they are declared in but apart from that are +normal C functions with no hidden parameters. Of course they still need access +to the internals of an object, so the single object of their class has a globally +visible name that these functions use. It is all hidden with macros.

Declaration of a class, from iodev/pic.h:

...
+#if BX_USE_PIC_SMF
+#  define BX_PIC_SMF  static
+#  define BX_PIC_THIS thePic->
+#else
+#  define BX_PIC_SMF
+#  define BX_PIC_THIS this->
+#endif
+...
+class bx_pic_c : public bx_pic_stub_c {
+
+public:
+  bx_pic_c(void);
+  ~bx_pic_c(void);
+...
+  BX_PIC_SMF void   service_master_pic(void);
+  BX_PIC_SMF void   service_slave_pic(void);
+  BX_PIC_SMF void   clear_highest_interrupt(bx_pic_t *pic);
+  };

And iodev/pic.cc:

...
+#define LOG_THIS thePic->
+...
+bx_pic_c *thePic = NULL;
+...
+  void
+bx_pic_c::service_master_pic(void)
+{
+  Bit8u unmasked_requests;
+  int irq;
+  Bit8u isr, max_irq;
+  Bit8u highest_priority = BX_PIC_THIS s.master_pic.lowest_priority + 1;
+  if(highest_priority > 7)
+    highest_priority = 0;
+
+  if (BX_PIC_THIS s.master_pic.INT) { /* last interrupt still not acknowleged */
+    return;
+    }
+
+  if (BX_PIC_THIS s.master_pic.special_mask) {
+    /* all priorities may be enabled.  check all IRR bits except ones
+     * which have corresponding ISR bits set
+     */
+    max_irq = highest_priority;
+    }
+  else { /* normal mode */
+    /* Find the highest priority IRQ that is enabled due to current ISR */
+    isr = BX_PIC_THIS s.master_pic.isr;
+...
+}
+...

Ugly, isn't it? If we use static methods, methods prefixed with BX_PIC_SMF are +declared static and references to fields inside the object, which are prefixed +with BX_PIC_THIS, will use the globally visible object, thePic->. If we don't +use static methods, BX_PIC_SMF evaluates to nothing and BX_PIC_THIS becomes this->. +Making it evaluate to nothing would be a lot cleaner, but then the scoping rules +would change slightly between the two Bochs configurations, which would be a load +of bugs just waiting to happen. Some classes use BX_SMF, others have their own +version of the macro, like BX_PIC_SMF above.

2.3.3. CPU und memory objects in UP/SMP configurations

The CPU class is a special case of the above: if Bochs is simulating a uni- +processor machine then there is obviously only one bx_cpu_c object and the +static methods trick can be used. If, on the other hand, Bochs is simulating an +smp machine then we can't use the trick. The same seems to be true for memory: +for some reason, we have a memory object for each CPU object. This might become +relevant for NUMA machines, but they are not all that common -- and even the +existing IA-32 NUMA machines bend over backwards to hide that fact: it should +only be visible in slightly worse timing for non-local memory and non-local +peripherals. Other than that, the memory map and device map presented to each +CPU will be identical.

In a UP configuration, the CPU object is declared as bx_cpu. In an SMP +configuration it will be an array of pointers to CPU objects (bx_cpu_array[]). +For memory that would be bx_mem and bx_mem_array[], respectively. +Each CPU object contains a pointer to its associated memory object. +Access of a CPU object often goes through the BX_CPU(x) macro, which either +ignores the parameter and evaluates to &bx_cpu, or evaluates to bx_cpu_array +[n], so the result will always be a pointer. The same goes for BX_MEM(x). +If static methods are used then BX_CPU_THIS_PTR evaluates to BX_CPU(0)->. Ugly, +isn't it?

2.3.4. The configuration parameter tree

Starting with version 1.3, the Bochs configuration parameters are stored in parameter +objects. These objects have get/set methods with min/max checks and it is possible +to define parameter handlers to perform side effects and to override settings. +Each parameter type has it's own object type with specific features (numeric, +boolean, enum, string and file name). A special object type containing a list of +parameters is designed for building and managing configuration menus or dialogs +automatically. In the original implementation the parameters could be accessed +only with their unique id from a static list or a special structure containing +pointers to all parameters.

Starting with version 2.3, the Bochs parameter object handling has been rewritten +to a parameter tree. There is now a root list containing child lists, and these +lists can contain lists or parameters and so on. The parameters are now accessed +by a name build from all the list names in the path and finally the parameter +name separated by periods. +
Bit32u megs = SIM->get_param_num("memory.standard.ram.size")->get();

The example above shows how to get the memory size in megabytes from the simulator +interface. In the root list (".") there is child list named "memory" containing +a child list "standard". It's child list "ram" contains the numeric parameter type +"size". The SIM->get_param_num() methods returns the object pointer and the get() +method returns the parameter value.

The table below shows all parameter types used by the Bochs configuration interface. +

Table 2-2. Parameter types

TypeDescription
bx_object_cBase class for all the other parameter types. It contains the unique parameter id and the object type value.
bx_param_cGeneric parameter class. It contains the name, label, description and the input/output formats.
bx_param_num_cNumerical (decimal/hex) config settings are stored in this parameter type.
bx_param_bool_cThis parameter type is based on bx_param_num_c, but it is designed for boolean values. A dependency +list can be defined to enable/disable other parameters depending on the value change.
bx_param_enum_cBased on bx_param_num_c this parameter type contains a list of valid values.
bx_param_string_cConfiguration strings are stored in this type of parameter.
bx_param_filename_cBased on bx_param_string_c this parameter type is used for file names.
bx_list_cContains a list of pointers to parameters (bx_param_*_c and bx_list_c). +In the config interface it is used for menus/dialogs.

2.3.5. The save/restore feature

The save/restore feature is based on an extension to the parameter tree concept. +A subtree (list) called "bochs" appears in the root of the parameter tree +and some new "shadow" parameter types store pointers to values instead of the values +itself. All the hardware objects have register_state() methods to register pointers +to the device registers and switches that need to be saved. The simulator interface +saves the registered data in text format to the specified folder (usually one file +per item in the save/restore list). Large binary arrays are registered with a +special parameter type, so they are saved as separate files.

The table below shows the additional parameter types for save/restore. +

Table 2-3. Save/restore parameter types

TypeDescription
bx_shadow_num_cBased on bx_param_num_c this type stores a pointer to a numerical variable.
bx_shadow_bool_cThis parameter type stores a pointer to a boolean variable.
bx_shadow_data_cThis special parameter type stores pointer size of a binary array.
+It is also possible to use the bx_param_num_c object with parameter save/restore +handlers. With this special way several device settings can be save to and restored +from one single parameter.

All devices can uses these two save/restore specific methods: +

  • register_state() is called after the device init() to register the device members for save/restore

  • after_restore_state() is an optional method to do things directly after restore


PrevHomeNext
Directory StructureUpConfigure Scripting
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/harddisk-redologs.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/harddisk-redologs.html new file mode 100644 index 0000000..af38a03 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/harddisk-redologs.html @@ -0,0 +1,1660 @@ + +Harddisk Images based on redologs
Bochs Developers Guide
PrevChapter 2. About the codeNext

2.9. Harddisk Images based on redologs

This section describes how the three new disk images "undoable", "growing", and "volatile" are +implemented in Bochs 2.1 :

  • undoable -> flat file, plus growing, commitable, rollbackable redolog file

  • growing -> growing files, all previously unwritten sectors go to the end of file

  • volatile -> flat file, plus hidden growing redolog

2.9.1. Description

The idea behind volatile and undoable disk images +is to have a flat file, associated with one redolog file.

Reading a sector is done from the redolog file if it contains +the sector, or from the flat file otherwise.

Sectors written go to the redolog, +so flat files are opened in read only mode in this configuration.

The redolog is designed in a way so it starts as a small file +and grows with every new sectors written to it. Previously written +sectors are done in place. Redolog files can not shrink.

The redolog is a growing file that can be created on the fly.

Now, it turns out that if you only use a redolog without any +flat file, you get a "growing" disk image.

So "undoable", "volatile" and "growing" harddisk images classes +are implemented on top of a redolog class.

2.9.2. How redologs works ?

At the start of a redolog file, there is a header, so Bochs can check whether +a file is consistent. +This header could also be checked when we implement +automatic type and size detection.

The generic part of the header contains values like type of image, and +spec version number.

The header also has a specific part. +For redologs, the number +of entries of the catalog, the extent, bitmap and disk size are stored.

In a redolog, the disk image is divided in a number of equal size "extents". +Each extent is a collection of successive 512-bytes sectors of the disk image, +preceeded by a n*512bytes bitmap.

the n*512bytes bitmap defines the presence (data has been written to it) +of a specific sector in the extent, one bit for each sector. +Therefore with a 512bytes bitmap, each extent can hold up to 4k blocks

Typically the catalog can have 256k entries. +With a 256k entries catalog and 512bytes bitmaps, the redolog can hold up to 512GiB

Note: All data is stored on images as little-endian values

2.9.2.1. Header

At the start of a redolog file, there is a header. This header is designed +to be reusable by other disk image types.

The header length is 512 bytes. It contains : +

Table 2-7. Generic header description

Start position in bytesLength in bytesData typeDescriptionPossible values
0 32 string magical value Bochs Virtual HD Image
32 16 string type of file Redolog
48 16 string subtype of file Undoable, Volatile, Growing
64 4 Bit32u version of used specification 0x00010000
68 4 Bit32u header size 512
+

Table 2-8. Redolog specific header description

Start position in bytesLength in bytesData typeDescription 
72 4 Bit32u number of entries in the catalog  
76 4 Bit32u bitmap size in bytes  
80 4 Bit32u extent size in bytes 
84 8 Bit64u disk size in bytes  

2.9.2.2. Catalog

Immediately following the header, there is a catalog containing +the position number (in extents) where each extent is located in the file.

Each position is a Bit32u entity.

2.9.3. Parameters

The following tables shows what parameters are used when creating redologs or creating "growing" images : +

Table 2-9. How number of entries in the catalog and number of blocks by extents are computed

Catalog entriesCatalog size(KiB)Bitmap size (B)Extent size (KiB)Disk Max Size
5122142MiB
5122284MiB
1k4288MiB
1k441616MiB
2k841632MiB
2k883264MiB
4k16832128MiB
4k161664256MiB
8k321664512MiB
8k32321281GiB
16k64321282GiB
16k64642564GiB
32k128642568GiB
32k12812851216GiB
64k25612851232GiB
64k256256102464GiB
128k5122561024128GiB
128k5125122048256GiB
256k10245122048512GiB
256k1024102440961TiB
512k2048102440962TiB
512k2048204881924TiB
1024k4096204881928TiB
1024k409640961638416TiB
2048k819240961638432TiB

2.9.4. Redolog class description

The class redolog_t(); implements the necessary +methods to create, open, close, read and write data to a redolog. +Managment of header catalog and sector bitmaps is done internally +by the class.

2.9.4.1. Constants

#define STANDARD_HEADER_MAGIC     "Bochs Virtual HD Image"
+#define STANDARD_HEADER_VERSION   (0x00010000)
+#define STANDARD_HEADER_SIZE      (512)
+These constants are used in the generic part of the header.

#define REDOLOG_TYPE "Redolog"
+#define REDOLOG_SUBTYPE_UNDOABLE "Undoable"
+#define REDOLOG_SUBTYPE_VOLATILE "Volatile"
+#define REDOLOG_SUBTYPE_GROWING  "Growing"
+These constants are used in the specific part of the header.

#define REDOLOG_PAGE_NOT_ALLOCATED (0xffffffff)
+This constant is used in the catalog for an unwritten extent.

2.9.4.2. Methods

redolog_t(); instanciates a new redolog.

int make_header (const char* type, Bit64u size); creates a header +structure in memory, and sets its type and parameters based on the +disk image size. Returns 0.

int create (const char* filename, const char* type, Bit64u size); +creates a new empty redolog file, with header and catalog, named filename +of type type for a size bytes image. +Returns 0 for OK or -1 if a problem occured.

int create (int filedes, const char* type, Bit64u size); +creates a new empty redolog file, with header and catalog, in a previously +opened file described by filedes, of type type +for a size bytes image. +Returns 0 for OK or -1 if a problem occured.

int open (const char* filename, const char* type, Bit64u size); +opens a redolog file named filename, and checks +for consistency of header values against a type and +size. +Returns 0 for OK or -1 if a problem occured.

void close (); +closes a redolog file.

off_t lseek (off_t offset, int whence); +seeks at logical data offset offset in a redolog. +offset must be a multiple of 512. +Only SEEK_SET is supported for whence. +Returns -1 if a problem occured, or the current logical offset in +the redolog.

ssize_t read (void* buf, size_t count); +reads count bytes of data of the redolog, from current logical offset, +and copies it into buf. +count must be 512. +Returns the number of bytes read, that can be 0 if the data +has not previously be written to the redolog.

ssize_t write (const void* buf, size_t count); +writes count bytes of data from buf +to the redolog, at current logical offset. +count must be 512. +Returns the number of bytes written.

2.9.5. Disk image classes description

"volatile" and "undoable" disk images are easily implemented +by instanciating a default_image_t object (flat image) +and a redolog_t object (redolog).

"growing" disk images only instanciates a redolog_t object.

Classe names are undoable_image_t, volatile_image_t +and growing_image_t.

When using these disk images, the underlying data structure and layout +is completely +hidden to the caller. Then, all offset and size values are "logical" values, +as if the disk was a flat file.

2.9.5.1. Constants

#define UNDOABLE_REDOLOG_EXTENSION ".redolog"
+#define UNDOABLE_REDOLOG_EXTENSION_LENGTH (strlen(UNDOABLE_REDOLOG_EXTENSION))
+#define VOLATILE_REDOLOG_EXTENSION ".XXXXXX"
+#define VOLATILE_REDOLOG_EXTENSION_LENGTH (strlen(VOLATILE_REDOLOG_EXTENSION))
+These constants are used when building redolog file names

2.9.5.2. undoable_image_t methods

undoable_image_t(Bit64u size, const char* redolog_name); +instanciates a new undoable_image_t +object. This disk image logical length is size bytes and +the redolog filename is redolog_name.

int open (const char* pathname); +opens the flat disk image pathname, +as an undoable disk image. The associated redolog will +be named pathname with a +UNDOABLE_REDOLOG_EXTENSION +suffix, unless set in the constructor. +Returns 0 for OK or -1 if a problem occured.

void close (); +closes the flat image and its redolog.

off_t lseek (off_t offset, int whence); +seeks at logical data position offset in +the undoable disk image. +Only SEEK_SET is supported for whence. +Returns -1 if a problem occured, or the current logical +offset in the undoable disk image.

ssize_t read (void* buf, size_t count); +reads count bytes of data +from the undoable disk image, from current logical offset, +and copies it into buf. +count must be 512. +Returns the number of bytes read. +Data will be read from the redolog if it has +been previously written or from the flat image +otherwise.

ssize_t write (const void* buf, size_t count); +writes count bytes of data from buf +to the undoable disk image, at current logical offset. +count must be 512. +Returns the number of bytes written. +Data will always be written to the redolog.

2.9.5.3. volatile_image_t methods

volatile_image_t(Bit64u size, const char* redolog_name); +instanciates a new volatile_image_t +object. This disk image logical length is size bytes and +the redolog filename is redolog_name plus a +random suffix.

int open (const char* pathname); +opens the flat disk image pathname, +as a volatile disk image. The associated redolog will +be named pathname with a +random suffix, unless set in the constructor. +Returns 0 for OK or -1 if a problem occured.

void close (); +closes the flat image and its redolog. +The redolog is deleted/lost after close is called.

off_t lseek (off_t offset, int whence); +seeks at logical data position offset in +the volatile disk image. +Only SEEK_SET is supported for whence. +Returns -1 if a problem occured, or the current logical offset in +the volatile disk image.

ssize_t read (void* buf, size_t count); +reads count bytes of data +from the volatile disk image, from current logical offset, +and copies it into buf. +count must be 512. +Returns the number of bytes read. +Data will be read from the redolog if it has +been previously written or from the flat image +otherwise.

ssize_t write (const void* buf, size_t count); +writes count bytes of data from buf +to the volatile disk image, at current logical offset. +count must be 512. +Returns the number of bytes written. +Data will always be written to the redolog.

2.9.5.4. growing_image_t methods

growing_image_t(Bit64u size); +instanciates a new growing_image_t +object. This disk image logical length is size bytes.

int open (const char* pathname); +opens the growing disk image pathname, +Returns 0 for OK or -1 if a problem occured.

void close (); +closes the growing disk image.

off_t lseek (off_t offset, int whence); +seeks at logical data position offset in +the growable disk image. +Only SEEK_SET is supported for whence. +Returns -1 if a problem occured, or the current logical offset in +the grwoing image.

ssize_t read (void* buf, size_t count); +reads count bytes of data +from the growing disk image, from current logical offset, +and copies it into buf. +count must be 512. +Returns the number of bytes read. +The buffer will be filled with null bytes if data +has not been previously written to the growing image.

ssize_t write (const void* buf, size_t count); +writes count bytes of data from buf +to the growing disk image, at current logical offset. +count must be 512. +Returns the number of bytes written.


PrevHomeNext
Sound Blaster 16 EmulationUpHow to add keymapping in a GUI client
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/index.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/index.html new file mode 100644 index 0000000..4c32727 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/index.html @@ -0,0 +1,612 @@ + +Bochs Developers Guide

Bochs Developers Guide

Kevin Lawton

Bryce Denney

Christophe Bothamy

Edited by

Michael Calabrese


Table of Contents
1. Resources for developers
1.1. Setting up CVS write access
1.1.1. Install ssh and cvs
1.1.2. ssh to cvs.sf.net
1.1.3. Set CVS_RSH environment variable to ssh
1.1.4. cvs checkout
1.2. Using CVS write access
1.2.1. Checking in files
1.3. SourceForge bug, feature, and patch trackers
1.4. Ideas for other sections
2. About the code
2.1. Overview
2.2. Directory Structure
2.3. Emulator Objects
2.3.1. Weird macros and other mysteries
2.3.2. Static methods hack
2.3.3. CPU und memory objects in UP/SMP configurations
2.3.4. The configuration parameter tree
2.3.5. The save/restore feature
2.4. Configure Scripting
2.5. Log Functions
2.6. timers
2.7. Bochs's CMOS map
2.8. Sound Blaster 16 Emulation
2.8.1. How well does it work?
2.8.2. Output to a sound card
2.8.3. Installation on Linux
2.8.4. Configuring Bochs
2.8.5. Runtime configuration
2.8.6. Features planned for the future
2.8.7. Description of the sound output classes
2.8.8. Files
2.8.9. Classes
2.8.10. Methods
2.8.11. bx_sound_OS_c(bx_sb16_c*sb16)
2.8.12. ~bx_sound_OS_c()
2.8.13. int openmidioutput(char *device)
2.8.14. Description of the parameters:
2.8.15. int midiready()
2.8.16. int sendmidicommand(int delta, int command, int length, Bit8u data[])
2.8.17. int closemidioutput()
2.8.18. int openwaveoutput(char *device)
2.8.19. int startwaveplayback(int frequency, int bits, int stereo, int format)
2.8.20. int waveready()
2.8.21. int sendwavepacket(int length, Bit8u data[])
2.8.22. int stopwaveplayback()
2.8.23. int closewaveoutput()
2.9. Harddisk Images based on redologs
2.9.1. Description
2.9.2. How redologs works ?
2.9.3. Parameters
2.9.4. Redolog class description
2.9.5. Disk image classes description
2.10. How to add keymapping in a GUI client
3. Debugger
3.1. compile with debugger support
3.2. get started in debugger
3.3. command reference
3.4. techniques
3.5. I/O Interface to Bochs Debugger
3.5.1. Commands supported by port 0x8A00
3.5.2. Access to port 0x8A01 (write-only)
3.5.3. Sample
4. Coding
4.1. Coding guidelines
4.2. patches:
4.3. Building a Bochs release
4.3.1. Preparing source files and CVS
4.3.2. Building the release on win32
4.3.3. Building the release on Linux
4.3.4. Uploading files and creating a file release on SF
5. Webmastering
5.1. websites
5.2. shell access to the website
5.3. website html repository
5.4. automatic site update
5.5. other content
5.6. available tools

  Next
  Resources for developers
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/instrumentation.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/instrumentation.html new file mode 100644 index 0000000..7dc81c6 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/instrumentation.html @@ -0,0 +1,147 @@ + +The instrumentation feature
Bochs Developers Guide
PrevChapter 3. Advanced debugger usageNext


PrevHomeNext
Advanced debugger usageUpBochs debugger internals
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/iodebug.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/iodebug.html new file mode 100644 index 0000000..3821c7c --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/iodebug.html @@ -0,0 +1,391 @@ + +I/O Interface to Bochs Debugger
Bochs Developers Guide
PrevChapter 3. DebuggerNext

3.5. I/O Interface to Bochs Debugger

This device was added by Dave Poirier (eks@void-core.2y.net).

Compiling Bochs with iodebug support +
./configure --enable-iodebug
+make
+Other optional fields may be added to the ./configure line, see Bochs documentation for all the information.

Using the I/O Interface to the debugger
+
+port range:  0x8A00 - 0x8A01
+
+Port 0x8A00 servers as command register. You can use it to enable the i/o interface,
+change which data register is active, etc.
+
+Port 0x8A01 is used as data register for the memory monitoring.

3.5.1. Commands supported by port 0x8A00


0x8A00
+
+ Used to enable the device. Any I/O to the debug module before this command is sent
+ is sent will simply be ignored.
+
+
+0x8A01
+
+ Selects register 0: Memory monitoring range start address (inclusive)
+
+
+0x8A02
+
+ Selects register 1: Memory monitoring range end address (exclusive)
+
+
+0x8A80
+
+ Enable address range memory monitoring as indicated by register 0 and 1 and
+ clears both registers
+
+
+0x8AE0 - Return to Debugger Prompt
+
+ If the debugger is enabled (via --enable-debugger), sending 0x8AE0 to port 0x8A00
+ after the device has been enabled will return the Bochs to the debugger prompt.
+ Basically the same as doing CTRL+C.
+
+
+0x8AE2 - Instruction Trace Disable
+
+ If the debugger is enabled (via --enable-debugger), sending 0x8AE2 to port 0x8A00
+ after the device has been enabled will disable instruction tracing
+
+
+0x8AE3 - Instruction Trace Enable
+
+ If the debugger is enabled (via --enable-debugger), sending 0x8AE3 to port 0x8A00
+ after the device has been enabled will enable instruction tracing
+
+
+0x8AE4 - Register Trace Disable
+
+ If the debugger is enabled (via --enable-debugger), sending 0x8AE4 to port 0x8A00
+ after the device has been enabled will disable register tracing.
+
+
+0x8AE5 - Register Trace Enable
+
+ If the debugger is enabled (via --enable-debugger), sending 0x8AE5 to port 0x8A00
+ after the device has been enabled will enable register tracing. This currently
+ output the value of all the registers for each instruction traced.
+ Note: instruction tracing must be enabled to view the register tracing
+
+
+0x8AFF
+
+ Disable the I/O interface to the debugger and the memory monitoring functions.
+

Note: all accesses must be done using word

+

Note: reading this register will return 0x8A00 if currently activated, otherwise 0

3.5.2. Access to port 0x8A01 (write-only)

All accesses to this port must be done using words. Writing to this port will shift +to the left by 16 the current value of the register and add the provided value to it. +
Sample:
+
+reg0 = 0x01234567
+
+out port: 0x8A01 data: 0xABCD
+
+reg0 = 0x4567ABCD

3.5.3. Sample

Enable memory monitoring on first page of text screen (0xb8000-0xb8fa0): +add in bochrc file: optromimage1: file="asmio.rom", address=0xd0000 +
/*
+ *      Make asmio ROM file:
+ *      gcc -c asmio.S
+ *      objcopy -O binary asmio.o asmio.rom
+ */
+        .text
+        .global start
+        .code16
+
+/* ROM Header */
+        .byte 0x55
+        .byte 0xAA
+        .byte 1                 /* 512 bytes long */
+
+start:
+/* Monitor memory access on first page of text screen */
+        mov     $0x8A00,%dx     /* Enable iodebug (0x8A00->0x8A00) */
+        mov     %dx,%ax
+        out     %ax,%dx
+        mov     $0x8A01,%ax     /* Select register 0 start addr (0x8A01->0x8A00) */
+        out     %ax,%dx
+        mov     $0x8A01,%dx     /* Write start addr 0xB8000 (high word first) */
+        mov     $0xB,%ax
+        out     %ax,%dx
+        mov     $0x8000,%ax     /* Write start addr (low word) */
+        out     %ax,%dx
+
+        mov     $0x8A02,%ax     /* Select register 1 end addr (0x8A02->0x8A00) */
+        mov     $0x8A00,%dx
+        out     %ax,%dx
+        mov     $0x8A01,%dx     /* Write end addr 0xB8FA0 (high word first) */
+        mov     $0xB,%ax
+        out     %ax,%dx
+        mov     $0x8FA0,%ax     /* Write end addr (low word) */
+        out     %ax,%dx
+
+        mov     $0x8A00,%dx     /* Enable addr range memory monitoring (0x8A80->0x8A00) */
+        mov     $0x8A80,%ax
+        out     %ax,%dx
+
+        mov     $0x8A00,%dx     /* Return to Bochs Debugger Prompt (0x8AE0->0x8A00) */
+        mov     $0x8AE0,%ax
+        out     %ax,%dx
+        lret
+
+        .byte 0x6b              /* Checksum (code dependent!, update it as needed) */
+        .align 512              /* NOP follow */


PrevHomeNext
techniquesUpCoding
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/logfunctions.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/logfunctions.html new file mode 100644 index 0000000..c2d6d2a --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/logfunctions.html @@ -0,0 +1,149 @@ + +Log Functions
Bochs Developers Guide
PrevChapter 2. About the codeNext

2.5. Log Functions

+ log functions: what is a panic, what is an error, etc. +


PrevHomeNext
Configure ScriptingUptimers
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/other-content.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/other-content.html new file mode 100644 index 0000000..aff2dd0 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/other-content.html @@ -0,0 +1,148 @@ + +other content
Bochs Developers Guide
PrevChapter 5. WebmasteringNext

5.5. other content

sources, tmp +


PrevHomeNext
automatic site updateUpavailable tools
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/other.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/other.html new file mode 100644 index 0000000..3d02e69 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/other.html @@ -0,0 +1,161 @@ + +Ideas for other sections
Bochs Developers Guide
PrevChapter 1. Resources for developersNext

1.4. Ideas for other sections

Ideas:
+- how to browse code with cvsweb
+- how to find an identifier, variable, or specific text in the code
+- how to make patches with CVS


PrevHomeNext
SourceForge bug, feature, and patch trackersUpAbout the code
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/patches.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/patches.html new file mode 100644 index 0000000..0bff8e7 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/patches.html @@ -0,0 +1,149 @@ + +patches:
Bochs Developers Guide
PrevChapter 4. CodingNext

4.2. patches:

+ how to make, where to submit, what happens then? +


PrevHomeNext
CodingUpBuilding a Bochs release
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/repository.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/repository.html new file mode 100644 index 0000000..dc77254 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/repository.html @@ -0,0 +1,148 @@ + +website html repository
Bochs Developers Guide
PrevChapter 5. WebmasteringNext


PrevHomeNext
shell access to the websiteUpautomatic site update
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/resources.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/resources.html new file mode 100644 index 0000000..0e1e221 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/resources.html @@ -0,0 +1,344 @@ + +Resources for developers
Bochs Developers Guide
PrevNext

Chapter 1. Resources for developers

The development guide describes resources that are intended for developers +in particular. Many Bochs resources are also covered in the User Guide, +including compile instructions, bochsrc options, how to find the mailing +lists, etc.

1.1. Setting up CVS write access

If you are an official SourceForge developer, then you can use CVS with write +access. The CVS contains the most recent copy of the source code, and with +write access you can upload any changes you make to the CVS server for others +to use. A few extra steps are required the first time you use CVS write +access.

1.1.1. Install ssh and cvs

First you need to install both cvs (Concurrent Version System) and ssh (Secure +Shell). These are already installed on many UNIX systems and also Cygwin +(win32 platform). If not, you can install binaries or compile cvs and ssh +yourself. The links below should help you get going.

  • CVS software and instructions are available at www.cvshome.org.

  • A free version of secure shell called OpenSSH is at www.openssh.org.

  • OpenSSH requires a library called OpenSSL from www.openssl.org. Be sure to install OpenSSL before trying to compile OpenSSH.

1.1.2. ssh to cvs.sf.net

Next, you need to use secure shell to connect to cvs.sf.net. This step is a +little strange, because you can't actually log in and get a shell prompt. All +that will happen, when you get the username and password right, is that it +will create a home directory on that machine for you. That's it! If you try +it again, it will say "This is a restricted Shell Account. You cannot execute +anything here." At this point, you've succeeded and you never have to do +this step again, ever. + +
  ssh sfusername@bochs.cvs.sf.net

Replace sfusername with your Source Forge username, +of course. The first time, you will probably get a message like +
The authenticity of host 'cvs.sf.net' can't be established.
+Are you sure you want to continue?
+ +Just type yes. When it asks for a password, be sure to type your source +forge password. If you have trouble logging in, be sure to use your SOURCE +FORGE username and password in the ssh line, which isn't necessarily the same +as your local username and password. Add the "-v" option to ssh to see more +information about what is failing. If you have ssh version 2, it is possible +that you might need to add "-1" to the ssh command to force it to use the +version 1 protocol.

1.1.3. Set CVS_RSH environment variable to ssh

Every time you connect to the Source Forge CVS server (including cvs update, +stat, commit, etc.), you must set the CVS_RSH environment variable to ssh. So +just take the time now to add one of these lines to your .bashrc/.cshrc, so +that the CVS_RSH setting will be there every time you log in.

  export CVS_RSH=ssh           (bash syntax)
+  setenv CVS_RSH ssh           (csh syntax)

1.1.4. cvs checkout

Finally, you should be able to do the checkout! If you already have a Bochs +subdirectory directory, move it out of the way because the checkout will +overwrite it.

  export CVSROOT=":ext:sfusername@bochs.cvs.sourceforge.net:/cvsroot/bochs"
+  cvs -z3 checkout bochs
+  sfusername@bochs.cvs.sourceforge.net's password:        <--type your password

In the CVSROOT variable, replace sfusername with your SF username. There's +no need to add CVSROOT to your rc files because CVS will remember it +after the checkout. The -z3 (optional) just adds some compression to make +the checkout go faster. Once all the files have been downloaded, you will +have a Bochs directory which is checked out with write access!


PrevHomeNext
Bochs Developers Guide Using CVS write access
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/sb16-emulation-basics.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/sb16-emulation-basics.html new file mode 100644 index 0000000..de61f48 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/sb16-emulation-basics.html @@ -0,0 +1,1568 @@ + +Sound Blaster 16 Emulation
Bochs Developers Guide
PrevChapter 2. About the codeNext

2.8. Sound Blaster 16 Emulation

Note: A little more up-to-date version of the user related part of this section is + available in the user guide.

Sound Blaster 16 (SB16) emulation for Bochs was written and donated by +Josef Drexler, who has a +web page on the topic. + The entire set of his SB16 patches have been integrated into +Bochs, however, so you can find everything you need here.

SB16 Emulation has been tested with several soundcards and versions of Linux. Please give +Josef feedback on +whether is does or doesn't work on your combination of software and hardware.

2.8.1. How well does it work?

Right now, MPU401 emulation is next to perfect. It supports UART +and SBMIDI mode, because the SB16's MPU401 ports can't do anything else as well.

The digital audio basically works, but the emulation is too slow for fluent +output unless the application doesn't do much in the background (or the +foreground, really). The sound tends to looping or crackle on slower +computer, but the emulation appears to be correct. Even a MOD +player works, although only for lower sampling speeds.

Also, the MIDI data running through the MPU401 ports can be written +into a SMF, that is the standard midi file. The wave output +can be written into a VOC file, which has a format defined by +Creative Labs. This file format can be converted to WAV by +sox for example.

2.8.2. Output to a sound card

Output is supported on Linux and Windows 95 at the moment. +On Linux, the output goes to any file or device. If you have a +wavetable synthesizer, midi can go to /dev/midi00, otherwise you may need +a midi interpreter. For example, the midid program from the +DosEmu project would work. Wave output should go to /dev/dsp. +These devices are assumed to be OSS devices, if they're not +some of the ioctl's might fail. +On Windows, midi and output goes to the midi mapper and the wave mapper, +respectively. A future version might have selectable output devices.

2.8.3. Installation on Linux

Prerequisites:

A wavetable synthesizer on /dev/midi00 and a working /dev/dsp if you want real time music and sound, otherwise output to midi and wave files is also possible. +Optionally, you can use a software midi interpreter, such as the midid program from the DosEmu project instead of /dev/midi00.

2.8.4. Configuring Bochs

There are a few values in config.h that are relevant to the sound functions. +Edit config.h after running configure, but before compiling.

BX_USE_SB16_SMF should be 1 unless you intend to have several sound cards +running at the same time.

BX_USE_SOUND_VIRTUAL can be 0 or 1, and determines whether the output class +uses virtual functions or not. The former is more versatile and allows to +select the class at runtime (not supported at the moment), while the latter +is slightly faster.

BX_SOUND_OUTPUT_C is the name of the class used for output. The default is +to have no output functions, so you need to change this if you want any sound. +The following are supported at the moment:

        bx_sound_linux_c    for output to /dev/dsp and /dev/midi00 on Linux
+                            (and maybe other OSes that use the OSS driver)
+        bx_sound_windows_c  for output to the midi and wave mapper of
+                            Windows 3.1 and higher.
+        bx_sound_output_c   for no output at all.

Setup the SB16 emulation in your .bochsrc, according to instructions +in that file.

2.8.5. Runtime configuration

The source for the SB16CTRL program that is used to modify +the runtime behaviour of the SB16 emulator is included in +misc/sb16. You can compile it or download the +executable.

See the section "Sound Blaster 16 Emulation" in the user documentation for +information about the commands of SB16CTRL.

2.8.6. Features planned for the future

  • Ports to more OS's, but I can't do this myself

  • Finishing the OPL3 FM emulation by translating the music to midi data

2.8.7. Description of the sound output classes

This file is intended for programmers who would like to port the sound +output routines to their platform. It gives a short outline what services +have to be provided.

You should also have a look at the exisiting files, SOUNDLNX.CC +for Linux and SOUNDWIN.CC for Windows and their respective +header files to get an idea about how these things really work.

2.8.8. Files

The main include file is bochs.h. It has all definitions +for the system-independent functions that the SB16 emulation uses, which +are defined in sb16.h.

Additionally, every output driver will have an include file, which +should be included at the end of sb16.h to allow the emulator +to use that driver.

To actually make the emulator use any specific driver, +BX_SOUND_OUTPUT_C has to be set to the name of the respective +output class.

Note that if your class contains any system-specific statements, +include-files and so on, you should enclose both the include-file and +the CC-file in an #if defined (OS-define) construct. +Also don't forget to add your file to the object list in +iodev/Makefile and iodev/Makefile.in.

2.8.9. Classes

The following classes are involved with the SB16 emulation:

  • bx_sb16_c is the class containing the emulator itself, that +is the part acting on port accesses by the application, handling the +DMA transfers and so on. It also prepares the data for the output +classes.

  • bx_sound_output_c is the base output class. It has all +the methods used by the emulator, but only as stubs and does not +actually produce any output. These methods are then called by +the emulator whenever output is necessary.

  • bx_sound_OS_c is derived from +bx_sound_output_c. It contains the code to generate +output for the OS operating system. +It is necessary to override all +the methods defined in the base class, unless virtual functions +are used. Note that this should remain an option, so try to +override all methods, even if only as stubs. They should be +declared virtual if and only if BX_USE_SOUND_VIRTUAL +is defined, just as in the examples. +The constructor should call the inherited constructor +as usual, even though the current constructor does not do +anything yet.

2.8.10. Methods

The following are the methods that the output class has to override. +All but constructor and destructor have to return either +BX_SOUND_OUTPUT_OK (0) if the function was successful, +or BX_SOUND_OUTPUT_ERR (1) if not. If any of the initialization +functions fail, output to that device is disabled until the emulator is restarted.

2.8.11. bx_sound_OS_c(bx_sb16_c*sb16)

The emulator instantiates the class at the initialization of Bochs.

Description of the parameter:

  • sb16 is a pointer to the emulator class. +This pointer can then be used to access for example the writelog function to generate +sound-related log messages. Apart from that, no access to the emulator +should be necessary.

  • The constructor should not allocate the output devices. +This shouldn't be done until the actual output occurs; in either +initmidioutput() or initwaveoutput(). +Otherwise it would be impossible to have two copies of Bochs running +concurrently (if anybody ever wants to do this).

2.8.12. ~bx_sound_OS_c()

The instance is destroyed just before Bochs ends.

2.8.13. int openmidioutput(char *device)

  • openmidioutput() is called when the first midi output starts. +It is only called if the midi output mode is 1 (midimode 1). It should +prepare the given MIDI hardware for receiving midi commands.

  • openmidioutput() will always be called before openwaveoutput(), +and closemidioutput()will always be called before closewaveoutput(), but not in all cases will both functions be called.

2.8.14. Description of the parameters:

  • device is a system-dependent variable. +It contains the value of the MIDI=device configuration option.

  • Note that only one midi output device will be used at any one time. +device +may not have the same value throughout one session, but it will be closed +before it is changed.

2.8.15. int midiready()

midiready() is called whenever the applications asks if the +midi queue can accept more data.

Return values:

  • BX_SOUND_OUTPUT_OK if the midi output device is ready.

  • BX_SOUND_OUTPUT_ERR if it isn't ready.

Note: midiready() will be called a few times +before the device is opened. If this is the case, it should +always report that it is ready, otherwise the application (not Bochs) +will hang.

2.8.16. int sendmidicommand(int delta, int command, int length, Bit8u data[])

sendmidicommand()is called whenever a complete midi command has +been written to the emulator. It should then send the given midi command to the midi hardware. +It will only be called after the midi output has been opened. Note that +if at all possible it should not wait for the completion of the command +and instead indicate that the device is not ready during the execution +of the command. This is to avoid delays in the program while it is +generating midi output.

Description of the parameters:

  • delta is the number of delta ticks that +have passed since the last command has been issued. It is always zero for +the first command. There are 24 delta ticks per quarter, and 120 quarters +per minute, thus 48 delta ticks per second.

  • command is the midi command byte (sometimes +called status byte), in the usual range of 0x80..0xff. For more information +please see the midi standard specification.

  • length is the number of data bytes that +are contained in the data structure. This does not include the status +byte which is not replicated in the data array. It can only be greater +than 3 for SysEx messages (commands 0xF0 and 0xF7)

  • data[] is the array of these data bytes, +in the order they have in the standard MIDI specification. +Note, it might be NULL if length==0.

2.8.17. int closemidioutput()

closemidioutput() is called before shutting down Bochs or +when the +emulator gets the stop_output command through the emulator port. +After this, no more output will be necessary until openmidioutput() +is called again, but midiready() might still be called. It should do the following:

  • Wait for all remaining messages to be completed

  • Reset and close the midi output device

2.8.18. int openwaveoutput(char *device)

openwaveoutput() is called when the first wave output occurs, +and only if the selected wavemode is 1. It should do the following:

  • Open the given device, and prepare it for wave output

or

  • Store the device name so that the device can be opened in startplayback().

openmidioutput() will always be called before openwaveoutput(), +and closemidioutput()will always be called before closewaveoutput(), but not in all cases will both functions be called.

openwaveoutput() will typically be called once, whereas +startplayback() is called for every new DMA transfer to the SB16 emulation. If feasible, +it could be useful to open and/or lock the output device in +startplayback() as opposed to openwaveoutput() +to ensure that it can be used by other applications while Bochs doesn't +need it.

However, many older applications don't use the auto-init DMA +mode, which means that they start a new DMA transfer for every single +block of output, which means usually for every 2048 bytes or so. +Unfortunately there is no way of knowing whether the application will +restart an expired DMA transfer soon, so that in these cases the +startwaveplayback function will be called very often, and it +isn't a good idea to have it reopen the device every time.

The buffer when writing to the device should not be overly large. +Usually about four buffers of 4096 bytes produce best results. Smaller +buffers could mean too much overhead, while larger buffers contribute +to the fact that the actual output will always be late when the application +tries to synchronize it with for example graphics.

The parameters are the following:

  • device is the wave device selected by +the user. It is strictly system-dependent. The value is that of the +WAVE=device +configuration option.

Note that only one wave output device will be used at any one time. +device may not have the same value throughout one session, but it will be closed +before it is changed.

2.8.19. int startwaveplayback(int frequency, int bits, int stereo, int format)

This function is called whenever the application starts a new DMA transfer. It should do the following:

  • Open the wave output device, unless openwaveoutput() did that +already

  • Prepare the device for data and set the device parameters to those given +in the function call

The parameters are the following:

  • frequency is the desired frequency of the +output. Because of the capabities of the SB16, it can have any value between +5000 and 44,100.

  • bits is either 8 or 16, denoting the resolution +of one sample.

  • stereo is either 1 for stereo output, or 0 for mono output.

  • format is a bit-coded value (see below).

Table 2-4. format bits

Bit numberMeaning
0 (LSB)

0: unsigned data

1: signed data

1..6 Type of codec (see below)
7

0: no reference byte

1: with reference byte

8..x reserved (0)
+ +

Table 2-5. codecs

ValueMeaning
0 PCM (raw data)
1 reserved
2 2-bit ADPCM (Creative Labs format)
3 2.4-bit (3-bit) ADPCM (Creative Labs format)
4 4-bit ADPCM (Creative Labs format)

Other codecs are not supported by the SB hardware. In fact, most applications will +translate their data into raw data, so that in most cases the codec will be zero.

The number of bytes per sample can be calculated from this as (bits / 8) * (stereo + 1).

2.8.20. int waveready()

This is called whenever the emulator has another output buffer ready +and would like to pass it to the output class. This happens every +BX_SOUND_OUTPUT_WAVEPACKETSIZE bytes, or whenever a DMA transfer +is done or aborted.

It should return whether the output device is ready for another buffer +of BX_SOUND_OUTPUT_WAVEPACKETSIZE bytes. +If BX_SOUND_OUTPUT_ERR +is returned, the emulator waits about 1/(frequency * bytes per sample) seconds +and then asks again. The DMA transfer is stalled during that time, but +the application keeps running, until the output device becomes ready.

As opposed to midiready(), waveready() will not be +called unless the device is open.

2.8.21. int sendwavepacket(int length, Bit8u data[])

This function is called whenever a data packet of at most BX_SB16_WAVEPACKETSIZE +is ready at the SB16 emulator. It should then do the following:

  • Send this wave packet to the wave hardware

This function has to be synchronous, meaning that it has +to return immediately, and not wait until the output is done. Also, +this function might be called before the previous output is done. If your +hardware can't append the new output to the old one, you will have to implement +this yourself, or the output will be very chunky, with as much silence +between the blocks as the blocks take to play. This is not what you want. +Instead, waveready() should return BX_SOUND_OUTPUT_ERR +until the device accepts another block of data.

Parameters:

  • length is the number of data bytes in +the data stream. It will never be larger than BX_SB16_WAVEPACKETSIZE.

  • data is the array of data bytes.

The order of bytes in the data stream is the same as that in the Wave file format: + +

Table 2-6. wave output types

Output typeSequence of data bytes
8 bit mono Sample 1; Sample 2; Sample 3; etc.
8 bit stereo Sample 1, Channel 0; Sample 1, Channel 1; Sample 2, Channel 0; Sample 2, Channel 1; etc.
16 bit mono Sample 1, LSB; Sample 1, MSB; Sample 2, LSB; Sample 2, MSB; etc.
16 bit stereo Sample 1, LSB, Channel 0; Sample 1, MSB, Channel 0; Sample 1, LSB, Channel 1; Sample 1, MSB, Channel 1; etc.

Typically 8 bit data will be unsigned with values from 0 to 255, and +16 bit data will be signed with values from -32768 to 32767, although the +SB16 is not limited to this. For further information on the codecs and +the use of reference bytes please refer to the Creative Labs Sound Blaster +Programmer's Manual, which can be downloaded from the Creative Labs web +site.

2.8.22. int stopwaveplayback()

This function is called at the end of a DMA transfer. It should do the following:

  • Close the output device if it was opened by startwaveplayback(). +and it's not going to be opened soon. Which is almost impossible to tell.

2.8.23. int closewaveoutput()

This function is called just before Bochs exits. It should do the following:

  • Close the output device, if this hasn't been done by stopwaveplayback().

Typically, stopwaveplayback() will be called several times, whenever +a DMA transfer is done, where closewaveoutput() will only be called +once. However, in the future it might be possible that openwaveoutput() +is called again, for example if the user chose to switch devices while +Bochs was running. This is not supported at the moment, but might be in +the future.


PrevHomeNext
Bochs's CMOS mapUpHarddisk Images based on redologs
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/shell-access.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/shell-access.html new file mode 100644 index 0000000..a0a7c1b --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/shell-access.html @@ -0,0 +1,148 @@ + +shell access to the website
Bochs Developers Guide
PrevChapter 5. WebmasteringNext


PrevHomeNext
WebmasteringUpwebsite html repository
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/site-update.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/site-update.html new file mode 100644 index 0000000..82b038f --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/site-update.html @@ -0,0 +1,148 @@ + +automatic site update
Bochs Developers Guide
PrevChapter 5. WebmasteringNext


PrevHomeNext
website html repositoryUpother content
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/sound-lowlovel-basics.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/sound-lowlovel-basics.html new file mode 100644 index 0000000..582b83b --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/sound-lowlovel-basics.html @@ -0,0 +1,2166 @@ + +The sound lowlevel interface
Bochs Developers Guide
PrevChapter 2. About the codeNext

2.9. The sound lowlevel interface

This file is intended for programmers who would like to port the sound +output routines to their platform. It gives a short outline what services +have to be provided.

You should also have a look at the exisiting files, SOUNDLOW.CC, +SOUNDMOD.CC and e.g. SOUNDLNX.CC for Linux +or SOUNDWIN.CC for Windows and their respective header files +to get an idea about how these things really work.

2.9.1. Files

The main include file for a lowlevel sound driver is iodev.h. +It has all definitions for the system-independent functions that a sound driver +uses. The sound driver also needs to include soundlow.h for +the definitions of the base classes bx_sound_lowlevel_c, +bx_soundlow_waveout_c, bx_soundlow_wavein_c +and bx_soundlow_midiout_c.

Additionally, every output driver will have an include file, which should be +included on top of soundmod.cc to allow the emulator +to use that driver. The code to initialize the object for the selected drivers +can be found in that file, so a soundcard emulation does not need to include +the specific driver headers.

To actually make the emulator use any specific driver as the default, +BX_SOUND_LOWLEVEL_NAME has to be set to the name of the +respective driver.

Note that if your class contains any system-specific statements, +include-files and so on, you should enclose both the include-file and +the CC-file in an #if defined (OS-define) construct. +Also don't forget to add your file to the list of lowlevel sound object +files (SOUNDLOW_OBJS) in the file configure.in +and to regenerate the configure script,

2.9.2. Defines and strutures

#define BX_SOUNDLOW_WAVEPACKETSIZE  19200
+
+#define BX_SOUNDLOW_OK   0
+#define BX_SOUNDLOW_ERR  1
+
+typedef struct {
+  Bit16u samplerate;
+  Bit8u  bits;
+  Bit8u  channels;
+  Bit8u  format;
+  Bit16u volume;
+} bx_pcm_param_t;
+
+const bx_pcm_param_t default_pcm_param = {44100, 16, 2, 1};

The maximum size of a wave data packet, the return values of the lowlevel +functions, the structure for the PCM parameters and the default parameter +set are also important for the sound driver development. They can be found +in the main include file soundlow.h.

All lowlevel sound methods called from the device code have to return either +BX_SOUNDLOW_OK if the function was successful, or +BX_SOUNDLOW_ERR if not. If any of the initialization +functions fail, the device emulation should disable the affected feature.

2.9.3. Classes

The following classes are involved with the sound lowlevel interface:

  • bx_soundmod_ctl_c is a pseudo device that is used to +initialize the sound drivers depending on the configuration.

  • bx_sound_lowlevel_c is the base class of the +lowlevel sound support. It has methods to return pointers to the objects for +the available services waveout, wavein +and midiout. The base class returns NULL for all services.

  • bx_sound_dummy_c is derived from bx_sound_lowlevel_c. +It returns vaild pointers for all services, but the output classes are only +implemented as stubs and the wavein service returns silence. +This "dummy" driver is used whenever a OS specific driver does not implement +all services.

  • bx_soundlow_waveout_c, bx_soundlow_wavein_c +and bx_soundlow_midiout_c are the base classes for the +services provided by the Bochs lowlevel sound support. Some methods are stubs +and used by the "dummy" sound driver, others are helper methods and used by +the OS specific implementations derived from these base classes.

  • bx_sound_OS_c is derived from bx_sound_lowlevel_c. +It returns vaild pointers for all services it implements for the selected +OS (operating system / library) or NULL for services it does +not implement. In the second case the Bochs sound init code falls back to the +"dummy" driver.

2.9.4. The base class bx_sound_lowlevel_c

class bx_sound_lowlevel_c : public logfunctions {
+public:
+  bx_sound_lowlevel_c();
+  virtual ~bx_sound_lowlevel_c();
+
+  virtual bx_soundlow_waveout_c* get_waveout() {return NULL;}
+  virtual bx_soundlow_wavein_c* get_wavein() {return NULL;}
+  virtual bx_soundlow_midiout_c* get_midiout() {return NULL;}
+
+protected:
+  bx_soundlow_waveout_c *waveout;
+  bx_soundlow_wavein_c *wavein;
+  bx_soundlow_midiout_c *midiout;
+};

The base class for sound lowlevel support is derived from the logfunctions +class to make the Bochs logging capabilities available in the sound driver code. +The constructor of this base class only initializes all pointers to NULL and +the destructor deletes the objects if necessary.

2.9.5. The waveout base class bx_soundlow_waveout_c

class bx_soundlow_waveout_c : public logfunctions {
+public:
+  bx_soundlow_waveout_c();
+  virtual ~bx_soundlow_waveout_c();
+
+  virtual int openwaveoutput(const char *wavedev);
+  virtual int set_pcm_params(bx_pcm_param_t *param);
+  virtual int sendwavepacket(int length, Bit8u data[], bx_pcm_param_t *src_param);
+  virtual int get_packetsize();
+  virtual int output(int length, Bit8u data[]);
+  virtual int closewaveoutput();
+
+  virtual int register_wave_callback(void *, get_wave_cb_t wd_cb);
+  virtual void unregister_wave_callback(int callback_id);
+
+  virtual bx_bool mixer_common(Bit8u *buffer, int len);
+protected:
+  void convert_pcm_data(Bit8u *src, int srcsize, Bit8u *dst, int dstsize, bx_pcm_param_t *param);
+  void start_mixer_thread(void);
+
+  bx_pcm_param_t emu_pcm_param, real_pcm_param;
+  int cvt_mult;
+
+  int cb_count;
+  struct {
+    void *device;
+    get_wave_cb_t cb;
+  } get_wave[BX_MAX_WAVE_CALLBACKS];
+  int pcm_callback_id;
+};

The base class for wave output support is also derived from the +logfunctions class. In addition to wave output methods +used from sound devices, it contains everything required for the mixer thread +feature (register PCM sources, convert data formats, start mixer).

The constructor should not allocate the output devices. +This should be done in openwaveoutput().

This table shows the waveout class methods, where are they called from and +if a platform / library specific implementation is required. +

Table 2-4. Waveout methods

MethodCalled fromPlatform code
openwaveoutput()Sound init codeRequired
set_pcm_params()openwaveoutput() and sendwavepacket()Required
sendwavepacket()Sound device emulationOptional
get_packetsize()Mixer threadOptional
output()Mixer threadRequired
closewaveoutput()Sound device emulationOptional
register_wave_callback()openwaveoutput() and sound device emulationOptional
unregister_wave_callback()class destructor and sound device emulationOptional
mixer_common()Mixer threadOptional
convert_pcm_data()InternalNo
start_mixer_thread()InternalNo

2.9.5.1. int openwaveoutput(const char *wavedev)

openwaveoutput() is called when the sound output subsystem +initializes. It should do the following:

  • Set up the default PCM parameters for output.

  • Open the given device, and prepare it for wave output.

  • Register the callback function for the PCM buffer queue (sendwavepacket() +adds the output to the queue and the mixer thread gets it from there).

  • Start the mixer thread, unless the sound library has it's own one (e.g. SDL).

openwaveoutput() will only be called once, whereas +set_pcm_params() is called whenever the PCM samplerate +has been changed.

The parameters are the following:

  • wavedev is the wave output device selected by the user. +It is strictly system-dependent. Some sound libraries currently ignore this +value and use the default one instead. The value is that of the waveout=device +configuration parameter of the sound bochsrc option.

Note that only one wave output device will be used at any one time. +wavedev may not have the same value throughout one session, +but it will be closed before it is changed.

2.9.5.2. int set_pcm_params(bx_pcm_param_t *param)

This function should called from openwaveoutput() to initialize +the output device with the default parameters and from sendwavepacket() +whenever the samplerate has been changed in the emulated sound device. +It should do the following:

  • Open the wave output device, unless openwaveoutput() did that +already.

  • Prepare the device for data and set the device parameters to those given +in the function call.

The parameters are the following:

  • param is a pointer to a structure containing the set of +parameters required to set up a sound device for PCM output.

The members of the structure bx_pcm_param_t are these:

  • samplerate is the desired frequency of the +output. Because of the capabities of the soundcards, it can have any value +between 5000 and 48,000.

  • bits is either 8 or 16, denoting the resolution +of one sample.

  • channels is the number of channels (2 for stereo output, +or 1 for mono output.

  • format is a bit-coded value (see below).

  • volume is the output volume to be used by the mixer code. +The 16 bit value consists of two 8 bit values for each channel.

Table 2-5. format bits

Bit numberMeaning
0 (LSB)

0: unsigned data

1: signed data

1..6 Type of codec (see below)
7

0: no reference byte

1: with reference byte

8..x reserved (0)
+ +

Table 2-6. codecs

ValueMeaning
0 PCM (raw data)
1 reserved
2 2-bit ADPCM (Creative Labs format)
3 2.4-bit (3-bit) ADPCM (Creative Labs format)
4 4-bit ADPCM (Creative Labs format)

Other codecs are not supported by the SB hardware. In fact, most applications will +translate their data into raw data, so that in most cases the codec will be zero.

The number of bytes per sample can be calculated from this as (bits / 8) * channels.

2.9.5.3. int sendwavepacket(int length, Bit8u data[], bx_pcm_param_t *src_param)

This function is called whenever a data packet of at most +BX_SOUNDLOW_WAVEPACKETSIZE is ready at the soundcard +emulation. It should then do the following:

  • Add this wave packet to the waveout buffer chain after converting to 16 bit signed +little endian. If the samplerate has been changed set_pcm_params() +should be called to update the sound hardware settings.

Parameters:

  • length is the number of data bytes in +the data stream. It will never be larger than BX_SOUNDLOW_WAVEPACKETSIZE.

  • data is the array of data bytes.

  • src_param is a pointer to a structure containing the PCM parameters +(see above).

The order of bytes in the data stream is the same as that in the Wave file format: + +

Table 2-7. wave output types

Output typeSequence of data bytes
8 bit mono Sample 1; Sample 2; Sample 3; etc.
8 bit stereo Sample 1, Channel 0; Sample 1, Channel 1; Sample 2, Channel 0; Sample 2, Channel 1; etc.
16 bit mono Sample 1, LSB; Sample 1, MSB; Sample 2, LSB; Sample 2, MSB; etc.
16 bit stereo Sample 1, LSB, Channel 0; Sample 1, MSB, Channel 0; Sample 1, LSB, Channel 1; Sample 1, MSB, Channel 1; etc.

Typically 8 bit data will be unsigned with values from 0 to 255, and +16 bit data will be signed with values from -32768 to 32767, although the +soundcard emulations are not limited to this. +site.

2.9.5.4. int get_packetsize()

This function is called from the mixer thread to retrieve the size of a wave data +packet based on the current samplerate. By default the packet size is big enough +to send output for 0.1 seconds. If the host sound driver / library uses a different +value, this value should be returned with this method.

2.9.5.5. int output(int length, Bit8u data[])

This function is called from the mixer thread to send the mixed PCM output to +the host sound hardware.

Parameters:

  • length is the number of data bytes in +the data stream. It will never be larger than the value returned from get_packetsize.

  • data is the array of data bytes.

2.9.5.6. int closewaveoutput()

This function is currently only called from the soundcard emulation if the "file" +driver is used. This makes the runtime change of the output file possible. +By default this method does nothing and the wave output device is closed in the +destructor of the specific class.

2.9.5.7. int register_wave_callback(void *arg, get_wave_cb_t wd_cb)

This function is called from openwaveoutput() to register +the function to retrieve data from the PCM output buffer chain. Other sound +emulation devices (e.g. OPL3, PC speaker) can register a function to poll the +data from the device emulation. The return value is the ID of the registered +function and it is usually used to unregister the source.

Parameters:

  • arg is the pointer to the device emulation object.

  • wd_cb is the pointer to a static function that returns +wave data from the device emulation. This function is usually called from the +mixer_common() method.

2.9.5.8. void unregister_wave_callback(int callback_id)

This function is usually called from the destructor of the sound emulation +device to unregister it's registered function to poll PCM data. If the +driver / library doesn't use the default mixer thread, a specific implementation +of this method my be required.

Parameter:

  • callback_id is the ID of the function to unregister.

2.9.5.9. bx_bool mixer_common(Bit8u *buffer, int len)

This is the main wave output mixing function. It is called from the mixer +thread, it polls the wave data from all registered sources and it mixes the +data using a simple algorithm (addition and clipping). The return value +indicates whether or not wave data is available for output.

Parameters:

  • buffer is the output buffer for the wave data.

  • len is the maximum length of the output buffer.

2.9.5.10. void convert_pcm_data(Bit8u *src, int srcsize, Bit8u *dst, int dstsize, bx_pcm_param_t *param)

This function converts the PCM data sent from the sound device emulation to the +16 bit stereo signed little endian format. It should be called in sendwavepacket() +after allocating the output buffer in the buffer queue. Future versions might +also perform resampling here.

Parameters:

  • src is the buffer containing data sent from the sound emulation.

  • srcsize is the amount of wave data to be converted.

  • dst is the buffer for the converted wave data.

  • dstsize is the size of the destination buffer.

  • param is a pointer to the struture containing the format +parameters of the source data.

2.9.5.11. void start_mixer_thread()

This function starts the mixer thread and it should be called in openwaveoutput() +unless the sound driver / library has it's own way to do this (e.g. SDL). This +function also initializes the mutex required for locking the mixer thread when +adding data to the buffer chain or unregistering a source.

2.9.6. The wavein base class bx_soundlow_wavein_c

class bx_soundlow_wavein_c : public logfunctions {
+public:
+  bx_soundlow_wavein_c();
+  virtual ~bx_soundlow_wavein_c();
+
+  virtual int openwaveinput(const char *wavedev, sound_record_handler_t rh);
+  virtual int startwaverecord(bx_pcm_param_t *param);
+  virtual int getwavepacket(int length, Bit8u data[]);
+  virtual int stopwaverecord();
+
+  static void record_timer_handler(void *);
+  void record_timer(void);
+protected:
+  int record_timer_index;
+  int record_packet_size;
+  sound_record_handler_t record_handler;
+};

The base class for wave input support is also derived from the +logfunctions class. It contains the framework for wave +input (recording) support. The base class is used by the "dummy" sound driver +and returns silence to let the input mechanism of the soundcard emulation work. +The soundcard emulator object needs to implement a callback function to notifies +the emulation about available data. This function usually calls the driver method +to get the wave data packet. The driver objects has a periodic timer with an +interval of 0.1 emulated seconds that is active during recording. The timer +handler processes the wave data recorded with platform or library specific +function and finally notifies the emulator.

The constructor of the base class only initializes the timer ID. OS specific +implementations should initialize other required members here.

The destructor of the base class only calls stopwaverecord(). +OS specific implementations should close the input device here if necessary.

2.9.6.1. int openwaveinput(char *device, sound_record_handler_t rh)

openwaveinput() is called when the sound emulation first +receives a sound recording command. It should do the following:

  • Open the given device, and prepare it for wave input

or

  • Store the device name so that the device can be opened in startwaverecord().

In addition to this the record handler value should be stored and the record timer +should be registered. This is the definition of record handler callback function: +

typedef Bit32u (*sound_record_handler_t)(void *arg, Bit32u len);

openwaveinput() will only be called once, whereas +startwaverecord() is called for every new wave input +command to the soundcard emulation. If feasible, it could be useful to open +and/or lock the input device in startwaverecord() as +opposed to openwaveinput() to ensure that it can be used +by other applications while Bochs doesn't need it.

The parameters are the following:

  • device is the wave device selected by the user. It is +strictly system-dependent. The value is that of the wavein=device +configuration parameter of the sound bochsrc option.

  • rh is a pointer to the record handler method of the sound +emulation. When sound recording is active, this handler is called periodicly to +notify the sound emulation about newly available data.

Note that only one wave input device will be used at any one time. +device may not have the same value throughout one session, +but it will be closed before it is changed.

2.9.6.2. int startwaverecord(bx_pcm_param_t *param)

This method receives a pointer to the required PCM parameters (samplerate, +data format) as the argument and it should set up the input device for recording, +calculate the size of the recording packet for 0.1 second and start the record +timer.

2.9.6.3. int getwavepacket(int length, Bit8u data[])

This method is called from the record handler method of the sound emulation device +to retrieve the recorded wave data packet.

2.9.6.4. int stopwaverecord()

This method is called to stop the wave recording. It deactivates the timer that +calls the method to perform the recording.

2.9.7. The midiout base class bx_soundlow_midiout_c

class bx_soundlow_midiout_c : public logfunctions {
+public:
+  bx_soundlow_midiout_c();
+  virtual ~bx_soundlow_midiout_c();
+
+  virtual int openmidioutput(const char *mididev);
+  virtual int midiready();
+  virtual int sendmidicommand(int delta, int command, int length, Bit8u data[]);
+  virtual int closemidioutput();
+};

The base class for MIDI output support is also derived from the +logfunctions class.

OS specific implementations should initialize required members in the constructor.

The destructor of the base class only calls closemidioutput(). +OS specific implementations should close the input device here if necessary.

2.9.7.1. int openmidioutput(char *device)

  • openmidioutput() is called when the first midi output starts. +It is only called if the midi output to the driver is active (midimode 1). It should +prepare the given MIDI hardware for receiving midi commands.

Description of the parameters:

  • mididev is a system-dependent variable. +The value is that of the midiout=device +configuration parameter of the sound bochsrc option.

  • Note that only one midi output device will be used at any one time. +device +may not have the same value throughout one session, but it will be closed +before it is changed.

2.9.7.2. int midiready()

midiready() is called whenever the applications asks if the +midi queue can accept more data.

Return values:

  • BX_SOUNDLOW_OK if the midi output device is ready.

  • BX_SOUNDLOW_ERR if it isn't ready.

Note: midiready() will be called a few times +before the device is opened. If this is the case, it should +always report that it is ready, otherwise the application (not Bochs) +will hang.

2.9.7.3. int sendmidicommand(int delta, int command, int length, Bit8u data[])

sendmidicommand()is called whenever a complete midi command has +been written to the emulator. It should then send the given midi command to the midi hardware. +It will only be called after the midi output has been opened. Note that +if at all possible it should not wait for the completion of the command +and instead indicate that the device is not ready during the execution +of the command. This is to avoid delays in the program while it is +generating midi output.

Description of the parameters:

  • delta is the number of delta ticks that +have passed since the last command has been issued. It is always zero for +the first command. There are 24 delta ticks per quarter, and 120 quarters +per minute, thus 48 delta ticks per second.

  • command is the midi command byte (sometimes +called status byte), in the usual range of 0x80..0xff. For more information +please see the midi standard specification.

  • length is the number of data bytes that +are contained in the data structure. This does not include the status +byte which is not replicated in the data array. It can only be greater +than 3 for SysEx messages (commands 0xF0 and 0xF7)

  • data[] is the array of these data bytes, +in the order they have in the standard MIDI specification. +Note, it might be NULL if length==0.

2.9.7.4. int closemidioutput()

closemidioutput() is called before shutting down Bochs or +when the +emulator gets the stop_output command through the emulator port. +After this, no more output will be necessary until openmidioutput() +is called again, but midiready() might still be called. It should +do the following:

  • Wait for all remaining messages to be completed

  • Reset and close the midi output device


PrevHomeNext
Sound Blaster 16 EmulationUpHarddisk Images based on redologs
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/svn-release.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/svn-release.html new file mode 100644 index 0000000..21f9979 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/svn-release.html @@ -0,0 +1,365 @@ + +Building a Bochs release
Bochs Developers Guide
PrevChapter 4. CodingNext

4.2. Building a Bochs release

4.2.1. Preparing source files and SVN

Update version number and strings in configure.in. +

VERSION="2.6.9"
+VER_MAJOR=2
+VER_MINOR=6
+VER_REVISION=9
+VER_SVN=0
+REL_STRING="Build from SVN snapshot on April  9, 2017"
+In the README file you have to update version number and date. Add some +information about new features if necessary. +
Bochs x86 Pentium+ Emulator
+Updated: Sun Apr  9 08:45:00 CEST 2017
+Version: 2.6.9
+In the file bochs.manifest you have to update the version +number for the Windows build. +
  version="2.6.9.0"
+Check date, update/sumup info in CHANGES. Run autoconf to regenerate configure and check them in. +Create an SVN tag that contains all files of the revision that was used in the release. +For prereleases I create a normal SVN tag like this: +
  svn mkdir tags/REL_2_5_pre1_FINAL
+  svn copy trunk/bochs tags/REL_2_5_pre1_FINAL/bochs
+  svn commit
+But for a real release, I make an SVN branch tag AND a normal tag. +
  svn mkdir tags/REL_2_5_FINAL
+  svn copy trunk/bochs tags/REL_2_5_FINAL/bochs
+  svn mkdir branches/REL_2_5
+  svn copy trunk/bochs branches/REL_2_5/bochs
+  svn commit
+The tag marks where the branch split off of the main trunk. +This is very useful in maintaining the branch since you can do diffs +against it. +
   svn diff tags/REL_2_5_FINAL/bochs trunk/bochs
+   svn diff tags/REL_2_5_FINAL/bochs branches/REL_2_5
+   etc.
+All bugfix-only releases after the final release should be created from the REL_2_5 branch. +Now you can start building packages with the sources from the created release tag.

4.2.2. Anonymous SVN checkout and platform-independent sources

An anonymous SVN checkout from the release tag is the base for all official +release packages. Do this checkout from the release tag and specify a not yet +existing directory name with the version number as the destination. Then create +the source package from this new directory. These steps can be done both on +Linux and Windows (Cygwin). +

  svn co http://svn.code.sf.net/p/bochs/code/tags/REL_2_5_FINAL/bochs bochs-2.5
+  tar czvf bochs-2.5.tar.gz --exclude=.svn bochs-2.5
+The source TAR file bochs-2.5.tar.gz is ready for upload.

4.2.3. Building the release on Linux

The RPM will be building using the configuration in .conf.linux with +a few parameters from build/redhat/make-rpm. Make any last +minute changes to .conf.linux. Any changes will go into the source RPM. The +DLX Linux demo package will be downloaded from the Bochs website to the Bochs +root directory if it is not already present there. +

  ./build/redhat/make-rpm | tee ../build.txt
+This produces two rpm files in the current directory. Test and upload.

4.2.4. Building the release on win32

These instructions require cygwin and MSVC++. Use the Bochs sources from +the SVN checkout or unpack the TAR file.

In Cygwin: +

  sh .conf.win32-vcpp         # runs configure
+  make win32_snap             # unzip workspace, make a win32 source ZIP
+The source ZIP is present in the parent directory of the Bochs root and now +ready for upload. To build the binary package, copy it to a Windows machine, +if necessary.

Open up Visual C++ and load the workspace file Bochs.sln. Check +the Build:Set Active Project Configuration is set the way you want it. +For releases I use "Win32 Release".

To create "bochsdbg.exe" with Bochs debugger support, manually change these +lines in config.h to turn on the debugger and the enhanced debugger gui. +

#define BX_DEBUGGER 1
+#define BX_DISASM 1
+#define BX_DEBUGGER_GUI 1
+One of the optimization features must be turned off, since it is currently +not compatible with the debugger. +
#define BX_SUPPORT_HANDLERS_CHAINING_SPEEDUPS 0
+VC++ will rebuild Bochs with debugger and overwrite bochs.exe. To avoid +trashing the non-debug version, move it out of the way while the debugger +version is being built. Then rename the debugger version to bochsdbg.exe. +
  cd obj-release
+  mv bochs.exe bochs-normal.exe
+  (build again with BX_DEBUGGER=1 this time)
+  mv bochs.exe bochsdbg.exe
+  mv bochs-normal.exe bochs.exe

Do make install_win32 into the NSIS folder in the Bochs +source tree: +

  make install_win32 INSTDIR=./build/win32/nsis/bochs-2.5
+This downloads and unpacks both the DLX Linux demo and the HTML docs from the +Bochs website, copies all the files into ./build/win32/nsis/bochs-2.5 +and then creates a binary ZIP file in the NSIS folder.

Now make the NSIS installer package (the current script is known to work with NSIS 3.04) +

  cd build/win32/nsis
+  make
+That gives an installer called Bochs-2.5.exe. Test and upload it.

4.2.5. Creating a file release and uploading files on SF

When you are ready with creating release packages you have to upload them using +the SF file manager feature. Create a subdirectory with the version number in +the bochs directory. Point the download destination to the +new directory and start uploading packages. The top of the CHANGES +file should be used as the release notes. After setting up the file properties the +new release is ready for download.

After having all files set up in the download area, don't forget to post an announcement +containing a brief summary of changes to the bochs-announce mailing list and the "Project +News" section on SF.


PrevHomeNext
CodingUpWebmastering
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/timers.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/timers.html new file mode 100644 index 0000000..f0501c4 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/timers.html @@ -0,0 +1,148 @@ + +timers
Bochs Developers Guide
PrevChapter 2. About the codeNext


PrevHomeNext
Log FunctionsUpBochs's CMOS map
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/trackers.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/trackers.html new file mode 100644 index 0000000..084b6ae --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/trackers.html @@ -0,0 +1,148 @@ + +SourceForge bug, feature, and patch trackers
Bochs Developers Guide
PrevChapter 1. Resources for developersNext


PrevHomeNext
Using CVS write accessUpIdeas for other sections
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/update-online-docs.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/update-online-docs.html new file mode 100644 index 0000000..ad7e2d7 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/update-online-docs.html @@ -0,0 +1,175 @@ + +Updating the online documentation
Bochs Developers Guide
PrevChapter 5. WebmasteringNext

5.4. Updating the online documentation

To update the online documentation, a file called bochsdoc.tar.gz +must be generated with the make. This file must be uploaded +to the location of the online documentation on SF using scp. +

cd doc/docbook
+make bochsdoc.tar.gz
+scp bochsdoc.tar.gz vruppert,bochs@web.sf.net:htdocs/doc/docbook
+After a successful upload, the HTML files must be unpacked from the SF shell. +See section Updating the Bochs website content +how to create a shell. +
cd /home/project-web/bochs/htdocs/doc/docbook
+tar xvzf bochsdoc.tar.gz
+The updated files can be accessed from the sidebar of the Bochs website.


PrevHomeNext
Updating the SVN snapshotUpother content
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/update-svn-snapshot.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/update-svn-snapshot.html new file mode 100644 index 0000000..537ea00 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/update-svn-snapshot.html @@ -0,0 +1,199 @@ + +Updating the SVN snapshot
Bochs Developers Guide
PrevChapter 5. WebmasteringNext

5.3. Updating the SVN snapshot

The SVN snapshot +[1] +can be updated with SF shell access using SSH. There is a script +called update-svn-snapshot.sh that can do all the required steps +(checking out SVN, packing the source tree into one archive, updating the website +link). See previous section how to create a shell. +

cd /home/project-web/bochs/sitebin/
+./update-svn-snapshot.sh

Notes

[1]

The SVN snapshot link can be found on the bottom of the page +getcurrent.html.


PrevHomeNext
Updating the Bochs website contentUpUpdating the online documentation
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/update-website.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/update-website.html new file mode 100644 index 0000000..f4475e1 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/update-website.html @@ -0,0 +1,194 @@ + +Updating the Bochs website content
Bochs Developers Guide
PrevChapter 5. WebmasteringNext

5.2. Updating the Bochs website content

The main HTML content of the Bochs website (except online documentation) is stored +in the sfsite directory of the Bochs SVN repository. Unlike +other SF projects you don't need to upload these files to the Bochs project webspace. +Running a simple SVN update on the SF shell is enough after the files have been +updated in the repository. Please see Setting +up SVN write access for general instructions. The only difference is the +directory name sfsite instead of bochs. +The example below shows how to start the SF shell with SSH and to update the +HTML files. +

ssh -t vruppert,bochs@shell.sourceforge.net create
+vruppert,bochs@shell.sourceforge.net's password:
+
+Requesting a new shell for "vruppert" and waiting for it to start.
+queued... starting...
+
+This is an interactive shell created for user vruppert,bochs.
+Use the "timeleft" command to see how much time remains before shutdown.
+Use the "shutdown" command to destroy the shell before the time limit.
+For path information and login help, type "sf-help".
+
+[vruppert@shell-24002 ~]$ cd /home/project-web/bochs/htdocs/
+[vruppert@shell-24002 htdocs]$ svn update
+U    index.html
+Updated to revision 10752
+[vruppert@shell-24002 htdocs]$ shutdown
+Requesting that your shell be shut down.
+This request will be processed soon.
+[vruppert@shell-24002 htdocs]$
+Broadcast message from root (Mon Oct 31 09:45:04 2011):
+
+The system is going down for system halt NOW!
+Connection to shell-24002 closed by remote host.
+Connection to shell-24002 closed.
+Connection to shell.sourceforge.net closed.


PrevHomeNext
WebmasteringUpUpdating the SVN snapshot
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/using-cvs-write-access.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/using-cvs-write-access.html new file mode 100644 index 0000000..9ed441c --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/using-cvs-write-access.html @@ -0,0 +1,271 @@ + +Using CVS write access
Bochs Developers Guide
PrevChapter 1. Resources for developersNext

1.2. Using CVS write access

1.2.1. Checking in files

Once you have a Bochs directory with cvs write access, you can compile the +files, edit them, test them, etc. See the documentation section, "Tracking +the source code with CVS" for more info on CVS, in the User Manual. +(FIXME: add cross reference) But what's new and different is that you can now +do cvs commits. When a file is all fixed and ready to share with the rest of +the world, you run a commit command to upload your version to the server. +First, it's good to do a cvs update to make sure nobody else has changed it +since you downloaded it last.

  $ cvs update file.cc
+  sfusername@bochs.cvs.sf.net's password:        <--type your password
+  $ cvs commit file.cc
+  sfusername@bochs.cvs.sf.net's password:        <--type your password
+  [editor opens. type log message, save, and exit.]

When CVS starts an editor, The default is usually vi. If you want a different +editor, set the EDITOR environment variable to the name of your preferred +editor. When you're done, just save the file and quit the editor. Unless +there's some problem, you will see a message that says what the new revision +number for the file is, and then "done". If while you're editing the log +message, you decide that you don't want to commit after all, don't save the +file. Quit the editor, and when it asks where the log message went, tell it +to abort.

Here is an example of a successful checkin: + +
  $ cvs commit misc.txt
+  sfusername@bochs.cvs.sf.net's password:        <--type your password
+  [edit log msg]
+  Checking in misc.txt;
+  /cvsroot/bochs/bochs/doc/docbook/misc.txt,v  <--  misc.txt
+  new revision: 1.6; previous revision: 1.5
+  done
+ +And here is an aborted one: + +
  $ cvs commit misc.txt
+  sfusername@bochs.cvs.sf.net's password:        <--type your password
+  [quit editor without saving]
+  Log message unchanged or not specified
+  a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs
+  Action: a
+  cvs [commit aborted]: aborted by user


PrevHomeNext
Resources for developersUpSourceForge bug, feature, and patch trackers
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/using-svn-write-access.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/using-svn-write-access.html new file mode 100644 index 0000000..63e10e5 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/using-svn-write-access.html @@ -0,0 +1,290 @@ + +Using SVN write access
Bochs Developers Guide
PrevChapter 1. Resources for developersNext

1.2. Using SVN write access

1.2.1. Checking in files

Once you have a Bochs directory, you can compile the files, edit them, test them, etc. +See the documentation section, Tracking the source code with SVN +for more info on SVN, in the User Manual. But what's new and different is that +you can now do SVN commits. When a file is all fixed and ready to share with the rest of +the world, you run a commit command to upload your version to the server. +First, it's good to do a SVN update to make sure nobody else has changed it +since you downloaded it last. At the first commit you'll always have to specify your +SF username and type your password.

  $ svn update file.cc
+  $ svn commit --username sfusername file.cc
+  [editor opens. type log message, save, and exit.]
+  Login area: <https://svn.code.sf.net:443> SourceForge Subversion area
+  Username: sfusername
+  Password for 'sfusername': <--type your password
+  Sending        file.cc
+  Transmitting file data .
+  Committed revision 10.

When SVN starts an editor, The default is usually vi. If you want a different +editor, set the EDITOR environment variable to the name of your preferred +editor. When you're done, just save the file and quit the editor. Unless +there's some problem, you will see a message that says what the new SVN revision +number is, and then "done". If while you're editing the log message, you decide +that you don't want to commit after all, don't save the file. Quit the editor, +and when it asks where the log message went, tell it to abort.

Here is an example of a successful checkin: + +

  $ svn commit misc.txt
+  [edit log msg]
+  Sending        misc.txt
+  Transmitting file data .
+  Committed revision 6.
+ +And here is an aborted one: + +
  $ svn commit misc.txt
+  [quit editor without saving]
+  Log message unchanged or not specified
+  a)bort, c)ontinue, e)dit:
+  a

1.2.2. Creating a backup of the SVN repository

Backups of the SVN repository can be made with the rsync utility. +In case of data corruption or other problems on the server, the repository with all +revisions, branches and tags can be restored easily. It is recommended to update this +backup frequently. The following example creates a folder called +bochs-svn-rsync that contains the repository. +

  rsync -av svn.code.sf.net::p/bochs/code bochs-svn-rsync

1.2.3. Setting SVN commit notifications

The Bochs SVN repository is set up to send a notification email to the "bochs-cvs" +mailing list after each successful commit. This email contains the log message, a list +of the modified files and a diff against the previous revision. The diff of large +commits will be truncated at 96 kByte.

After each commit the SVN server runs the script post-commit located +in the hooks folder. On SourceForge, this script forces a refresh +of the Allura code browser and it can call a script post-commit-user +for addition operations if it exists. For Bochs we have set up this script and call +svnnotify from it to create the notification email. +

#!/bin/sh
+
+svnnotify --repos-path $1 --revision $2 -O -C -d -e 98304 -t bochs-cvs@lists.sourceforge.net


PrevHomeNext
Resources for developersUpIdeas for other sections
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/webmastering.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/webmastering.html new file mode 100644 index 0000000..dfb986d --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/development/webmastering.html @@ -0,0 +1,149 @@ + +Webmastering
Bochs Developers Guide
PrevNext

Chapter 5. Webmastering


PrevHomeNext
Building a Bochs release shell access to the website
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/basics.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/basics.html new file mode 100644 index 0000000..490f8d3 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/basics.html @@ -0,0 +1,384 @@ + +Docbook Basics
Bochs Documentation Manual
PrevNext

Chapter 2. Docbook Basics

Some of the most commonly used docbook patterns are described here +for quick reference. For all the details (sometimes more than you +wanted), try DocBook: The Definitive Guide by Norman Walsh and Leonard Muellner, which O'Reilly +& Associates has generously placed on their web site. In this section, +many of the SGML tags are linked to the page of Walsh's book that describes +that tag in detail.

2.1. Small Tutorial

Docbook files are text files containing SGML. If you have ever looked +at HTML, then a docbook file will look familiar. Not the same, but familiar. +The easiest way of getting familiar with the docbook format is by looking at +examples such as the Bochs documentation itself. When you compare the source +code to the rendered documentation on the web site, it will be pretty obvious +what all the codes are doing. HTML is very forgiving about breaking the syntax +rules, such as not putting </h1> at then end of an <h1> section. +SGML is picky; if you forget that kind of thing in SGML, it will insist that +you fix it.

Every paragraph must begin with the <para> tag and end with the +corresponding end tag, </para>. +
<para>
+This is a paragraph.
+</para>

A chapter looks like this: +
<chapter>
+  <title>title of the chapter</title>
+  text of the chapter
+</chapter>
+The text of the chapter must contain at least one complete <para> tag, +and it can include <section>s.

A section looks like this: +
<section>
+  <title>title of the section</title>
+  text of the section
+</section>
+The text of the section must contain at least one complete <para> tag, +and it can include other <section>s.

To make a link to any URL, use the syntax: +
<ulink url="URL">text of the hyperlink</ulink>
+ +However, if you like to link to another target inside the same document, +for example to a section, use something like that: +
<section id="unique identifier">
+  All stuff that is needed here...
+</section>
+...
+<link linkend="unique identifier to link to">text of hyperlink</link>

To include a picture in the text, use the <graphic> tag. In SGML, this +graphic tag has no closing tag. +
<graphic format="fmt" fileref="filename">
+The fmt can be one of many formats including GIF, +JPG, PNG, PS, and EPS. The filename should be on the local disk. If there is +a pathname, it should be relative to the source file or it won't be found on +anyone's system other than yours.

There are over 300 tags defined in the latest version of docbook, so +we won't try to list them all here. Once you get the idea, you can +either find examples in the rest of the documentation that do what you +need, or look at Walsh and Muellner's +DocBook: The Definitive Guide +for more details.


PrevHomeNext
Layout of Bochs Documentation References and Other Tutorials
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/conventions.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/conventions.html new file mode 100644 index 0000000..282f53b --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/conventions.html @@ -0,0 +1,219 @@ + +Conventions
Bochs Documentation Manual
PrevNext

Chapter 3. Conventions

Put a &FIXME; near things that need to be fixed up. A &FIXME; causes +the under construction symbol to appear, like this .

A &NEEDHELP; indicates, that you need someone's help in order to document +something, you don't know for sure. This is mostly the case if you need inside +information from a developer. The symbol looks like this: .

Don't get confused because &FIXME; looks the same as &NEEDHELP; - +this is just for the moment. When you like to use one of them, think of what +it should mean, instead of how it looks like: Take &FIXME; if you have +great ideas of what to document, but have no time or no knowledge about it, or +just noticed something wrong or outdated. &NEEDHELP; instead should be used +to request help on something (see above).

This is just a first try to clearify the difference between +&NEEDHELP; and &FIXME;.

To maintain a consistent spelling, some "problem words" are mentioned here, +along with a hint on how to spell them. +

Table 3-1. list of problem words

BochsBochs is written with a leading capital letter.
bochsrc This is what the Bochs configuration file should be refered as. It is a good + compromise between what is common on Unix and what is possible on Windows + (file names starting with a dot aren't easy to create). Remember to use + <filename>bochsrc</filename>. +
CD-ROMThis abbreviation is written in all capital letters, with a hyphen in between.
Unix Unix is written using a leading capital letter, followed by all lower-case letters. + See the Unix entry in Wikipedia. +

SGML docbook...lower case elements...indentation...remarks...master document/include files


PrevHomeNext
References and Other Tutorials Reading and Writing
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/documentation.dbk b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/documentation.dbk new file mode 100644 index 0000000..77bea47 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/documentation.dbk @@ -0,0 +1,529 @@ + + + + +%bochsdefs; + +]> + + + + Bochs Documentation Manual + + BryceDenney + MichaelCalabrese + + +Layout of Bochs Documentation + + +The Bochs documentation is divided into three major divisions: + + + + The User's Guide introduces the Bochs Emulator, and covers installation and use. + + + + + Developer's Guide: Describes the internals of the Bochs Emulator for developers. + + + + + Documentation Guide: Describes how the documentation is organized, and how to render it, and how to add to it. This section is in the documentation guide. + + + + + + +In docbook terminology, each of the three divisions is a book. Inside each +book are a series of chapters. A chapter may be divided into sections, and +each section is divided into more sections. Eventually we will add fancy +things like a table of contents, index, and glossary, when we learn how. + + + + +Docbook Basics + +Some of the most commonly used docbook patterns are described here +for quick reference. For all the details (sometimes more than you +wanted), try &docbookTDG; by Norman Walsh and Leonard Muellner, which O'Reilly +& Associates has generously placed on their web site. In this section, +many of the SGML tags are linked to the page of Walsh's book that describes +that tag in detail. + + +
Small Tutorial + + +Docbook files are text files containing SGML. If you have ever looked +at HTML, then a docbook file will look familiar. Not the same, but familiar. +The easiest way of getting familiar with the docbook format is by looking at +examples such as the Bochs documentation itself. When you compare the source +code to the rendered documentation on the web site, it will be pretty obvious +what all the codes are doing. HTML is very forgiving about breaking the syntax +rules, such as not putting </h1> at then end of an <h1> section. +SGML is picky; if you forget that kind of thing in SGML, it will insist that +you fix it. + + + +Every paragraph must begin with the <para> tag and end with the +corresponding end tag, </para>. + +<para> +This is a paragraph. +</para> + + + + +A chapter looks like this: + +<chapter> + <title>title of the chapter</title> + text of the chapter +</chapter> + +The text of the chapter must contain at least one complete <para> tag, +and it can include <section>s. + + + +A section looks like this: + +<section> + <title>title of the section</title> + text of the section +</section> + +The text of the section must contain at least one complete <para> tag, +and it can include other <section>s. + + + +To make a link to any URL, use the syntax: + +<ulink url="URL">text of the hyperlink</ulink> + + +However, if you like to link to another target inside the same document, +for example to a section, use something like that: + +<section id="unique identifier"> + All stuff that is needed here... +</section> +... +<link linkend="unique identifier to link to">text of hyperlink</link> + + + + +To include a picture in the text, use the <graphic> tag. In SGML, this +graphic tag has no closing tag. + +<graphic format="fmt" fileref="filename"> + +The fmt can be one of many formats including GIF, +JPG, PNG, PS, and EPS. The filename should be on the local disk. If there is +a pathname, it should be relative to the source file or it won't be found on +anyone's system other than yours. + + + +There are over 300 tags defined in the latest version of docbook, so +we won't try to list them all here. Once you get the idea, you can +either find examples in the rest of the documentation that do what you +need, or look at Walsh and Muellner's +DocBook: The Definitive Guide +for more details. + + +
+ +
References and Other Tutorials + + +Docbook was created more than 10 years ago, but since 1999, Docbook has been +under the guidance of the DocBook Technical Committee at OASIS. The +OASIS website +distributes the official DocBook DTDs, and has pages on Docbook history, +samples, tools, and runs a few docbook mailing lists. + + + +Since the Linux Documentation Project uses docbook, they have written some +good tutorial material. In particular the LDP Author Guide, by Jorge Godoy +is very good. + + + +O'Reilly & Associates publishes a book called DocBook: The Definitive +Guide by Norman Walsh and Leonard Muellner. You can buy it or read it +online. Norman Walsh knows what he's talking about, since he is the chair of +the DocBook Technical Committee. This is good for reference, since it has a +complete list of tags and their grammar. + + + +DocBook +HOWTO, also by Jorge Godoy + + + +An article on lwn.net called Exploring SGML Docbook +focuses mostly on installation of tools from scratch: openjade, Norman Walsh's +DSSSL stylesheets, and jade2tex. If you can get the tools from RPMs or +whatever package your OS uses, use that instead. + + +
+ +
+ +Conventions + +Put a &FIXME; near things that need to be fixed up. A &FIXME; causes +the under construction symbol to appear, like this &FIXME;. + + + +A &NEEDHELP; indicates, that you need someone's help in order to document +something, you don't know for sure. This is mostly the case if you need inside +information from a developer. The symbol looks like this: &NEEDHELP;. + + + +Don't get confused because &FIXME; looks the same as &NEEDHELP; - +this is just for the moment. When you like to use one of them, think of what +it should mean, instead of how it looks like: Take &FIXME; if you have +great ideas of what to document, but have no time or no knowledge about it, or +just noticed something wrong or outdated. &NEEDHELP; instead should be used +to request help on something (see above). + + + +This is just a first try to clearify the difference between +&NEEDHELP; and &FIXME;. + + + +To maintain a consistent spelling, some "problem words" are mentioned here, +along with a hint on how to spell them. + + list of problem words + + + + Bochs + Bochs is written with a leading capital letter. + + + bochsrc + + This is what the Bochs configuration file should be refered as. It is a good + compromise between what is common on Unix and what is possible on Windows + (file names starting with a dot aren't easy to create). Remember to use + <filename>bochsrc</filename>. + + + + CD-ROM + This abbreviation is written in all capital letters, with a hyphen in between. + + + Unix + + Unix is written using a leading capital letter, followed by all lower-case letters. + See the Unix entry in Wikipedia. + + + + +
+
+ + +&FIXME; SGML docbook...lower case elements...indentation...remarks...master document/include files + +
+ +Reading and Writing + + +The DocBook source code -- user.dbk, for example -- is a plain text file that +can be directly edited and saved with any text editor such as emacs or vi. + + + + +If you just want to read the documentation, you should not +need to read and understand this section, and render the docs yourself. The +&bochswebsite; has all this information in readable form already. + + + + +To render DocBook source code into the nice readable form the end-user will +require, several tools are needed. These tools allow the .dbk file to be +rendered into such formats as HTML, PDF, and PostScript. This section +describes the tools you need and the steps you take to render the Bochs +documentation. + + + + +The rendering process is one-way. That is, the DocBook source files will be +downloaded from SVN, edited, and uploaded to SVN as .dbk files. Along the +way, it will probably be necessary to render them into HTML, but only to +check one's work or to post them as part of a web page. (I hope I'm not the +only person to spend nine minutes trying to figure out how to 'compile' HTML +into DocBook format.) + + + + +Jade and DSSSL + +Here is what the Linux Documentation Project says about jade: + +
+ + LDP author's guide + + + Jade is the front-end processor for SGML and XML. It uses the DSSSL and + DocBook DTD to perform the verification and rendering from SGML and XML into + the target format. + +
+
+ + +What does all this mean? +For purposes of Bochs documentation, jade reads the docbook source file and +writes out a HTML/PDF/PS file. Bochs documentation is in SGML format, though +apparantly jade can handle XML Docbooks as well. DSSSL stands for +Document Style Semantics and Specification Language, and it +tells jade how to translate the docbook tags into the target format. DSSSL +files are written in the Scheme programming language, which is a variant of +LISP. Learn more about DSSSL at Jim Clark's DSSSL page. +The DocBook DTD is the formal description of what elements and attributes can +be used in a docbook. + + + +Installation + + +The easiest way to get jade working in Linux is to install packages. The +recent RedHat, Suse, and Mandrake Linux distributions all include +openjade and SGML tools. If you can get the right packages installed, +you may save yourself a few hours of compiling and configuring from scratch. +For plex86, which also uses docbook, Kevin Lawton listed the packages that +he installed on Mandrake to get jade working: + + + jadetex-3.5-2mdk + openjade-1.3-10mdk + docbook-dtd31-sgml-1.0-3mdk + docbook-utils-0.6-1mdk + docbook-style-dsssl-1.62-4mdk + docbook-dtd412-xml-1.0-3mdk + sgml-common-0.2-4mdk + xml-common-0.1-3mdk + + +Under Debian, the following packages seem to be a bare minimum to install +DocBook and get it to render Bochs documentation into reader-friendly formats: + + + jade + docbook + docbook-dsssl + + +It's worth mentioning that, at the time of this writing, at least some of +the above-mentioned packages were in the testing or unstable branches of +Debian. + + + +Under FreeBSD, just install the following ports: + + + textproc/jade + textproc/dsssl-docbook-modular + textproc/docbook-410 + + + + + +Hopefully, the required packages on other Linux distributions have +similar names. If you have jade working, please tell a documentation +writer the package names that you used so that we can include it in the docs. +&NEEDHELP; + + + +If you cannot get jade to work using packages, you need to find and install +three things: the DocBook DTD version 4.1 from &OASIS;, the program +jade +(or openjade), and the +Docbook DSSSL +stylesheets for the formats that you want to render to. The whole +process is described in &docbookTDG; in Appendix III section A. If you want +to render to PostScript or Adobe PDF, you also need to install TeX and +and some associated tools. It is a nontrivial process. + + + + +Just use the packages. + + + + +For now, building the Bochs documentation also depends on some scripts called +docbook2html, docbook2pdf, and docbook2ps. These come from the docbook-tools +project at http://sources.redhat.com/docbook-tools. + + + + + +Using jade with docbook2x scripts + + +Check to see if you have the docbook2ps, docbook2pdf, and docbook2html +scripts. If so, you can probably use the Bochs Makefile. Just do + + cd $BOCHS/doc/docbook + make + +It should render three docbook books, one in user, one in development, and one +in and documentation. If there are no errors, look for the user guide +in $BOCHS/doc/docbook/user/user.pdf, +$BOCHS/doc/docbook/users/user.ps, and +$BOCHS/doc/docbook/users/book1.html. The HTML is broken +into lots of little chunks that link to each other, but book1.html is the first +one. + + + + +Using jade directly + +If you don't have docbook2format scripts, you +can also run jade manually. The command is long, so you may want to make +your own script or edit your copy of the makefile. These commands assume that +you installed Norman Walsh's DSSSL stylesheets in $DSSSL. +To render the user's guide into HTML, type: + + cd $BOCHS/doc/docbook/user + jade -t sgml -d $DSSSL/html/docbook.dsl user.dbk + +Or, if you want to render the developer's guide into TeX format, + + cd $BOCHS/doc/docbook/developer + jade -t tex -d $DSSSL/print/docbook.dsl developer.dbk + +Or, if you want to render the documentation guide into Rich Text Format, + + cd $BOCHS/doc/docbook/documentation + jade -t rtf -d $DSSSL/print/docbook.dsl documentation.dbk + +I believe that the HTML stylesheet must have "-t sgml" but the print +stylesheet in the second example can have "-t rtf" for Rich Text Format, +"-t tex" for TeX, or "-t mif" for MIF. + + + +Bochs has the convention of calling the docbook files +name.dbk, but any file name would work. Some +other people call them NAME.sgm for SGML. + + + + + +Configuration + +If the generated HTML files do not have the same names as the Bochs documentation +on the web, some kind of configuration is required. You need to edit the DSL file +to make sure the following settings are used. + +(define %root-filename% "index") ;; name for the root html file +(define %html-ext% ".html") ;; default extension for html output files +(define %html-prefix% "") ;; prefix for all filenames generated (except root) +(define %use-id-as-filename% #t) ;; if #t uses ID value, if present, as filename + ;; otherwise a code is used to indicate level + ;; of chunk, and general element number + ;; (nth element in the document) +(define use-output-dir #f) ;; output in separate directory? + + + +If you like to have the screen sections shaded, this setting should help. + +(define %shade-verbatim% #t) + + + + +
+ + Nsgmls + + +The Bochs documentation is written in SGML docbook style, so any tool which can +check SGML syntax can be used to check the docbook. The DTD (data type +description) for docbook tells exactly which elements can be used and where. +It says which attributes are required and which are optional, and how elements +should be nested. The term "validate" has a specific meaning in SGML. When +you validate a SGML document, it means that you read the DTD and then check +that the document conforms to all the rules of the DTD. + + + +A program called nsgmls, written by James Clark jjc@jclark.com, +can validate an SGML document such as our docbook. Although nsgmls can do many +other things, this command will validate the docbook against the DTD which +defines the syntax: + + nsgmls + -s + filename + + + + +Nsgmls is part of SP, a "free object-oriented toolkit for SGML parsing and +entity management" by James Clark jjc@jclark.com. SP can be +found at +http://www.jclark.com/sp. +There is a complete man page for nsgmls +here. + + + + +
+ +
diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/index.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/index.html new file mode 100644 index 0000000..37372cb --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/index.html @@ -0,0 +1,189 @@ + +Bochs Documentation Manual

  Next
  Layout of Bochs Documentation
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/layout.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/layout.html new file mode 100644 index 0000000..4a2cb26 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/layout.html @@ -0,0 +1,164 @@ + +Layout of Bochs Documentation
Bochs Documentation Manual
PrevNext

Chapter 1. Layout of Bochs Documentation

The Bochs documentation is divided into three major divisions: +

  • The User's Guide introduces the Bochs Emulator, and covers installation and use. +

  • Developer's Guide: Describes the internals of the Bochs Emulator for developers. +

  • Documentation Guide: Describes how the documentation is organized, and how to render it, and how to add to it. This section is in the documentation guide. +

+

In docbook terminology, each of the three divisions is a book. Inside each +book are a series of chapters. A chapter may be divided into sections, and +each section is divided into more sections. Eventually we will add fancy +things like a table of contents, index, and glossary, when we learn how.


PrevHomeNext
Bochs Documentation Manual Docbook Basics
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/nsgmls.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/nsgmls.html new file mode 100644 index 0000000..e81c33c --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/nsgmls.html @@ -0,0 +1,184 @@ + +Nsgmls
Bochs Documentation Manual
PrevChapter 4. Reading and Writing 

4.2. Nsgmls

The Bochs documentation is written in SGML docbook style, so any tool which can +check SGML syntax can be used to check the docbook. The DTD (data type +description) for docbook tells exactly which elements can be used and where. +It says which attributes are required and which are optional, and how elements +should be nested. The term "validate" has a specific meaning in SGML. When +you validate a SGML document, it means that you read the DTD and then check +that the document conforms to all the rules of the DTD.

A program called nsgmls, written by James Clark <jjc@jclark.com>, +can validate an SGML document such as our docbook. Although nsgmls can do many +other things, this command will validate the docbook against the DTD which +defines the syntax: +

nsgmls -s filename

Nsgmls is part of SP, a "free object-oriented toolkit for SGML parsing and +entity management" by James Clark <jjc@jclark.com>. SP can be +found at +http://www.jclark.com/sp. +There is a complete man page for nsgmls +here.


PrevHome 
Reading and WritingUp 
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/reading-writing.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/reading-writing.html new file mode 100644 index 0000000..24bec74 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/reading-writing.html @@ -0,0 +1,521 @@ + +Reading and Writing
Bochs Documentation Manual
PrevNext

Chapter 4. Reading and Writing

The DocBook source code -- user.dbk, for example -- is a plain text file that +can be directly edited and saved with any text editor such as emacs or vi.

Tip: If you just want to read the documentation, you should not +need to read and understand this section, and render the docs yourself. The +Bochs web site has all this information in readable form already.

To render DocBook source code into the nice readable form the end-user will +require, several tools are needed. These tools allow the .dbk file to be +rendered into such formats as HTML, PDF, and PostScript. This section +describes the tools you need and the steps you take to render the Bochs +documentation.

Tip: The rendering process is one-way. That is, the DocBook source files will be +downloaded from CVS, edited, and uploaded to CVS as .dbk files. Along the +way, it will probably be necessary to render them into HTML, but only to +check one's work or to post them as part of a web page. (I hope I'm not the +only person to spend nine minutes trying to figure out how to 'compile' HTML +into DocBook format.)

4.1. Jade and DSSSL

Here is what the Linux Documentation Project says about jade: + +
 

Jade is the front-end processor for SGML and XML. It uses the DSSSL and + DocBook DTD to perform the verification and rendering from SGML and XML into + the target format. +

 
-- LDP author's guide +  

What does all this mean? +For purposes of Bochs documentation, jade reads the docbook source file and +writes out a HTML/PDF/PS file. Bochs documentation is in SGML format, though +apparantly jade can handle XML Docbooks as well. DSSSL stands for +"Document Style Semantics and Specification Language", and it +tells jade how to translate the docbook tags into the target format. DSSSL +files are written in the Scheme programming language, which is a variant of +LISP. Learn more about DSSSL at Jim Clark's DSSSL page. +The DocBook DTD is the formal description of what elements and attributes can +be used in a docbook.

4.1.1. Installation

The easiest way to get jade working in Linux is to install packages. The +recent RedHat, Suse, and Mandrake Linux distributions all include +openjade and SGML tools. If you can get the right packages installed, +you may save yourself a few hours of compiling and configuring from scratch. +For plex86, which also uses docbook, Kevin Lawton listed the packages that +he installed on Mandrake to get jade working: + +
  jadetex-3.5-2mdk
+  openjade-1.3-10mdk
+  docbook-dtd31-sgml-1.0-3mdk
+  docbook-utils-0.6-1mdk
+  docbook-style-dsssl-1.62-4mdk
+  docbook-dtd412-xml-1.0-3mdk
+  sgml-common-0.2-4mdk
+  xml-common-0.1-3mdk
+ +Under Debian, the following packages seem to be a bare minimum to install +DocBook and get it to render Bochs documentation into reader-friendly formats: + +
  jade
+  docbook
+  docbook-dsssl
+ +It's worth mentioning that, at the time of this writing, at least some of +the above-mentioned packages were in the testing or unstable branches of +Debian.

Under FreeBSD, just install the following ports: + +
  textproc/jade
+  textproc/dsssl-docbook-modular
+  textproc/docbook-410
+ + The generated HTML output doesn't look exactly the same as the Bochs +documentation on the web, so it seems as if some kind of configuration is still +needed.

Hopefully, the required packages on other Linux distributions have +similar names. If you have jade working, please tell a documentation +writer the package names that you used so that we can include it in the docs. +

If you cannot get jade to work using packages, you need to find and install +three things: the DocBook DTD version 4.1 from OASIS, the program +jade +(or openjade), and the +Docbook DSSSL +stylesheets for the formats that you want to render to. The whole +process is described in DocBook: The Definitive Guide in Appendix III section A. If you want +to render to PostScript or Adobe PDF, you also need to install TeX and +and some associated tools. It is a nontrivial process.

Tip: Just use the packages.

For now, building the Bochs documentation also depends on some scripts called +docbook2html, docbook2pdf, and docbook2ps. These come from the docbook-tools +project at http://sources.redhat.com/docbook-tools.

4.1.2. Using jade with docbook2x scripts

Check to see if you have the docbook2ps, docbook2pdf, and docbook2html +scripts. If so, you can probably use the Bochs Makefile. Just do +
  cd $BOCHS/doc/docbook
+  make
+It should render three docbook books, one in user, one in development, and one +in and documentation. If there are no errors, look for the user guide +in $BOCHS/doc/docbook/user/user.pdf, +$BOCHS/doc/docbook/users/user.ps, and +$BOCHS/doc/docbook/users/book1.html. The HTML is broken +into lots of little chunks that link to each other, but book1.html is the first +one.

4.1.3. Using jade directly

If you don't have docbook2format scripts, you +can also run jade manually. The command is long, so you may want to make +your own script or edit your copy of the makefile. These commands assume that +you installed Norman Walsh's DSSSL stylesheets in $DSSSL. +To render the user's guide into HTML, type: +
  cd $BOCHS/doc/docbook/user
+  jade -t sgml -d $DSSSL/html/docbook.dsl user.dbk
+Or, if you want to render the developer's guide into TeX format, +
  cd $BOCHS/doc/docbook/developer
+  jade -t tex -d $DSSSL/print/docbook.dsl developer.dbk
+Or, if you want to render the documentation guide into Rich Text Format, +
  cd $BOCHS/doc/docbook/documentation
+  jade -t rtf -d $DSSSL/print/docbook.dsl documentation.dbk
+I believe that the HTML stylesheet must have "-t sgml" but the print +stylesheet in the second example can have "-t rtf" for Rich Text Format, +"-t tex" for TeX, or "-t mif" for MIF.

Bochs has the convention of calling the docbook files +name.dbk, but any file name would work. Some +other people call them NAME.sgm for SGML.


PrevHomeNext
Conventions Nsgmls
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/references.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/references.html new file mode 100644 index 0000000..5fe8e28 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/documentation/references.html @@ -0,0 +1,188 @@ + +References and Other Tutorials
Bochs Documentation Manual
PrevChapter 2. Docbook BasicsNext

2.2. References and Other Tutorials

Docbook was created more than 10 years ago, but since 1999, Docbook has been +under the guidance of the DocBook Technical Committee at OASIS. The +OASIS website +distributes the official DocBook DTDs, and has pages on Docbook history, +samples, tools, and runs a few docbook mailing lists.

Since the Linux Documentation Project uses docbook, they have written some +good tutorial material. In particular the LDP Author Guide, by Jorge Godoy +is very good.

O'Reilly & Associates publishes a book called DocBook: The Definitive +Guide by Norman Walsh and Leonard Muellner. You can buy it or read it +online. Norman Walsh knows what he's talking about, since he is the chair of +the DocBook Technical Committee. This is good for reference, since it has a +complete list of tags and their grammar.

DocBook +HOWTO, also by Jorge Godoy

An article on lwn.net called Exploring SGML Docbook +focuses mostly on installation of tools from scratch: openjade, Norman Walsh's +DSSSL stylesheets, and jade2tex. If you can get the tools from RPMs or +whatever package your OS uses, use that instead.


PrevHomeNext
Docbook BasicsUpConventions
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/images/dlxlinux-in-linux.png b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/images/dlxlinux-in-linux.png new file mode 100644 index 0000000..4897b46 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/images/dlxlinux-in-linux.png differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/images/headerbar.png b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/images/headerbar.png new file mode 100644 index 0000000..43f9050 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/images/headerbar.png differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/images/undercon.png b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/images/undercon.png new file mode 100644 index 0000000..d2be179 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/images/undercon.png differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/index.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/index.html new file mode 100644 index 0000000..6257992 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/index.html @@ -0,0 +1,42 @@ + + + +Bochs Documentation + + + + + +

Bochs Documentation

+

+ +The documentation is divided into three parts: +

+ + diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bios-tips.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bios-tips.html new file mode 100644 index 0000000..a5bb83c --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bios-tips.html @@ -0,0 +1,610 @@ + +BIOS Tips
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.14. BIOS Tips

8.14.1. Booting from CD-ROMs

A bootable CD-ROM has a special layout that is detected by the +BIOS boot loader code, and executed if it conforms the specifications. +This layout is called "El Torito Bootable CD-ROM Format Specification" +and has been published by Phoenix and IBM. A copy of this spec is on +Bochs tech specs page. +

El Torito specifies 3 ways to have a bootable CD: +

  • floppy emulation boot: A standard floppy image is burnt on the CD. +In this case the BIOS has to redirect all first floppy accesses to this +image and the real floppy drive becomes the second one.

  • a "no emulation" boot: In this case the BIOS is instructed to load an +arbitrary number of sectors straight into memory, and execute it.

  • hard disk emulation: A hard disk image is burnt on the CD. The +BIOS has to redirect all hard disk accesses to that image. The real hard disks +are still available, with BIOS numbers 81h and up.

+ +In Bochs 2.0, hard disk emulation is not implemented in the BIOS. +There are also subtilities about multiple boot-images CD-ROMs, that are +not handled by Bochs. +

However, our BIOS may be more strict than real PC BIOSes, I don't know. +But I would definitely be interested to know of any CD that can boot +on real hardware, but does not in Bochs. +

When failing to boot from CD-ROM, the BIOS outputs +the reason of the failure as +an error code, in the log file, and on the screen. +

Here is a summary of what can happen when booting from the CD. +

Table 8-1. CD Boot error codes

Error codeReason
0x01 no atapi device found
0x02 no atapi cdrom found
0x03 can not read cd - BRVD
0x04 cd is not eltorito (BRVD)
0x05 cd is not eltorito (ISO TAG)
0x06 cd is not eltorito (ELTORITO TAG)
0x07 can not read cd - boot catalog
0x08 boot catalog : bad header
0x09 boot catalog : bad platform
0x0A boot catalog : bad signature
0x0B boot catalog : bootable flag not set
0x0C can not read cd - boot image

0x01 no atapi device found
+0x02 no atapi cdrom found
+ +For the first two errors, an ata-*: type=cdrom is probably missing +from the configuration file. This is what you get if no cdrom has +been defined in Bochs conf file.

0x03 can not read cd - BRVD
+ +For this error, the cdrom support has not been compiled in Bochs, +or Bochs could not open the file or device. This is what you get if +Bochs is not able to read the cd.

0x04 cd is not eltorito (BRVD)
+0x05 cd is not eltorito (ISO TAG)
+0x06 cd is not eltorito (ELTORITO TAG)
+ +For these errors, the data has been read from the cd, but +the cd does not conform to the El Torito specification. This +is what you get if the cd is not bootable.

0x08 boot catalog : bad header
+0x09 boot catalog : bad platform
+0x0A boot catalog : bad signature
+0x0B boot catalog : bootable flag not set
+ +now the cd is eltorito, but the boot catalog is currupt, or +the cd was made to boot on a ppc system. This should not happen +for a x86 bootable cd.

0x07 can not read cd - boot catalog
+0x0C can not read cd - boot image
+here, specific part of the cd could not be read. This should +definitely not happen.

8.14.2. Disk translation

Since the beginning of the PC era, disks have grown in size by a factor of 10000. Due to +differences between the ATA specification and BIOSes implementations, when disks reached +critical sizes, it +became necessary to translate the CHS geometry (cylinders, heads, sectors per track) +between the BIOS (int 13h) and the ATA interface. Please refer to the +ATA-FAQ +and +Hale Landis' document +for a complete discussion of the problem. +

Unfortunately, there has never been any standard on the translation algorithms. +

Bochs implements 4 well-known algorithms, selectable in the configuration file +in the "ataX-xxxx: ..., translation='algorithm'" section. +

Table 8-2. Disk translation algorithms

AlgorithmMaximum disk sizeMaximum logical and physical geometry (CHS)Description
none528MB (1032192 sectors) LCHS:1024/16/63 + PCHS:1024/16/63 + no translation is done. The CHS received at the int13h interface + is sent as is to the ATA interface. +
large4.2GB (8257536 sectors) LCHS:1024/128/63 + PCHS:8192/16/63 + a standard bitshift algorithm (named Extended-CHS) + is used to translate the CHS between + the int13h interface + and the ATA interface. The translation is acheived by + multiplying/dividing the cylinder/head count by a power of 2 + (2, 4 or 8). + (a factor of 16 could not be used because the + head count would become 256, and MS-DOS thought this was 0) + Note that the number of sectors per track is not changed, so + a lower spt value will lead to a lower maximum disk size. +
echs  synonym for large
rechs7.9GB (15482880 sectors) LCHS:1024/240/63 + PCHS:15360/16/63 + a revised bitshift algorithm (called Revised Extended-CHS) + is used to translate the CHS between + the int13h interface + and the ATA interface. First the number of physical heads is forced to + 15, and the number of cylinders is adjusted accordingly. + Then, as in the simple extended CHS algorithm, the translation + is acheived by + multiplying/dividing the cylinder/head count by a power of 2 + (2, 4, 8 or 16). + The head count being forced to 15, it can safely be multiplied by 16 + without crashing dos. + Note that the number of sectors per track is not changed, so + a lower spt value will lead to a lower maximum disk size. +
lba8.4GB (16450560 sectors) LCHS:1024/255/63 + PCHS:16320/16/63 + a LBA-assisted algorithm + is used to translate the CHS between + the int13h interface + and the ATA interface. The translation is acheived by + first computing the physical size of the disk (LBA=C*H*S). + Then the sectors per track is forced to 63, and the head count + to 255. Then the cylinder count is computed (C=LBA/(63*255)) + Note that the number of sectors per track is forced to 63 + in the logical geometry, regardless of the actual geometry + reported by the disk. + Also note that the LBA-assisted algorithm has nothing to do with + LBA access at the ATA interface. +
auto  the best suited algorithm between none, large and lba is used

Setting a specific CHS translation should be done if you use a disk dump +of an actual disk, or use a real disk as a block device. You need to +know which geometry was used to format the disk, and which translation +was used. You must not set the translation to 'auto'. +

Note: rechs translation should only be useful for compaq users who wants to +use a disk as a block device. Please report if you know any other +system that use such translation. +

If you plan to create a new disk image (for example with bximage), +format it and install an OS on it, select the "auto" translation +for an automatic selection +of the best algorithm based on the disk image size. Be warned that an image created +with the "auto" translation might not be readable with previous versions of Bochs. +Upward compatibility will be maintained. +

Note: This translation applies only to int13h BIOS disk accesses. Older OSes (e.g. MS-DOS) +tend to use them a lot. On modern OSes, disk accesses through BIOS int13h are +limited to boot loaders. +The usual rules and tricks of the installed OS still apply (ie 1024 cylinders boot limit).


PrevHomeNext
Using the serial portUpHow to enter special key combination
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochs-announce.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochs-announce.html new file mode 100644 index 0000000..2e094a5 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochs-announce.html @@ -0,0 +1,187 @@ + +bochs-announce mailing list
Bochs User Manual
PrevChapter 7. Mailing ListsNext

7.2. bochs-announce mailing list

Bochs-announce is a moderated, low-traffic list which carries only periodic +announcements of Bochs releases and important events. If you have a very +important and truly relevant Bochs announcement, you can try posting it to +bochs-announce, but the moderator will have to approve it before it will +go out. On average, bochs-announce subscribers get one or two messages +per month. There are about 75 subscribers. Anyone may join the list.

To subscribe, go to the Bochs-Announce Info Page and type your email +address and a password into the web form and click Subscribe. +In a few minutes you will get a confirmation email. Follow the directions in +the email to complete the subscription process. To unsubscribe, go to the +same +page and type your email address in the blank at the bottom and click +on Edit Options. Then type your password and click +Unsubscribe.

There is no need to subscribe to both lists, because all bochs-announce +messages are forwarded to the developers list. If you subscribe to both, you +will get 2 copies of every announcement.

Archive of bochs-announce messages


PrevHomeNext
Mailing ListsUpbochs-cvs mailing list
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochs-cvs.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochs-cvs.html new file mode 100644 index 0000000..e3c238f --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochs-cvs.html @@ -0,0 +1,153 @@ + +bochs-cvs mailing list
Bochs User Manual
PrevChapter 7. Mailing ListsNext

7.3. bochs-cvs mailing list

This is the cvs commit mailinglist (a unified diff email will be sent +whenever someone does a checkin in the bochs cvs repository).

Archive of bochs-cvs messages


PrevHomeNext
bochs-announce mailing listUpMailing List Etiquette
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochs-linux-disktools.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochs-linux-disktools.html new file mode 100644 index 0000000..9b2640c --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochs-linux-disktools.html @@ -0,0 +1,149 @@ + +Bochs GNU/Linux DiskTools
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.3. Bochs GNU/Linux DiskTools

+Bochs tools are external tools developped by ..., and useful to copy +to / from guest partition from a GNU/Linux host.


PrevHomeNext
Use mtools to manipulate disk imagesUpWin32 only: Tools to manipulate disk images
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochsrc.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochsrc.html new file mode 100644 index 0000000..be64788 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/bochsrc.html @@ -0,0 +1,2558 @@ + +bochsrc
Bochs User Manual
PrevChapter 4. SetupNext

4.2. bochsrc

Bochs uses a configuration file called bochsrc to know +where to look for disk images, how the Bochs emulation layer should work, etc. +When you first start up Bochs, it looks around for its configuration file +(see Section 5.2), and parses it. +Here are a few lines from a sample file: +
  ata0-master: type=disk, path="30M.sample", cylinders=615, heads=6, spt=17
+  boot: disk
+The format is very strict, so be sure to put the right number of spaces and +use lowercase letters. As you can see, most lines have a keyword telling what +is being configured, followed by a colon, followed by a few +variable=value pairs, separated by +commas. For very simple options, sometimes just a single value is needed. +The source and binary distributions come with a sample +bochsrc, so you can just copy the sample file and edit the +settings you need to change.

The syntax used for bochsrc can also be used as command line arguments for Bochs. +If you have any spaces in your command line arguments, they should be enclosed +in single quotes, for example: +
  bochs 'boot:floppy' 'floppya: 1_44=a.img, status=inserted'
+For other arguments, see section Command line arguments.

Starting with version 1.3, you can use environment variables in +the bochsrc file, for example: +
  floppya: 1_44="$IMAGES/bootdisk.img", status=inserted
+  boot: floppy
+Starting with version 2.0, two environment variables have a built-in +default value which is set at compile time. $BXSHARE points to the +"share" directory which is typically /usr/local/share/bochs on UNIX +machines. See the $(sharedir) variable in the Makefile for the exact +value. $BXSHARE is used by disk images to locate the directory where +the BIOS images and keymaps can be found. If $BXSHARE is not defined, Bochs +will supply the default value. Also, $LTDL_LIBRARY_PATH points to a list of +directories (separated by colons if more than one) to search in for Bochs +plugins. A compile-time default is provided if this variable is not defined +by the user. On Win32 and MacOSX, the default for the share directory is +determined by a platform-specific specific algorithm. On Win32, we use the +registry to see what directory Bochs and its support files were installed in. +On MacOSX, the share directory is the directory where the application is +located.

Starting with version 2.0, you can can use #include in the bochsrc to read the +configuration from other files. Now it is possible to put platform or +installation defaults in a global config file (e.g. location of rom images). +Put this on top of your config file if the global configuration is stored in /etc: +
 #include /etc/bochsrc

The section below lists all the supported bochsrc options.

4.2.1. megs

Examples: +
  megs: 32
+  megs: 128
+Set the number of megabytes of physical memory you want to emulate. The default +is 32MB; most OS's won't need more than that. The maximum amount of memory +supported is 2048MB.

Note: Due to limitations in the host OS, Bochs fails to allocated even 1024MB on most systems.

4.2.2. cpu

Example: +
  cpu: count=2, ips=10000000
+This defines the parameters of the cpu inside Bochs:

count

Set the number of processors:cores per processor:threads per core when Bochs +is compiled for SMP emulation. Bochs currently supports up to 8 processors. +If Bochs is compiled without SMP support, it won't accept values different from 1. +For more information on SMP see Section 8.8.

quantum

Maximum amount of instructions allowed to execute by processor before +returning control to another cpu. This option exists only in Bochs +binary compiled with SMP support.

reset-on-triple-fault

Reset the CPU when triple fault occur (highly recommended) rather than PANIC. +Remember that if you are trying to continue after triple fault the simulation +will be completely bogus !

ips

Emulated Instructions Per Second. This is the number of IPS that Bochs is +capable of running on your machine. You can recompile Bochs with +--enable-show-ips option enabled, to find your workstation's capability. +Measured IPS value will then be logged into your log file +or in the status bar (if supported by the gui).

IPS is used to calibrate many time-dependent events within the Bochs +simulation. For example, changing IPS affects the frequency of VGA updates, +the duration of time before a key starts to autorepeat, and the measurement +of BogoMips and other benchmarks. The table below lists some typical +IPS settings for different machines[1].

Table 4-1. Example IPS Settings

BochsSpeedMachine/CompilerTypical IPS
2.2.62.6GhzIntel Core 2 Duo with WinXP/g++ 3.4 21 to 25 million
2.2.62.1GhzAthlon XP with Linux 2.6/g++ 3.4 12 to 15 million
2.0.11.6GhzIntel P4 with Win2000/g++ 3.3 5 to 7 million
1.4 650MHzAthlon K-7 with Linux 2.4.x 2 to 2.5 million
1.4 400MHzPentium II with Linux 2.0.x 1 to 1.8 million

4.2.3. romimage

Examples: +
  romimage: file=bios/BIOS-bochs-latest, address=0xe0000
+  romimage: file=$BXSHARE/BIOS-bochs-legacy, address=0xf0000
+  romimage: file=mybios.bin, address=0xfff80000
+  romimage: file=mybios.bin
+The ROM BIOS controls what the PC does when it first powers on. Normally, you +can use a precompiled BIOS in the source or binary distribution called +BIOS-bochs-latest. The default ROM BIOS is usually loaded +starting at address 0xe0000, and it is exactly 128k long. The legacy version of +the Bochs BIOS is usually loaded starting at address 0xf0000, and it is exactly +64k long. +You can also use the environment variable $BXSHARE to specify the location of the BIOS. +The usage of external large BIOS images (up to 512k) at memory top is +now supported, but we still recommend to use the BIOS distributed with Bochs. +The start address is now optional, since it can be calculated from image size.

4.2.4. optromimage1, optromimage2, optromimage3 or optromimage4

Example: +
   optromimage1: file=optionalrom.bin, address=0xd0000
+ +This enables Bochs to load up to 4 optional ROM images.

Be sure to use a +read-only area, typically between C8000 and EFFFF. These optional +ROM images should not overwrite the rombios (located at +F0000-FFFFF) and the videobios (located at C0000-C7FFF).

Those ROM images will be initialized by the BIOS if they contain +the right signature (0x55AA).

It can also be a convenient way to upload some arbitrary code/data +in the simulation, that can be retrieved by the boot loader

4.2.5. vgaromimage

Examples: +
  vgaromimage: file=bios/VGABIOS-elpin-2.40
+  vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
+  vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest-cirrus
+This tells Bochs what VGA ROM BIOS to load (at 0xC0000).

A VGA BIOS from Elpin Systems, Inc. as well as a free LGPL'd VGA BIOS +are provided in the source and binary distributions.

Note: Please check with the vga option to decide + what VGA BIOS to use.

4.2.6. vga

Examples: +
  vga: extension=cirrus
+  vga: extension=vbe
+Here you can specify the display extension to be used. With the value +'none' you can use standard VGA with no extension. Other supported +values are 'vbe' for Bochs VBE (needs VGABIOS-lgpl-latest as +VGA BIOS, see vgaromimage option) +and 'cirrus' for Cirrus SVGA support (needs +VGABIOS-lgpl-latest-cirrus as VGA BIOS).

4.2.7. floppya/floppyb

Examples: +
2.88M 3.5" Floppy:
+  floppya: 2_88=a:, status=inserted
+1.44M 3.5" Floppy:
+  floppya: 1_44=floppya.img, status=inserted
+1.2M  5.25" Floppy:
+  floppyb: 1_2=/dev/fd0, status=inserted
+720K  3.5" Floppy:
+  floppya: 720k=/usr/local/bochs/images/win95.img, status=inserted
+auto-detect:
+  floppya: image=floppy.img, status=inserted
+Floppya is the first drive, and floppyb is the second drive. If you're booting +from a floppy, floppya should point to a bootable disk. To read from a disk +image, write the name of the image file. In many operating systems Bochs can +read directly from a raw floppy drive. For raw disk access, use the device +name (Unix systems) or the drive letter and a colon (Windows systems).

Following floppy disk types are supported: 2_88, 1_44, 1_2, 720k, 360k, 320k, 180k, +160k, as well as "image" to let Bochs auto-detect the type of floppy disk (does only +work with images, not with raw floppy drives).

You can set the initial status of the media to ejected +or inserted. Usually you will want to use +inserted. In fact Bryce can't think of any reason +to ever write ejected in your bochsrc.

4.2.8. ata0, ata1, ata2, ata3

Examples: +
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
+ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
+ata2: enabled=1, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11
+ata3: enabled=1, ioaddr1=0x168, ioaddr2=0x360, irq=9
+ +These options enables up to 4 ata channels. For each channel +the two base io addresses and the irq must be specified. +ata0 and ata1 areenabled by default, with the values shown above.

4.2.9. ata0-master, ata0-slave, ata1-*, ata2-*, ata3-*

Examples: +
ata0-master: type=disk, path=10M.img, mode=flat, cylinders=306, heads=4, spt=17, translation=none
+ata1-master: type=disk, path=2GB.cow, mode=vmware3, cylinders=5242, heads=16, spt=50, translation=echs
+ata1-slave:  type=disk, path=3GB.img, mode=sparse, cylinders=6541, heads=16, spt=63, translation=auto
+ata2-master: type=disk, path=7GB.img, mode=undoable, cylinders=14563, heads=16, spt=63, translation=lba
+ata2-slave:  type=cdrom, path=iso.sample, status=inserted

This defines the type and characteristics of all attached ata devices: +

Table 4-2. ata devices configuration options

OptionCommentsPossible values
type type of attached device [disk | cdrom]
path path of the image  
mode image type, only valid for disks [flat | concat | external | dll | sparse | vmware3 | vmware4 | undoable | growing | volatile ]
cylinders only valid for disks  
heads only valid for disks  
spt only valid for disks  
status only valid for cdroms [inserted | ejected]
biosdetect type of biosdetection [none | auto], only for disks on ata0 [cmos]
translation type of translation done by the BIOS (legacy int13), only for disks [none | lba | large | rechs | auto]
model string returned by identify device ATA command  

You have to tell the type of the attached device. For Bochs 2.0 or later, it can be + disk or cdrom.

You have to point the "path" at a hard disk image file, cdrom iso file, +or physical cdrom device. +To create a hard disk image, try running bximage (see +Section 8.1). It will help you choose the size and +then suggest a line that works with it.

In Unix it is possible to use a raw device as a Bochs hard disk, +but we don't recommend it for safety reasons. In Windows, there is no easy way.

Disk geometry autodetection works with images created by bximage if CHS is set +to 0/0/0 (cylinders are calculated using heads=16 and spt=63). For other hard +disk images and modes the cylinders, heads, and spt are mandatory.

The disk translation scheme +(implemented in legacy int13 BIOS functions, and used by +older operating systems like MS-DOS), can be defined as: +

  • none : no translation, for disks up to 528MB (1032192 sectors)

  • large : a standard bitshift algorithm, for disks up to 4.2GB (8257536 sectors)

  • rechs : a revised bitshift algorithm, using a 15 heads fake physical geometry, for disks up to 7.9GB (15482880 sectors). (don't use this unless you understand what you're doing)

  • lba : a standard lba-assisted algorithm, for disks up to 8.4GB (16450560 sectors)

  • auto : autoselection of best translation scheme. (it should be changed if system does not boot)

+Please see Section 8.14.2 for a discussion on translation scheme.

The mode option defines how the disk image is handled. Disks can be defined as: +

  • flat : one file flat layout

  • concat : multiple files layout

  • external : developer's specific, through a C++ class

  • dll : developer's specific, through a DLL

  • sparse : stackable, commitable, rollbackable

  • vmware3 : vmware version 3 disk support

  • vmware4 : vmware version 4 disk support

  • undoable : flat file with commitable redolog

  • growing : growing file

  • volatile : flat file with volatile redolog

+Please see Section 8.18 for a discussion on disk modes.

Default values are: +
   mode=flat, biosdetect=auto, translation=auto, model="Generic 1234"

The biosdetect option has currently no effect on the BIOS.

Note: Make sure the proper ata option is enabled when + using a device on that ata channel.

4.2.10. boot

Examples: +
  boot: floppy
+  boot: cdrom, disk
+  boot: network, disk
+  boot: cdrom, floppy, disk
+This defines the boot sequence. You can specify up to 3 boot drives, +which can be 'floppy', 'disk', 'cdrom' or 'network' (boot ROM). +Legacy 'a' and 'c' are also supported.

4.2.11. floppy_bootsig_check

Example: +
  floppy_bootsig_check: disabled=1
+This disables the 0xaa55 signature check on boot floppies +The check is enabled by default.

4.2.12. config_interface

The configuration interface is a series of menus or dialog boxes that +allows you to edit all the settings that control Bochs' behavior. +There are two choices of configuration interface: a text mode version +called "textconfig" and a graphical version called "wx". The text +mode version uses stdin/stdout and is always available while the graphical +version is only available when Bochs is compiled with wxWidgets support, see +Section 3.4.12. If you do not use a config_interface line, Bochs +will choose a default for you (usually textconfig).

Note: wxWidgets provides both a configuration interface and a display library. +So if you use the "wx" configuration interface, you must also use +the "wx" display library, see +display_library option.

Examples: +
  config_interface: textconfig
+  config_interface: wx

4.2.13. display_library

The display library is the code that displays the Bochs VGA screen. Bochs +has a selection of about 10 different display library implementations for +different platforms. If you run configure with multiple --with-* options, +the display_library option lets you choose which one you want to run with. +If you do not use a display_library line, Bochs will choose a default for +you.

Note: wxWidgets provides both a configuration interface and a display library. +So if you use the "wx" display library, you must also use +the "wx" configuration interface, see +config_interface option.

Examples: +
  display_library: x
+  display_library: sdl
+Starting with version 2.2, some display libraries support specific options: +
  display_library: rfb, options="timeout=60"  # time to wait for client
+  display_library: sdl, options="fullscreen"  # startup in fullscreen mode
+  display_library: win32, options="legacyF12" # use F12 to toggle mouse
+  display_library: win32, options="windebug" # use experimental debugger gui

Table 4-3. display_library values

OptionDescription
xuse X windows interface, cross platform
win32use native win32 libraries
carbonuse Carbon library (for MacOS X)
beosuse native BeOS libraries
macintoshuse MacOS pre-10
amigaosuse native AmigaOS libraries
sdluse SDL library, cross platform, + details in Section 3.4.11
svgause SVGALIB library for Linux, allows graphics without X windows
termtext only, uses curses/ncurses library, cross platform
rfbprovides an interface to AT&T's VNC viewer, cross platform, + details in Section 3.4.10
wxuse wxWidgets library, cross platform, + details in Section 3.4.12
noguino display at all

4.2.14. log

Examples: +
  log: bochsout.txt
+  log: -
+  log: /dev/tty               (Unix only)
+  log: /dev/null              (Unix only)
+  log: nul                    (win32 only)
+Give the path of the log file you'd like Bochs debug and misc. verbiage to be +to be written to. If you don't use this option or set the filename to '-' +the output is written to the console. If you really don't want it, +make it "/dev/null" (Unix) or "nul" (win32). :^(

4.2.15. logprefix

Examples: +
   logprefix: %t-%e-@%i-%d
+   logprefix: %i%e%d
+This handles the format of the string prepended to each log line. +You may use those special tokens : +
  %t : 11 decimal digits timer tick
+  %i : 8 hexadecimal digits of current cpu eip (ignored in SMP configuration)
+  %e : 1 character event type ('i'nfo, 'd'ebug, 'p'anic, 'e'rror)
+  %d : 5 characters string of the device, between brackets
+  

Default is %t%e%d

4.2.16. debug/info/error/panic

Examples: +
  debug: action=ignore
+  info: action=report
+  error: action=report
+  panic: action=ask
+ +During simulation, Bochs encounters certain events that the user might want to +know about. These events are divided into four levels of importance: debug, +info, error, and panic. Debug messages are usually only useful when writing +Bochs code or when trying to locate a problem. There may be thousands of debug +messages per second, so be careful before turning them on. Info messages tell +about interesting events that don't happen that frequently. Bochs produces an +"error" message when it finds a condition that really shouldn't happen, but +doesn't endanger the simulation. An example of an error might be if the +emulated software produces an illegal disk command. Panic messages mean that +Bochs cannot simulate correctly and should probably shut down. +A panic can be a configuration problem (like a misspelled bochsrc line) or an +emulation problem (like an unsupported video mode).

The debug, info, error, and panic lines in the bochsrc control what Bochs will +do when it encounters each type of event. The allowed actions are: fatal +(terminate bochs), ask (ask the user what to do), report (print information to +the console or log file), or ignore (do nothing). The recommended settings are +listed in the sample above.

Tip: The safest action for panics is "fatal" or "ask". If you are getting lots of +panics and get tired of telling it to continue each time, you can try +action=report instead. If you allow Bochs to continue after a panic, don't +be surprised if you get strange behavior or crashes after a panic occurs. +Please report panic messages to the bochs-developers mailing list unless it is +just a configuration problem like "could not find hard drive image."

4.2.17. debugger_log

Examples: +
  debugger_log: debugger.out
+  debugger_log: /dev/null              (Unix only)
+  debugger_log: -
+Give the path of the log file you'd like Bochs to log debugger output. +If you really don't want it, make it '/dev/null', or '-'.

4.2.18. com[1-4]

Examples: +
  com1: enabled=1, mode=null
+  com1: enabled=1, mode=mouse
+  com1: enabled=1, mode=term, dev=/dev/ttyp9
+  com2: enabled=1, mode=file, dev=serial.out
+  com3: enabled=1, mode=raw, dev=com1
+  com3: enabled=1, mode=socket, dev=localhost:8888
+ This defines a serial port (UART type 16550A).

When using the mode 'term', you can specify a device to use as com1. + This can be a real serial line, or a pty. To use a pty (under X/Unix), + create two windows (xterms, usually). One of them will run Bochs, and + the other will act as com1. Find out the tty of the com1 window using + the `tty' command, and use that as the `dev' parameter. Then do + `sleep 1000000' in the com1 window to keep the shell from messing with + things, and run Bochs in the other window. Serial I/O to com1 (port 0x3f8) + will all go to the other window.

Other serial modes are 'null' (no input/output), 'file' (output to a file + specified as the 'dev' parameter), 'raw' (use the real serial port - under + construction for win32), 'mouse' (standard serial mouse - requires + mouse option setting 'type=serial' + or 'type=serial_wheel') and 'socket' (connect a networking socket).

4.2.19. parport[1-2]

Examples: +
  parport1: enabled=1, file="parport.out"
+  parport2: enabled=1, file="/dev/lp0"
+  parport1: enabled=0
+This defines a parallel (printer) port. When turned on and an output file is +defined, the emulated printer port sends characters printed by the guest OS +into the output file. On some platforms, a device filename can be used to +send the data to the real parallel port (e.g. "/dev/lp0" on Linux, "lpt1" on +win32 platforms).

4.2.20. sb16

Example: +
  sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, 
+        loglevel=2, log=sb16.log, dmatimer=600000
+

Note: The example is wrapped onto several lines for formatting reasons, but it +should all be on one line in the actual bochsrc file.

+ +This defines the Sound Blaster 16 emulation, see Section 4.3 +for more information. It can have several of the following properties. All properties +are in the usual "property=value" format. + +

  • midi: The filename is where the midi data is sent to. This + can be a device or just a file if you want to record the midi data. + On a Windows host this parameter is ignored when using output to the sound + device. +

  • midimode: +
       0 = No data should be output.
    +   1 = output to device (system dependent - midi denotes the device driver).
    +   2 = SMF file output, including headers.
    +   3 = Output the midi data stream to the file (no midi headers and no
    +       delta times, just command and data bytes).
    +   
    +

  • wave: This is the device/file where wave output is stored. + On a Windows host this parameter is ignored when using output to the sound + device. +

  • wavemode: +
       0 = no data
    +   1 = output to device (system dependent - wave denotes the device driver).
    +   2 = VOC file output, including headers.
    +   3 = Output the raw wave stream to the file.
    +   
    +

  • log: The file to write the sb16 emulator messages to. +

  • loglevel: +
       0 = No log.
    +   1 = Resource changes, midi program and bank changes.
    +   2 = Severe errors.
    +   3 = All errors.
    +   4 = All errors plus all port accesses.
    +   5 = All errors and port accesses plus a lot of extra information.
    +   
    + It is possible to change the loglevel at runtime. +

  • dmatimer: Microseconds per second for a DMA cycle. Make it smaller to fix + non-continuous sound. 750000 is usually a good value. This needs a reasonably + correct setting for the ips paramter of the + cpu option. It is possible to adjust the + dmatimer value at runtime. +

4.2.21. vga_update_interval

Examples: +
  vga_update_interval: 40000 # default
+  vga_update_interval: 250000
+Video memory is scanned for updates and screen updated every so many virtual +microseconds. Keep in mind that you must tweak the ips +parameter of the cpu option to be as close +to the number of emulated instructions-per-second your workstation can do, +for this to be accurate.

4.2.22. keyboard_serial_delay

Example: +
  keyboard_serial_delay: 250 # default
+Approximate time in microseconds that it takes one character to be +transfered from the keyboard to controller over the serial path.

4.2.23. keyboard_paste_delay

Example: +
  keyboard_paste_delay: 100000 # default
+Approximate time in microseconds between attempts to paste +characters to the keyboard controller. This leaves time for the +guest os to deal with the flow of characters. The ideal setting +depends on how your operating system processes characters. The +default of 100000 usec (.1 seconds) was chosen because it works +consistently in Windows.

4.2.24. ips

Examples: +
  ips: 2000000 # default
+  ips: 10000000
+Emulated Instructions Per Second. This option is deprecated. Use the ips +parameter of the cpu option instead.

4.2.25. clock

This defines the parameters of the clock inside Bochs:

sync

TO BE COMPLETED (see Greg's explanation in feature request #536329)

time0

Specifies the start (boot) time of the virtual machine. Use a time +value as returned by the time(2) system call. If no time0 value is +set or if time0 equal to 1 (special case) or if time0 equal 'local', +the simulation will be started at the current local host time. +If time0 equal to 2 (special case) or if time0 equal 'utc', +the simulation will be started at the current utc time.

Syntax:
+  clock: sync=[none|slowdown|realtime|both], time0=[timeValue|local|utc]
+
+Examples:
+  clock: sync=none,     time0=local       # Now (localtime)
+  clock: sync=slowdown, time0=315529200   # Tue Jan  1 00:00:00 1980
+  clock: sync=none,     time0=631148400   # Mon Jan  1 00:00:00 1990
+  clock: sync=realtime, time0=938581955   # Wed Sep 29 07:12:35 1999
+  clock: sync=realtime, time0=946681200   # Sat Jan  1 00:00:00 2000
+  clock: sync=none,     time0=1           # Now (localtime)
+  clock: sync=none,     time0=utc         # Now (utc/gmt)
+
+Default value are sync=none, time0=local

4.2.26. mouse

Examples: +
  mouse: enabled=1
+  mouse: enabled=1, type=imps2
+  mouse: enabled=1, type=serial
+  mouse: enabled=0
+This option prevents Bochs from creating mouse "events" unless a mouse is +enabled. The hardware emulation itself is not disabled by this. You can +turn the mouse on by setting enabled to 1, or turn it off by setting +enabled to 0. Unless you have a particular reason for enabling the mouse +by default, it is recommended that you leave it off. You can also toggle the +mouse usage at runtime (see headerbar).

With the mouse type option you can select the type of mouse to emulate. + The default value is 'ps2'. The other choices are 'imps2' (wheel mouse + on PS/2), 'serial', 'serial_wheel' and 'serial_msys' (one com port requires + setting 'mode=mouse', see com option). + To connect a mouse to an USB port, see the usb1 option + (requires PCI and USB support).

4.2.27. private_colormap

Example: +
  private_colormap: enabled=1
+Requests that the GUI creates and uses its own non-shared colormap. This +colormap will be used when in the Bochs window. If not enabled, a shared +colormap scheme may be used. Once again, enabled=1 +turns on this feature and 0 turns it off.

4.2.28. i440fxsupport

Examples: +
  i440fxsupport: enabled=1 # default if compiled with PCI support
+  i440fxsupport: enabled=1, slot1=pcivga, slot2=ne2k
+This option controls the presence of the i440FX PCI chipset. You can also +specify the devices connected to PCI slots. Up to 5 slots are available. +These devices are currently supported: ne2k, pcivga, pcidev and pcipnic. +If Bochs is compiled with Cirrus SVGA support you'll have the additional +choice 'cirrus'.

4.2.29. pcidev

Example: +
  pcidev: vendor=0xbabe, device=0x2bad
+Enables the mapping of a host PCI hardware device within the virtual PCI +subsystem of the Bochs x86 emulator. The arguments +vendor and device +should contain the PCI vendor ID respectively the PCI +device ID of the host PCI device you want to map within Bochs.

Note: The PCI device mapping is still in a very early stage of development and thus it is very experimental. +This feature requires Linux as a host operating system.

Besides the pcidev config line you will need to load +a pcidev kernel module within your Linux host OS. This kernel module is +located in the bochs/host/linux/pcidev/ directory.

4.2.30. usb1

Examples: +
  usb1: enabled=1, port1=mouse, port2=keypad
+  usb1: enabled=1, port1=tablet, port2=disk:usbdisk.img
+This option controls the presence of the USB root hub which is a part of the +i440FX PCI chipset.

With the portX option you can connect devices +to the hub (currently supported: 'mouse', 'tablet', 'keypad' and 'disk'). +If you connect the mouse or tablet to one of the ports, Bochs forwards the +mouse movement data to the USB device instead of the selected mouse type. +When connecting the keypad to one of the ports, Bochs forwards the input of +the numeric keypad to the USB device instead of the PS/2 keyboard. +To connect a flat image as an USB hardisk you can use the 'disk' device with +the path to the image separated with a colon (see above).

Note: PCI support must be enabled.

4.2.31. gdbstub

Example: +
  gdbstub: enabled=1, port=1234, text_base=0, data_base=0, bss_base=0
+Default: +
  gdbstub: enabled=0
+This enables the GDB stub. See Section 8.12.

4.2.32. ne2k

The ne2k line configures an emulated NE2000-compatible Ethernet adapter, +which allows the guest machine to communicate on the network. To disable +the NE2000 just comment out the ne2k line.

Examples: +
ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xl0
+ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=en0 #macosx
+ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0
+ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=win32, ethdev=MYCARD
+ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vde, ethdev="/tmp/vde.ctl"
+ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vnet, ethdev="c:/temp"
+ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0
+ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun0, script=./tunconfig
+
+ioaddr, irq: You probably won't need to change ioaddr and irq, unless there
+are IRQ conflicts. These parameters are ignored if the NE2000 is assigned to
+a PCI slot.
+
+mac: The MAC address MUST NOT match the address of any machine on the net.
+Also, the first byte must be an even number (bit 0 set means a multicast
+address), and you cannot use ff:ff:ff:ff:ff:ff because that's the broadcast
+address.  For the ethertap module, you must use fe:fd:00:00:00:01.  There may
+be other restrictions too.  To be safe, just use the b0:c4... address.
+
+ethmod: The ethmod value defines which low level OS specific module to be 
+used to access physical ethernet interface. You can also specify a network
+simulator or a module with no input/output ("null"). See the table below for
+currently supported values.
+
+ethdev: The ethdev value is the name of the network interface on your host
+platform.  On UNIX machines, you can get the name by running ifconfig.  On
+Windows machines, you must run niclist to get the name of the ethdev.
+Niclist source code is in misc/niclist.c and it is included in Windows 
+binary releases.
+
+script: The script value is optional, and is the name of a script that
+is executed after bochs initialize the network interface. You can use
+this script to configure this network interface, or enable masquerading.
+This is mainly useful for the tun/tap devices that only exist during
+Bochs execution. The network interface name is supplied to the script
+as first parameter

The following table shows the available ethernet modules with description, +whether the "ethdev" and "script" parameters are used or not and the Bochs +version where this module was added.

Table 4-4. Ethernet modules

ModuleDescriptionethdevscriptBochs version
arpbackARP simulator - disabled by default. + NoNo1.3
fbsdFreeBSD / OpenBSD packetmover. + YesNo1.0
linuxLinux packetmover - 'root' privileges required, + no connection to the host machine. + YesNo1.3
nullNull packetmover. All packets are discarded, but logged to a + few files. + NoNo1.0
tapTAP packetmover. + YesYes1.4
tuntapTUN/TAP packetmover - see Configuring and using a tuntap network interface. + YesYes2.0
vdeVirtual Distributed Ethernet packetmover. + YesYes2.2
vnetARP, ping (ICMP-echo), DHCP and read/write TFTP simulation. The virtual + host uses 192.168.10.1. DHCP assigns 192.168.10.2 to the guest. The TFTP server + uses the ethdev value for the root directory and doesn't overwrite files. + Yes, for TFTPNo2.2
win32Win32 packetmover - WinPCap driver required. + YesNo1.3

4.2.33. keyboard_mapping

Examples: +
  keyboard_mapping: enabled=0, map=
+  keyboard_mapping: enabled=1, map=gui/keymaps/x11-pc-de.map
+This enables a remap of a physical localized keyboard to a +virtualized U.S. keyboard, as the PC architecture expects. +If enabled, the keymap file must be specified. Keyboard mapping is +available for X windows, SDL (Linux port) and wxWidgets (GTK port). +For SDL you have to use keymaps designed for SDL, the wxWidgets GUI +uses the keymaps for X windows.

4.2.34. keyboard_type

Examples: +
  keyboard_type: xt
+  keyboard_type: at
+  keyboard_type: mf
+Type of keyboard returned by a "identify keyboard" command to the +keyboard controller. It must be one of "xt", "at" or "mf". +Defaults to "mf". It should be ok for almost everybody. A known +exception is French macs, that do have a "at"-like keyboard.

4.2.35. user_shortcut

Examples: +
  user_shortcut: keys=ctrl-alt-del
+  user_shortcut: keys=ctrl-alt-esc
+This defines the keyboard shortcut to be sent when you press the "user" button +in the headerbar. The shortcut string is a +combination of maximum 3 key names (listed below) separated with a '-' character. +The old-style syntax (without the '-') still works for the key combinations +supported in Bochs 2.2.1.

Valid key names:

"alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc", +"f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup", "plus", +"right", "shift", "space", "tab", "up", "win" and "print".

4.2.36. cmosimage

Example: +
  cmosimage: file=cmos.img, rtc_init=time0
+This defines image file that can be loaded into the CMOS RAM at startup. +The rtc_init parameter controls whether initialize the RTC with values stored +in the image. By default the time0 argument given to the +clock option is used. With 'rtc_init=image' +the image is the source for the initial time.

4.2.37. magic_break

Example: +
  magic_break: enabled=1
+This enables the "magic breakpoint" feature when using the debugger. +The useless cpu instruction XCHG BX, BX causes Bochs to enter the +debugger mode. This might be useful for software development.

Notes

[1]

IPS measurements depend on +OS and compiler configuration in addition to processor clock +speed.


PrevHomeNext
SetupUpSound Blaster 16 Emulation
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/cirrus-notes.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/cirrus-notes.html new file mode 100644 index 0000000..dedeaea --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/cirrus-notes.html @@ -0,0 +1,209 @@ + +Notes about Cirrus SVGA usage
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.17. Notes about Cirrus SVGA usage

Since Bochs 2.2 it is possible to use Cirrus SVGA graphics. The Cirrus device + supports both ISA and PCI depending on the bochsrc settings. + If PCI is disabled or the Cirrus card is not assigned to a PCI slot, it appears + as a CL-GD5430 ISA with 2MB VRAM. If you assign the Cirrus card to a PCI slot, + it appears as a CL-GD5446 PCI with 4MB VRAM. +

In order to use Cirrus SVGA, you need to compile Bochs using the --enable-clgd54xx + option and enable it in your bochsrc by setting the + vga option to cirrus. + Finally, you need to use the Cirrus version of the + LGPL'd VGABIOS + as vgaromimage option for + applications to correctly detect Cirrus support. +

  # Enable CL-GD5446 PCI
+  vga: extension=cirrus
+  vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest-cirrus
+  i440fxsupport: enabled=1, slot1=cirrus
+  

Note: The VGABIOS is already included in the Bochs release, so no separate download is necessary. +


PrevHomeNext
Notes about VESA usageUpDisk Image Modes
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/common-problems.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/common-problems.html new file mode 100644 index 0000000..4c5542d --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/common-problems.html @@ -0,0 +1,286 @@ + +Common problems and what to do about them (Troubleshooting)
Bochs User Manual
PrevNext

Chapter 6. Common problems and what to do about them (Troubleshooting)

+
      How to report a panic to the bug tracker?
+      Keyboard mapping problems
+      [...]
+    
+

6.1. Bochs panics! What can I do?

Bochs does a very good job in emulating an x86 compatible computer, however, + it does not (yet) include a full (100%) emulation of every possible instruction, + (BIOS) function call or (hardware) device. Thus, in case something unusual + happens, either a not-so-common call to some (BIOS) function or device by + some software running inside of it, Bochs has two possibilities to react: + If the command doesn't look important (mainly happens only to non-implemented + functions in the BIOS), a notice is logged to the log file + and the emulation continues. If, however, the command looks important, Bochs + panics, because the software being emulated might depend on the successful + execution of the given instruction or behaviour of the device. +

A panic does not always mean that the software won't run inside of Bochs, + as the software might just be probing the computer for the presence of some + instruction/device, and in case it is not found, it simply won't be used at + all, by the software. +

You can tell Bochs what to do in case of a panic, by re-configuring the + panic option. If + you change the action to "ask", Bochs reports what has happened and asks + you what to do. The appearance of the "ask" feature depends on the display + library used and the platform. Some display libraries don't support it at all. +

Some of the device names reported in the panic message are abbreviations, + since the length of the names is limited to 5 characters. This small list + may help you finding out the name of the device that caused the panic. +

Table 6-1. Device prefixes

PrefixDescription
CLVGACirrus SVGA
EFIRQExternal FPU IRQ
IOAPI/O APIC
KMAPKeyboard mapping
P2IPCI-to-ISA bridge
PIDEPCI IDE controller
PLGINPlugin interface
STIMESlowdown timer
UNMPUnmapped I/O handler
VTIMEVirtual timer

PrevHomeNext
Save and restore simulation Mouse behavior, enabling and disabling
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/compiling.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/compiling.html new file mode 100644 index 0000000..f85dbee --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/compiling.html @@ -0,0 +1,2377 @@ + +Compiling Bochs
Bochs User Manual
PrevChapter 3. InstallationNext

3.4. Compiling Bochs

3.4.1. Standard Compile

Bochs is written in C++, so you need a C++ compiler on your system. Most +platforms have been tested with GNU gcc/g++, but other compilers are known +to work too. By now, you should have unpacked your source TAR file or checked +out Bochs from CVS. If not, you can return to Downloading Bochs for details. The top level +directory of the source code will be referred to as $BOCHS. ($BOCHS +contains the files bochs.h and +main.cc and subdirectories cpu and +bios.)

The standard compile process has three basic steps: +configure, make, and make +install. Each step is described in a separate section below. The +standard compile process is used on all Unix machines, MacOS X, BeOS, and +Cygwin (win32). There are separate instructions for compiling for Win32 with Microsoft VC++.

3.4.1.1. Configure

There is a script called configure which tests your +machine, C/C++ compiler and libraries to discover what settings should work on +your system. If you run configure with no arguments after +it, defaults will be used for all settings. To change the settings, you can +run configure with options that override the +defaults. You can get a list of valid configure options by typing +configure --help. One useful configure option is +--prefix=directory, which sets the directory in +which Bochs will be installed. All the possible configure options are +documented in a later section. +

Among other things, the configure script tries to detect your platform +and which compile options to use. If you want to control this, set these +environment variables before running configure: CC, +CXX, CFLAGS, +CXXFLAGS. Here is an example that sets the environment +variables, using bash/ksh[1] +syntax: +
  export CC=egcs
+  export CXX="$CC"
+  export CFLAGS="-Wall -O2 -m486 -fomit-frame-pointer -pipe"
+  export CXXFLAGS="$CFLAGS"

Once the configure script knows what options are selected, +it creates a Makefile in every source code directory, and creates +$BOCHS/config.h with all the option values written +as preprocessor #defines. Now the sources are ready to compile.

3.4.1.1.1. Configure Shortcut Scripts

In the Bochs source directory, you will see a series of scripts called +.conf.platform. +These scripts run the configure script for you, with a set of +options that are appropriate for that platform. It is not necessary to +use the shortcut scripts; they are simply there to show you an example that +the developers have used. Some of these scripts have been used to build official +binary packages. + +

Tip: If a shortcut script is "almost right" for you, just edit it and then run it! +If you run a shortcut script, you don't need to run configure manually.

+ +Run a shortcut script using Bourne shell, like this: +
  sh .conf.win32-vcpp
+ +These .conf.platform have +been tested in recent Bochs versions: +
  .conf.linux
+  .conf.sparc
+  .conf.macos
+  .conf.macosx
+  .conf.win32-vcpp
+  .conf.win32-cygwin
+  .conf.AIX.4.3.1
+  .conf.beos

3.4.1.2. Make

The make command compiles Bochs. Make is a program +used by many software projects that reads the Makefile in each source +directory and follows the instructions that it finds there. A Makefile tells +which files depend on which other files, what commands to use to compile and +link the code, and more. After you have finished the configure step, just type +make to build the source code.

The reason that make is so popular is that it is smart about when to compile +and when not to compile. If you run make once, it compiles every file. But +when you run it again, it checks to see if any source files have been modified; +if not, there's nothing to do! For example, the Makefile says that +main.o depends on main.cc. Knowing +this, it will only compile main.cc if it is newer than +main.o.

Of course, make can only do the right thing if the Makefile lists all the +dependencies correctly, so human error can sometimes lead make astray. +If make refuses to build something that you think it should, or you +are getting strange compile errors, try doing make all-clean +and then make again. All-clean means to clean up +the compiled files in every subdirectory, while make clean +means to clean up just the current directory[2]. However, it's important to note that make +all-clean leaves the configuration intact. You do not have +to run configure again.

If you're really in the mood for cleaning, make dist-clean +erases all the configuration information too. In theory, after a dist-clean +your directory should look much like when you first untarred it or checked it +out. There's usually some extra stuff lying around, but the Makefile tries +at least to erase any files that it created.

3.4.1.3. Make Install

Once the program has been built, the next step is typically to run +make install to copy the executables, documentation, and +other required files into a public place so that all users can use it. +By default the files are copied to some directories in /usr/local. The following +tables shows the directories and their contents. +[3]

Table 3-5. Installed files

binbinary executables (bochs, bxcommit, bximage)
lib/bochs/pluginsplugins (if present)
man/man1manpages for installed binaries
man/man5manpage for the config file (bochsrc)
share/bochsBIOS images, VGABIOS images, keymaps
share/doc/bochsHTML docs, license, readme, changes, bochsrc sample

3.4.2. Configure Options

This section describes the configure options for Bochs. Perhaps the most +important option is --help, since it gives you a list of all +the other options. The configure script will detect your platform and choose +the default GUI for your platform. If the default choice is not what you +want, use the --with-* options to override the default. The +options in the first table tell which GUI library is the default for each +platform. Starting in version 2.0, you can use multiple +--with-* options at once to compile with multiple +display libraries, and then choose between them at runtime with the +display_library option +in the configuration file. Or, you can +let the configure script detect which libraries are on your system +and use them all, by configuring with --with-all-libs.

Note: The concept of platform detection and default GUIs was added in Bochs 1.4. +In Bochs 1.3 and before, the X11 GUI was always the default.

Table 3-6. Defaults by Platform

PlatformDefault GUIExtra compile flags
win32 or Cygwin--with-win32If using nmake method, compile using cl /nologo /G6 /MT /W3 /GX /DNDEBUG /DWIN32 /D_WINDOWS /O2. If using Visual C++ workspace, see the workspace file for compile settings. See Compiling on Win32 with Microsoft VC++ for instructions. +
MacOS X or Darwin--with-carbon-fpascal-strings -fno-common -arch ppc -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh +
MacOS 9 or before--with-macosnone +
BeOS--with-beosnone +
AmigaOS--with-amigaosnone +
any other platform--with-x11none +

Table 3-7. Configure Options to Select the Display Library (optional)

OptionComments
--with-x11Use X windows user interface. On many operating systems, + Bochs will use X windows by default. +
--with-win32Use the native Win32 GUI. This is the default on win32 platforms. +
--with-carbonCompile for MacOS X with the Carbon GUI. See the + .conf.macosx file for the correct MacOS X compile options. +
--with-amigaosCompile for Amiga MorphOS. This code is written by Nicholai + Benalal.
--with-rfb Enable support for the RFB protocol to talk to AT&T's + VNC Viewer. + Refer to Section 3.4.10 for details. +
--with-sdlEnable support for the SDL GUI interface; see Section 3.4.11.
--with-beosUse BeOS GUI. The configure script will run natively + on BeOS; use this option when doing so.
--with-termUse text-only gui with curses library. Almost certainly + won't work right with the debugger or the control panel. +
--with-macosUse Macintosh/CodeWarrior environment. This is for running + configure on a platform which supports running configure, so that + you may then transfer the configured code over to the + real compile environment. +
--with-wx Enable support for wxWidgets configuration and display interface; + see Section 3.4.12. +
--with-svgaUse SVGALIB library for Linux. This allows a full-screen + text and graphics display without X windows. The SVGALIB port + was written by Igor Popik. +
--with-noguiNo native GUI; just use blank stubs. This is if you don't + care about having video output, but are just running tests. +
--with-all-libs Automatically detect which libraries are installed on your system + and enable them. This option is still experimental; it might + enable libraries that are not usable and cause the compile to fail. + If you have trouble, just list the --with-* options for the specific + display libraries that you want. +

The remaining options can generally be used with any GUI. For each option +such as --enable-cdrom, you can also write --disable-cdrom to explicitly +turn it off.

Link CPU link to the proper row, not to the beginning of the whole table, as it is now.

Table 3-8. Configure Options

OptionDefaultComments
--enable-cpu-level={3,4,5,6}5 Select which CPU level to emulate. Choices are 3,4,5,6 which mean to + target 386, 486, Pentium, or Pentium Pro emulation. Pentium Pro support + is quite incomplete, so level 5 is the best choice for now. +
--enable-cdromyes Enable use of a real CDROM. The cdrom emulation is always present, and + emulates a drive without media by default. You can use this option to + compile in support for accessing the media in your workstation's cdrom + drive. The supported platforms are Linux, Solaris, FreeBSD, OpenBSD, and Windows. + For other platforms, a small amount of code specific to your platform + must be written. The module iodev/cdrom.cc is the place to add more + support. For the most part, you need to figure out the right set of + ioctl() calls. +
--enable-sb16={dummy}no Enable Sound Blaster emulation. + The dummy option means to support an SB16, but don't + use an output device. By default (without a parameter) the lowlevel sound interface is autodetected. + See section Sound Blaster 16 Emulation + for supported platforms and more info. This option also enables the standard PC gameport which is a + part of the SB16. If you don't want to use it, you might use + --disable-gameport. +
--enable-gameportno Enables the standard PC gameport. This option is only necessary if you want to + have a gameport, but no SB16 (see above). The connection to a real joystick is + currently supported on Linux and win32 only. +
--enable-idle-hackno Enables Roland Mainz's experimental idle code, which is intended to + keep Bochs from always using 100% of CPU time. When Bochs is waiting + around for an interrupt, the idle code uses a select() loop and some + X11 tricks to wait until user input arrives. This is designed to + keep Bochs responsive while still yielding to other processes when + Bochs is idle. It only works with X11 or term GUI. +
--enable-ne2000noEnable NE2000 network card support. This requires a + low-level component to be written for each OS. The NE2000 + option is only supported on FreeBSD, OpenBSD, Linux, and Windows + 95/98/NT/2K. When enabled and configured, the NE2000 device model can + talk to any computer on the network EXCEPT FOR the local host. + Exception: Under most circumstances, Bochs can talk to the local host + on Windows, and in the ethertap interface for Linux. +
--enable-pnicnoEnable PCI pseudo NIC (network card) support.
--enable-vbenoUse VGA BIOS Extensions (VBE) by Jeroen Janssen, see Section 8.16 + for more information. +
--enable-clgd54xxnoEnable Cirrus Logic GD54xx (CL-GD5430 ISA or CL-GD5446 PCI) video + card support. For more information see Section 8.17. +
--enable-fpuyesIf you want to compile Bochs to make use of the FPU emulator + written by Stanislav Shwartsman, use this option. +
--enable-pluginsno Plugins are shared libraries that can be loaded on demand. Example: the + serial device is implemented as a plugin. In Unix, the serial plugin is + called libbx_serial.so. When Bochs reads its configuration file, if the + serial device is enabled it loads libbx_serial.so. See the Features + section for supported platforms. +
--enable-guest2host-tlbnosupport guest to host address TLB for speed
--enable-repeat-speedupsnosupport repeated I/O and memory copy speedups
--enable-icachenosupport instruction cache for faster execution
--enable-host-specific-asmsyessupport for running native x86 instructions on an x86 machine
--enable-fast-function-callsnosupport for fast function calls (gcc on x86 only)
--enable-all-optimizationsno Turn on the enables for all speed optimizations that the + developers believe are safe to use: + --enable-guest2host-tlb, + --enable-repeat-speedups, + --enable-icache, + --enable-host-specific-asms, + --enable-fast-function-calls. +
--enable-ignore-bad-msryesignore MSR references that Bochs does not understand, instead of doing a panic
--enable-x86-64no Add support for AMD's x86-64 instruction set, written by Peter Tattam. + The AMD x86-64 support is about 90% complete and is still experimental. + The code has been tested on a limited number of test programs. +
--enable-mmxno (yes for CPU >= 5) Add support for MMX instructions, written by Stanislav Shwartsman. +
--enable-sse=LEVELno Add support for SSE instructions, written by Stanislav Shwartsman. + Any of SSE/SSE2/SSE3/SSE3E/SSE4.1 instruction sets are supported. +
--enable-sepnoSYSENTER/SYSEXIT support
--enable-vmeno (yes for CPU >= 5)Add support for VME (v8086 mode extensions)
--enable-compressed-hdno Add support for compressed disk (not implemented yet). + zlib must be installed on your system, as it will be dynamically linked to Bochs. +
--enable-debuggerno Compile in support for Bochs internal command-line debugger. This has + nothing to do with x86 hardware debug support. It is a more powerful + and non-intrusive native debugger. Enabling this will of course slow + down the emulation. You only need this option if you know you need it. + After you have run ./configure, you may want to edit + config.h to customize the debugger further; + see Section 8.11 for more information. +
--enable-readlinedetected by configure Compile the debugger with the GNU readline library, which gives + command line editing and history. +
--enable-disasmyesCompile in support for built-in disassembler. Bochs has + a built-in disassembler, which is useful if you either + run the built-in debugger (--enable-debugger), or want + disassembly of the current instruction when there is a + panic in bochs.
--enable-cppno Use .cpp as C++ suffix. Renames all the .cc files to .cpp for use with + compilers which want that, like MS C++ compilers. Don't use this option + unless you know you need it. The configure shortcut script for + Win32 uses this option. +
--enable-docbookdetected Build the docbook documentation in doc/docbook. The configure + script will enable this option automatically if you have a program + called docbook2html installed. +
--enable-iodebugyes if debugger is on Dave Poirier has written an experimental interface to the debugger + using I/O ports, so that software running in the guest OS can access + features of the debugger. You only want this option if you are + developing guest OS code for use in Bochs. In other words, most people + don't. Also, it should only be used with --enable-debugger. See the + developer documentation for details. +
--enable-x86-debuggernoX86 debugger support. If the software you run in bochs + needs to use the x86 hardware debugging facilities such as + DR0..DR8, instruction and data breakpoints etc., then you + should use this option. Otherwise don't use it, as it + will slow down the emulation.
--enable-external-debuggernoEnable external debugger support (only available on Win32).
--enable-pcinoEnable limited i440FX PCI support. This is still incomplete, but usable. +
--enable-pcidevno Enable PCI host device mapping support. This requires --enable-pci + to be set as well as Linux 2.4 or 2.6 as host. +
--enable-usbno Enable limited i440FX PCI USB support. This is not yet complete (root hub + and 4 device types are available). +
--enable-4meg-pagesno (yes for CPU > 4)support 4 megabyte page extensions (PSE, page size extension)
--enable-paeno (yes for CPU > 5)support physical address extensions
--enable-global-pagesno (yes for CPU > 5)support global pages
--enable-port-e9-hackyesWrites to port e9 go to console. Unless you know you want + this option, you don't.
--enable-smpno Compile in support for SMP simulation. This allows you to boot Linux and + maybe other OSes in SMP mode, and bochs will simulate all the different + CPUs and communication between them. Do not expect this option to speed + up your simulation! On the contrary, it has to spend extra time simulating + the different CPUs (even if they're mostly idle) and the communication + between them. Use it to try out an SMP OS if you don't have an SMP machine, + or to debug SMP OS drivers. Refer to Section 8.8 for more details + on SMP in Bochs. +
--enable-apicno In an SMP machine, there is an APIC (Advanced Programmable Interrupt + Controller) built into each processor and a separate I/O APIC. The + APICs are used for inter-processor communication, so they must be + enabled for SMP to work. The default is "no" when there is one + processor and "yes" when there is more than one processor. Normally, + the default is correct and you would never need to type this option. +
--enable-instrumentation=directoryno Compile in support for instrumentation. This allows you to collect + instrumentation data from bochs as it executes code. You have to create + your own instrumentation library and define the instrumentation macros + (hooks in bochs) to either call your library functions or not, depending + upon whether you want to collect each piece of data. [Kevin wrote: I + broke some of the hooks when I recoded the fetch/decode loop.] +
--enable-simid={0, 1}0 CPU simulator ID. You likely don't need this option. If you are using + bochs to cosimulate, that is to run multiple simulators in parallel so + that you can compare results and check for divergence, each simulator + needs an ID. When you only have one CPU simulator (as usual) the default + of 0 is fine. [Kevin wrote: I use this option occasionally to run 2 + versions of bochs against each other and check for divergence, to find + bugs etc. This option gets broken more than not due to architectural + changes, and I usually end of fixing it each time I use it.] +
--enable-num-sim={1, 2}1 Number of CPU simulators. The default of 1 is likely what you want, so + don't use this option. It is for assigning an ID to the simulator, for + cosimulation described above. +
--enable-xpmyes Enables the check for the XPM library. This option is only valid if the + x display library is enabled (--with-x11). +
--enable-show-ipsno Enables logging of measured IPS, see the ips parameter + of the cpu option. +

3.4.3. Transcript of Successful Compilation

  user$ ls -l bochs-1.2.1.tar.gz
+  -rw-rw-r--    1 user     user       887993 Sep 15 23:24 bochs-1.2.1.tar.gz
+  user$ gunzip -c bochs-1.2.1.tar.gz | tar -xvf -
+  bochs-1.2.1/
+  bochs-1.2.1/bios/
+  bochs-1.2.1/bios/BIOS-bochs-2-processors
+  bochs-1.2.1/bios/Makefile.in
+    .
+    .
+    .
+  bochs-1.2.1/patches/NOTES
+  bochs-1.2.1/patches/patch.4meg-pages
+  bochs-1.2.1/patches/patch.goswin-changes
+  user$ cd bochs-1.2.1
+  user$ ./configure --enable-cdrom
+  creating cache ./config.cache
+  checking for gcc... gcc
+  checking whether the C compiler (gcc  ) works... yes
+  checking whether the C compiler (gcc  ) is a cross-compiler... no
+  checking whether we are using GNU C... yes
+  checking whether gcc accepts -g... yes
+    .
+    .
+    .
+  creating misc/Makefile
+  creating dynamic/Makefile
+  creating fpu/Makefile
+  creating config.h
+  user$ make
+  cd iodev && \
+  make CC="gcc" CXX="c++" CFLAGS="-g -O2  " CXXFLAGS="-g -O2  " LDFLAGS="" LIBS="" X_LIBS="-L/usr/X11R6/lib" X_PRE_LIBS="-lSM -lICE" prefix="/usr/local" exec_prefix="/usr/local" bindir="/usr/local/bin" infodir="" libiodev.a
+  make[1]: Entering directory `/tmp/bochs-1.2.1/iodev'
+  c++ -c -g -O2    -I.. -I../instrument/stubs devices.cc -o devices.o
+  c++ -c -g -O2    -I.. -I../instrument/stubs pic.cc -o pic.o
+  c++ -c -g -O2    -I.. -I../instrument/stubs pit.cc -o pit.o
+  c++ -c -g -O2    -I.. -I../instrument/stubs unmapped.cc -o unmapped.o
+  c++ -c -g -O2    -I.. -I../instrument/stubs cmos.cc -o cmos.o
+    .
+    .
+    .
+  echo done
+  done
+  c++ -o bochs -g -O2   main.o load32bitOShack.o state_file.o pc_system.o osdep.o \
+     iodev/libiodev.a \
+     cpu/libcpu.a memory/libmemory.a gui/libgui.a \
+     fpu/libfpu.a \
+     -L/usr/X11R6/lib -lSM -lICE -lX11
+  gcc -c -g -O2    -I. -Iinstrument/stubs misc/bximage.c -o misc/bximage.o
+  c++ -o bximage -g -O2   misc/bximage.o
+  user$ su
+  root# make install
+  cd iodev && \
+  make CC="gcc" CXX="c++" CFLAGS="-g -O2  " CXXFLAGS="-g -O2  " LDFLAGS="" LIBS="" X_LIBS="-L/usr/X11R6/lib" X_PRE_LIBS="-lSM -lICE" prefix="/usr/local" exec_prefix="/usr/local" bindir="/usr/local/bin" infodir="" libiodev.a
+  make[1]: Entering directory `/tmp/bochs-1.2.1/iodev'
+    .
+    .
+    .
+  /usr/local/bochs/1.2.1/install-x11-fonts
+  Looking for fonts to install... font/
+  Looking for X11 Font Path... /usr/lib/X11/fonts
+  Installing vga.pcf... ok    (it was already there)
+  Running mkfontdir...
+  Done installing Bochs fonts for X11.
+  root# exit
+  user$ _

3.4.4. Compiling on Win32 with Microsoft VC++

The standard compile uses the configure script, but the Windows platform +cannot run the configure script natively. +The current solution to this problem is that the Bochs +configure script must be run on a different platform that does support +shell scripts, with options that cause it to configure for a Win32 +platform instead of the native one. Many people have access to a UNIX +machine that could run the configure script, or you can use Cygwin to +run the configure script +[4].

Download the Bochs sources on a machine that can run shell scripts. +Edit the configure shortcut script .conf.win32-vcpp +if you want to adjust the configure options. Then type these commands +in the Bochs source directory: +
  sh .conf.win32-vcpp
+  make win32_snap
+These commands will run the configure step, produce VC++ makefiles and +workspace files, and pack it all into a .zip file in the directory above the +source directory [5]. The .zip file is all ready to transfer to the target Windows +machine to be unzipped and compiled. Or, if you run the sh/make steps in +Cygwin, you are already on the target machine so you don't need the .zip +file.

When you have the Win32 sources transferred to a Windows machine with VC++, +find the workspace file called bochs.dsw and load it in +VC++. Choose Project:Set Active Project and be sure that +"bochs" is selected. Then choose Build:Build bochs.exe. +This will build all the required libraries (iodev, cpu, etc.) and the auxiliary +programs bximage.exe, bxcommit.exe +and niclist.exe.

Using workspaces is easy and intuitive, but there is one caveat. The +workspaces come directly out of a ZIP file in +build/win32/workspace.zip, and they are not controlled by +the configure script. When you compile with certain configure options (e.g. +--with-sdl) you need to link with additional libraries. For now you must +add them to the VC++ workspace by hand. In version 2.0, we have improved +the situation considerably by adding #if...#endif around every optional file +and including nearly every Bochs source file in the workspace. This solves the +problem of having to manually add source files to the workspace when you turn +on configure options such as --enable-debugger. The problem of adding +link libraries remains unresolved.

Tip: To compile with the Bochs debugger enabled, add "--enable-debugger" to the +configure line in .conf.win32-vcpp before running it. +No modifications to the workspace are necessary.

An alternative way to compile is to run nmake.exe in an +MS-DOS window. Instead of using the workspace files, nmake uses the Bochs +makefiles that are generated by configure. The workspace file was new in +version 1.3; before that, nmake was the only way to compile Bochs in VC++. +Starting with version 1.4, the workspace is used to build the release +binaries.

The make install for Win32 is presently broken. In the +future, a make install that runs in Cygwin may be provided.

3.4.5. Compiling on Win32 with Cygwin

Cygwin is a free Unix-like environment for Windows written by +Steve Chamberlain and now maintained by RedHat, Inc. You can download +it from www.cygwin.com. Because +Cygwin supports the configure script and uses GNU gcc/g++, you can use the +standard compile process. The configure script should automatically detect +Cygwin and add "-mno-cygwin -DWIN32" to the compiler options. You should +get a working Bochs if you just type: +
  configure
+  make
+ +Optionally, you can use the configure shortcut script for Cygwin, +.conf.win32-cygwin, instead of running configure +directly. If this script is close to what you need, just edit the script and +then run it. To use the configure shortcut script and compile in Cygwin, the +commands are +
  sh .conf.win32-cygwin
+  make
+To find out the options which are known to work in Cygwin, open the file +.conf.win32-cygwin in any text editor/viewer and have +a look at the end of that file.

3.4.6. Compiling on MacOS 9 with CodeWarrior

It is possible that this hasn't been tried since 1999. In theory, you + run sh .conf.macos on a Unix box to build the + makefiles and headers, copy the whole thing over to a Mac, and then + use CodeWarrior to compile. Since it hasn't been tested in so long, + it is quite likely that some work is needed to bring the Mac port up + to date.

If you are interested and have the required MacOS development tools, please + let us know by contacting the bochs-developers mailing list. Someone requests a MacOS port + almost once a month, but none of the developers know how to help them.

3.4.7. Compiling on MacOS X

The port to MacOS X with Carbon API by Emmanuel Mailliard is quite new, and the +configure and makefile support was added by Bryce Denney. You will need +the compiler and libraries from the development tools CD. Bochs should +configure and compile with the Carbon GUI if you simply type: +
  configure
+  make
+Optionally, you can use the configure shortcut script for MacOS X, +.conf.macosx, instead of running configure directly. +If this script is close to what you need, just edit the script and then +run it. To use the configure shortcut script and compile, the commands +are +
 
+  sh .conf.macosx
+  make
+ +MacOS X has a special format for an application bundle, which looks like a +directory that contains the required resource files and binaries. The Makefile +currently creates this application bundle "by hand" using mkdir and copy, which +is surely the wrong way to do it. Bryce doesn't know the official way to +create an application from a Makefile, so this hack will remain until a real +Mac developer helps to clean it up.

On MacOS X the default GUI is the Carbon interface, but you can also try other +Bochs GUIs. Use --with-x11 for X windows, +--with-rfb for VNC/RFB, or --with-sdl for SDL.

3.4.8. Compiling on BeOS

Kevin Lawton ported Bochs to BeOS. Bernd Korz has taken over the port. + Since Bochs 1.4, you can use the same compile and install process as on + Unix, that is, configure will detect the BeOS platform and assume you + want the BeOS GUI. +
  configure
+  make
+ Optionally, you can use the configure shortcut script for BeOS, + .conf.beos, which uses the SDL GUI by default.

3.4.9. Compiling on Amiga/MorphOS

Nicholai Benalal created this port to MorphOS running on Amiga. It should + compile with: +
  configure
+  make
+ If the platform is not detected properly, you might need to use + --enable-amigaos as a configure option. Optionally, you + can use the configure shortcut script, .conf.amigaos.

3.4.10. Compiling with the RFB interface

The RFB code was written by Don Becker <x-odus@iname.com>, + who has a Bochs-RFB web page on his site, + http://www.psyon.org/bochs-rfb/.

This interface allows you to view the Bochs display with + AT&T's VNC Viewer. + The protocol used between a VNC server and a VNC viewer is called RFB. + Because the RFB code in Bochs is written with portable network socket + and POSIX thread code, it can be compiled on many platforms and has + been tested in Linux and Win32. No additional libraries are required. + To try it, type: +
  configure --with-rfb
+  make
+ RFB currently uses this setup: +

  • port range 5900 to 5949 (using the first one available)

  • no authentification

  • 30 seconds waiting for client

  • 8 bpp (BGR233) supported only

  • desktop size 720x480 (for text mode and standard VGA)

3.4.11. Compiling with the SDL interface

Dave Poirier has written an SDL interface for Bochs. Simple DirectMedia + Layer, or SDL, is a cross-platform multimedia library distributed from + libsdl.org. SDL is available + for many platforms including Win32, Linux, BSD, IRIX, MacOS, MacOS X, BeOS, + and AmigaOS.

To compile Bochs with SDL, you must first install the SDL library + from libsdl.org. You + can either get the source code and compile it yourself, or install + the development libraries for your platform (already compiled). + Then, go into the Bochs directory and type: +
  configure --with-sdl
+  make

If you are on FreeBSD and have SDL installed using the ports collection, Bochs + won't be able to find the library automatically, as the SDL config script is + called sdl11-config in that case (even for version 1.2). + The easiest way to make Bochs find it, is to create a symlink to that script + called sdl-config inside a directory which is in the path. + For example: +
  ln -s /usr/local/bin/sdl11-config ~/bin/sdl-config

To compile in Microsoft VC++, you have to configure on a different system. +Here's the procedure: +
- On a machine that can run shell scripts, such as Cygwin, run
+    configure --target=pentium-windows --with-sdl
+    make win32_snap
+- Copy the resulting ZIP file to your Windows box and unzip it.
+- Load up workspace called bochs.dsw in VC++ 6.0
+- Double click "gui files"
+- Remove gui/win32.cpp from the project, and add gui/sdl.cpp instead.
+- Edit the settings of "gui files".  Under C/C++ tab, category=preprocessor,
+  additional include directories, add the directory where SDL/SDL.h can be
+  found.
+- Edit the settings of the "bochs files" project.  Under the Link tab,
+  category=General, add SDL.lib to object/library modules list.  Then in
+  category=Input, add the path of SDL.lib to additional library path.  Click
+  ok.
+- Select Build:Build Bochs.exe

3.4.12. Compiling with the wxWidgets interface

wxWidgets is a cross-platform C++ user interface library which + you can download for free at wxwidgets.org. + The wxWidgets port of Bochs provides both a graphical configuration interface for + editing bochsrc options (see + config_interface option) and a + display (see display_library option). + It was written by Bryce Denney, Don Becker, Dave Poirier, and Volker Ruppert. +
  configure --with-wx
+  make

If you want Bochs to use a wxWidgets installation not in your path (but installed + somewhere else), you need to set the WX_CONFIG environment variable to the + proper wx-config script, before running configure (example for csh): +
  setenv WX_CONFIG '/home/compile/wx/bin/wx-config'

3.4.13. Building an RPM on Linux

RPM stands for "RedHat Package Manager." An RPM is a compressed file +containing files to be installed on your system. Bochs +has a special shell script called make-rpm that helps +to build an RPM of Bochs. Start with a clean source directory. Edit +.conf.linux first if you want to adjust the configure options. +Then, type: + +
  ./build/redhat/make-rpm | tee /tmp/build.txt
+ +When this command completes, you should have a source RPM and a binary RPM of +Bochs in the current directory. The tee part of the +command (optional) saves a transcript of the build process into /tmp/build.txt, +which is very useful if anything goes wrong. Instructions for installing an +RPM are here.

Note: In the past, you had to build rpms as root, but as of version 2.0 you can build +them as a normal user.

3.4.14. Compile Problems

what if configure fails?
+- tar up config.* and send to bochs-testing@tlw.com
+- report the problem with a source forge bug report.
+
+what if make fails?
+- try make dist-clean, and run configure and make again
+- use configure options to disable options.  For example, if errors in 
+fpu/fpu.cc, you could try --disable-fpu.
+- search for the error on the Bochs website (bug reports, patches)
+- if familiar with C++, many minor problems can be corrected
+- move to more stable code.  if it's CVS, see if a release version will
+  compile.  Report problem to bochs-developers.
+- report the problem with a source forge bug report.

Notes

[1]

The syntax for bash and ksh is given. In csh and variants, use the syntax +setenv VARIABLE +value to change environment variables. +Do not use an equal sign for csh!

[2]

This is different from the terminology of some other projects, and it may cause +confusion. Sometimes "clean" implies that all subdirectories are affected.

[3]

+ make install_dlx option

[4]

Because Bochs depends so much on the configure script, if you are doing +much win32 Bochs development, you should consider downloading Cygwin +so that you can run the configure step natively.

[5]

If the source directory is /home/joe/bochs-win32, the +resulting .zip file is in /home/joe/bochs-win32.zip.


PrevHomeNext
Installing a BinaryUpSetup
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/config-tuntap.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/config-tuntap.html new file mode 100644 index 0000000..b2a7118 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/config-tuntap.html @@ -0,0 +1,629 @@ + +Configuring and using a tuntap network interface
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.10. Configuring and using a tuntap network interface

If you use linux (optionally FreeBSD and Solaris, not tested), +you may want to access the network through a tuntap interface. The main +advantage of this interface, is that the guest has access to the host. The guest can even +have access to the whole network if the host routes or masquerades the guest requests. +No extra IP address is needed, all can be done using private IP addresses.

You'll find here instructions to set up Linux/Bochs to provide network access to the guest OS +through a tuntap interface and private IP network. We're going to see howto : +

  • enable the tuntap interface in the Linux Kernel

  • configure Bochs to use the tuntap interface

  • set up the private network between the host and the guest

  • set up the host to masquerade the guest network accesses

8.10.1. Tuntap description

From the tuntap.txt file in the Linux kernel tree : +
  TUN/TAP provides packet reception and transmission for user space programs. 
+  It can be viewed as a simple Point-to-Point or Ethernet device, which 
+  instead of receiving packets from a physical media, receives them from 
+  user space program and instead of sending packets via physical media 
+  writes them to the user space program. 
+
+  When a program opens /dev/net/tun, driver creates and registers corresponding
+  net device tunX or tapX. After a program closed above devices, driver will 
+  automatically delete tunXX or tapXX device and all routes corresponding to it.

8.10.2. Set up the linux Kernel + [1]

First make sure the tuntap module is included in the kernel : +

  • if you use a recent distribution, chances are that the needed modules are already build

    Make sure that "Kernel module loader" - module auto-loading support is enabled in your kernel.

    Add following line to the /etc/modules.conf:
     alias char-major-10-200 tun 

    Run:
     depmod -a
    The driver will be automatically loaded when application access /dev/net/tun.

  • Otherwise, recompile the kernel, including the configuration option +
     CONFIG_TUN (Network device support -> Universal TUN/TAP device driver support) 
    +

+

Note: Make sure there is a /dev/net/tun device. +(Can be created with 'mkdir /dev/net ; mknod /dev/net/tun c 10 200').

In the same way, to use masquerading, you need a kernel with the following options : +
 CONFIG_IP_NF_CONNTRACK (Connection tracking)
+ CONFIG_IP_NF_IPTABLES (IP tables support)
+ CONFIG_IP_NF_NAT (Full NAT)
+

Note: Some of the other options in this group is probably also needed, +(but the default setting should be OK).

8.10.3. Configure Bochs to use the tuntap interface

Make sure Bochs has ne2000 support. If you have to recompile Bochs, + --enable-ne2000 when running ./configure + (see Section 3.4) +

edit your .bochsrc configuration file and add something like : +
  ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, 
+                          ethmod=tuntap, ethdev=/dev/net/tun0, script=/path/to/tunconfig
+                
+

Since the tuntap interface cannot be configured until a process opens it, + Bochs may run a script file for you. In this case + /path/to/tunconfig should be changed to match + the actual place where you'll create this script. +

8.10.4. Set up the private network between the host and the guest

We'll set up a private network between the host and the guest with the following parameters: +
                Host IP : 192.168.1.1
+                Guest IP : 192.168.1.2
+        
+ If your parameters are different, adapt the rest of the section to suit your needs. +

Create the /path/to/tunconfig script : +
        #!/bin/bash
+        /sbin/ifconfig ${1##/*/} 192.168.1.1
+        
+ The script get the interface name as the first parameter. Linux + will forward incoming packets between interfaces. +

Make it executable :
chmod 755 /path/to/tunconfig
+

Run Bochs, install the guest OS, and set the following network parameters in the guest OS: +
        IP: 192.168.1.2
+        netmask: 255.255.255.0
+        gateway: 192.168.1.1
+        nameserver: whatever is used in linux
+        
+

Note: Bochs must be started by root (at least for now - the + script won't have root privileges otherwise). +

+ You may also have to edit /etc/hosts.allow in the host OS and add : +
        ALL: 192.168.1.2
+        
+ Don't forget to set up the route on the guest. +

At this point, you should be able to ping/telnet/ftp/ssh the guest from the host + and vice-versa. +

8.10.5. Set up the host to masquerade the guest network accesses

We are going to set up standard masquerading configuration. Edit + the /path/to/tunconfig script ans add : +
        /sbin/iptables -D POSTROUTING -t nat -s 192.168.1.0/24 -d ! 192.168.1.0/24 -j MASQUERADE >& /dev/null
+        /sbin/iptables -t nat -s 192.168.1.0/24 -d ! 192.168.1.0/24 -A POSTROUTING -j MASQUERADE
+        echo 1 > /proc/sys/net/ipv4/ip_forward
+        
+

Note: The configuration assumes the default policy is + ACCEPT (can be examined by doing '/sbin/iptables -L') +

+

Note: The iptables package must be installed.

+ And voila... The host should forward the packets of the guest to the rest of your network. + You could even have acces to the internet... + add nice screenshot +

Note: You may need to load other modules if you want to use other fancy protocols (ftp,etc...) +

+

Notes

[1]

much of the information of the following section is taken from + this email from Samuel Rydh of the Mac-On-Linux list


PrevHomeNext
Setting Up Networking in DLX LinuxUpUsing Bochs internal debugger
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/cpu-models.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/cpu-models.html new file mode 100644 index 0000000..54fce52 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/cpu-models.html @@ -0,0 +1,373 @@ + +Pre-defined CPU models
Bochs User Manual
PrevChapter 5. Using BochsNext

5.4. Pre-defined CPU models

If Bochs is compiled with cpu level 5 or higher the CPUID opcode is supported +and it can return some information about the cpu model and it's features. When +using a pre-defined CPU model in Bochs the features reported by CPUID are set up +according to the model's specification. The following table shows all available +CPU models with a short description. The amount of choices depends on the CPU +features enabled at compile time (3rd column).

Table 5-2. Bochs CPU models

ValueDescriptionRequired Features
bx_genericDefault Bochs CPU configured with CPUID optioncpu level 5
pentiumIntel Pentium (P54C)cpu level 5
pentium_mmxIntel Pentium MMXcpu level 5
amd_k6_2_chomperAMD-K6(tm) 3D processor (Chomper)cpu level 5
p2_klamathIntel Pentium II (Klamath)cpu level 6
p3_katmaiIntel Pentium III (Katmai)cpu level 6
p4_willametteIntel(R) Pentium(R) 4 (Willamette)cpu level 6
core_duo_t2400_yonahIntel(R) Core(TM) Duo CPU T2400 (Yonah)cpu level 6
atom_n270Intel(R) Atom(TM) CPU N270cpu level 6
p4_prescott_celeron_336Intel(R) Celeron(R) 336 (Prescott)cpu level 6, x86-64
athlon64_clawhammerAMD Athlon(tm) 64 Processor 2800+ (Clawhammer)cpu level 6, x86-64
athlon64_veniceAMD Athlon(tm) 64 Processor 3000+ (Venice)cpu level 6, x86-64
turion64_tylerAMD Turion(tm) 64 X2 Mobile TL-60 (Tyler)cpu level 6, x86-64
phenom_8650_tolimanAMD Phenom X3 8650 (Toliman)cpu level 6, x86-64
core2_penryn_t9600Intel Mobile Core 2 Duo T9600 (Penryn)cpu level 6, x86-64
corei5_lynnfield_750Intel(R) Core(TM) i5 750 (Lynnfield)cpu level 6, x86-64
corei5_arrandale_m520Intel(R) Core(TM) i5 M 520 (Arrandale)cpu level 6, x86-64
corei7_sandy_bridge_2600kIntel(R) Core(TM) i7-2600K (Sandy Bridge)cpu level 6, x86-64, avx
zambeziAMD FX(tm)-4100 Quad-Core Processor (Zambezi)cpu level 6, x86-64, avx
trinity_apuAMD A8-5600K APU (Trinity)cpu level 6, x86-64, avx
ryzenAMD Ryzen 7 1700cpu level 6, x86-64, avx
corei7_ivy_bridge_3770kIntel(R) Core(TM) i7-3770K CPU (Ivy Bridge)cpu level 6, x86-64, avx
corei7_haswell_4770Intel(R) Core(TM) i7-4770 CPU (Haswell)cpu level 6, x86-64, avx
broadwell_ultIntel(R) Processor 5Y70 CPU (Broadwell)cpu level 6, x86-64, avx

PrevHomeNext
The configuration interface 'textconfig'UpSave and restore simulation
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/debugging-with-gdb.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/debugging-with-gdb.html new file mode 100644 index 0000000..fe633db --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/debugging-with-gdb.html @@ -0,0 +1,249 @@ + +Using Bochs and the remote GDB stub
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.12. Using Bochs and the remote GDB stub

This section covers how you can use Bochs with a remote GDB stub to debug your kernel.

8.12.1. Configuring Bochs

The GDB stub is not active in standard Bochs binary package. So you must recompile Bochs. +Download the Bochs source package, unpack it and run the configure script +with the --enable-gdb-stub argument. + +
  $ ./configure --enable-gdb-stub
+ +After that, just run make and you should have a Bochs binary that contain a GDB stub in your directory.

8.12.2. Running Bochs

Enable the gdbstub option in bochsrc, then just start Bochs as normal. Bochs will stop and wait for GDB to connect to the stub.

8.12.3. Running GDB

Bochs GDB stub waits for a connection on TCP port 1234. Just start GDB like this: + +
  $ gdb YOUR-KERNEL
+  .
+  .
+  .
+  (gdb) target remote localhost:1234
+  Remote debugging using localhost:1234
+  0x0000fff0 in ?? ()
+  (gdb)
+ +You are now connected to the remote GDB stub in Bochs. You are now able to set breakpoints. +Use the continue (c) command to continue the simulation. + +Hitting ^C works. Example: + +
  Program received signal 0, Signal 0.
+  syscall_testsuite_result (aux=0x1f11fe4) at ../rtmk/syscalls.c:33
+  33     {
+  (gdb)


PrevHomeNext
Using Bochs internal debuggerUpUsing the serial port
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/diskimagehowto.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/diskimagehowto.html new file mode 100644 index 0000000..d1d1298 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/diskimagehowto.html @@ -0,0 +1,487 @@ + +How to make a simple disk image
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.2. How to make a simple disk image

This was contributed by Greg Alexander in October 2001 and updated by +Volker Ruppert in October 2013.

What you need: + +

  • An executable version of Bochs. See Downloading Bochs and Compiling Bochs.

  • The bximage program, included with Bochs.

  • A FreeDOS boot disk, or a boot disk from another OS capable of +producing DOS partitions (e.g. a Linux install disk).

  • (Optional) mtools, a program for manipulating DOS disks/images.

8.2.1. Create a flat image

Option 1: Using the Unix dd utility:

You will need to know the geometry of the disk you want to +create. You have to compute the disk sector count: + +

Sectors = Cylinders * Heads * SectorsPerTrack

Use the dd command to create your file: + +

dd if=/dev/zero of=teaching.img bs=512 count=sectors
+(replace "sectors" with the number you computed at the +previous step).

When you'll update your configuration file, please +fill in the same cylinders, heads and sector per +track values.

Option 2: Run bximage to create a disk image file. +You will be greeted with the following prompt: + +

========================================================================
+                                bximage
+  Disk Image Creation / Conversion / Resize and Commit Tool for Bochs
+         $ID: bximage.cc 11906 2013-10-23 08:35:21Z vruppert $
+========================================================================
+
+1. Create new floppy or hard disk image
+2. Convert hard disk image to other format (mode)
+3. Resize hard disk image
+4. Commit 'undoable' redolog to base image
+
+0. Quit
+
+Please choose one [0]

Since we want to create a new image, we have to type '1' +and then Enter. +

Do you want to create a floppy disk image or a hard disk image?
+Please type hd or fd. [hd]

Since we are creating a hard disk image, accept the default of hd by +pressing Enter or typing 'hd' and pressing +Enter. Next, bximage will ask for the type of +hd to create: + +

What kind of image should I create?
+Please type flat, sparse, growing or vpc. [flat]

We want to create a simple flat image, so accept the default +by pressing Enter. Then, bximage will ask +for the size of the disk image you want to create, in Megabytes: + +

Enter the hard disk size in megabytes, between 1 and 8257535
+[10]

Enter the size of the hard disk you want to create, and press +Enter. Then bximage will ask you for a filename to use +for the file it is creating. +

What should be the name of the image?
+[c.img]

At this point, type in the filename you want to use for the image. The +default of "c.img" is appropriate if this will be your only hard disk +image. After you have typed in the name of the filename you want to +use, press Enter. Bximage will tell you it is writing the disk +and then it will show you a line that should be added to your +bochsrc when you want to use this disk image. I named my +10 Megabyte image "teaching.img" and the output of bximage looked like +this: + +

[c.img] teaching.img
+
+Creating hard disk image 'c.img' with CHS=20/16/63

The following line should appear in your bochsrc: +

  ata0-master: type=disk, path="teaching.img", mode=flat, cylinders=20, heads=16, spt=63

At this point, a file called "teaching.img" was created in my current +directory and is ready to be used as an image file for a Bochs session.

Tip: You may want to name your image teaching_20-16-63.img +so that you always know the values to use for CHS.

8.2.2. Partition and format your image file

Option 1: Using FreeDOS (Advantage: Creates a MBR on the partition.)

First, you need to edit the bochsrc file that Bochs uses for +configuration information (see Section 5.2). Open bochsrc +with a text editor. Remove all lines in the file which start with "ata0-master:". Add the "ata0-master:" +line that was displayed when you ran bximage to bochsrc at the +same place where you removed the old "ata0-master:" lines from.

Also, you need to download or create a FreeDOS (or DOS, or Windows, or +Linux) disk image. Modify the "floppya:" line in your bochsrc to point +at the downloaded FreeDOS floppy image and change its status to "status=inserted".

Save and close your bochsrc. Now run Bochs (see Chapter 5).

Use the standard FreeDOS commands fdisk and +format to format your hard +drive image. You must make the image bootable to be able to boot +without a floppy disk. However, creating a bootable disk image is best +done with a boot disk from the OS you intend to install on the image.

Option 2: Using mtools (Disadvantage: Cannot create bootable images +without a MBR image.)

Use a text editor to add the following line to the file ~/.mtoolsrc:

drive c: file="path/filename.img" partition=1

Save and close .mtoolsrc. Next, execute the following commands to +create a partition table for the drive image:

mpartition -I -s spt -t cyl -h heads c:
+mpartition -cpv -s spt -t cyl -h heads c:

For example, for my 10 meg drive, I used: +

mpartition -I -s 63 -t 20 -h 16 c:
+mpartition -cpv -s 63 -t 20 -h 16 c:

Next, format the partition you just created using the mformat command: + +

mformat c:

And you now have a formatted disk image containing a single DOS +partition.

Note: The mpartition command doesn't handle images larger than 1024 cylinders properly. +The partition size reported by fdisk is okay, but mformat reports only 504 MB +(tested with mtools 3.9.9).


PrevHomeNext
Tips and TechniquesUpUse mtools to manipulate disk images
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/dlxlinux-networking.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/dlxlinux-networking.html new file mode 100644 index 0000000..8ab4aa0 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/dlxlinux-networking.html @@ -0,0 +1,331 @@ + +Setting Up Networking in DLX Linux
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.9. Setting Up Networking in DLX Linux

All Bochs binaries come with a working version of DLX Linux. This section +describes how to configure networking in Bochs and enable it within +DLX Linux. First you must add a ne2k line in your bochsrc +file. Then, when you boot the DLX Linux image, you need to type some Linux +commands to set up an IP address, a network route, and a name server.

When you have an ne2k line in your bochsrc file, Bochs +will emulate a network card called an NE2000. Below are some examples of valid +ne2k lines for various operating systems. Choose the +one that's closest to what you need, add it to your bochsrc file, and +edit the values if necessary. +
  # sample for Mac OS X
+  ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=en0
+  # sample for FreeBSD
+  ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xl0
+  # sample for Linux
+  ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0
+  # sample for Windows
+  ne2k: ioaddr=0x300, irq=9, mac=00:c4:3B:00:C3:00, ethmod=win32, ethdev=NE2000
+You see the pattern. Usually you won't need to change the I/O address, IRQ +number, or MAC address. The ethmod value depends on your +host operating system, and it must be either null, +fbsd (for FreeBSD or OpenBSD), linux, +or win32. The ethdev setting is the +name of the network interface on your system, and is also OS-dependent. On +UNIX systems you can get the name of the network interface by running +ifconfig. (Don't choose the loopback interface.) On +Windows systems, the correct ethdev setting is not always obvious, so we +provide a utility called niclist to list the names of +network interfaces to use. When you run niclist, it will +suggest an ne2k line which is a very good first try.

Next, if you are on a UNIX machine you will need to become the root user. +Since bochs is sending and receiving raw network packets, you need to be root +to use the network device. To allow normal users to do this would be a +security problem.

Now run Bochs to boot DLX Linux. Press enter a few times to accept the default +configuration choices. This tells Bochs read the configuration file and then +begin. DLX Linux should boot in the Bochs window, and you should see +that Linux detects the NE2000 card. Eventually it gets to a login prompt. +
  ne.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)
+  NE*000 ethercard probe at 0x300: b0 c4 20 00 00 00
+  eth0: NE2000 found at 0x300, using IRQ 9.

At the login prompt, type "root" to log in as root. Then type the ifconfig and +route commands to set up networking. The exact IP numbers in the example won't +work for you; you must choose an IP configuration that is legal on your +network. + +
  dlx login: root
+  Linux 1.3.89.
+  dlx:~# ifconfig eth0 192.168.0.99         # set bochs IP address
+  dlx:~# route add -net 192.168.0.0         # first 3 numbers match IP
+  dlx:~# route add default gw 192.168.0.1   # your gateway to the net
+  dlx:~# _

Note: The bochs IP address must be an unused IP address on your +network. If you duplicate someone else's IP address, your network will +become very confused.

Finally, the network is ready and you can test it out with ping, telnet, or ftp +to various machines by their numerical IP address. Keep in mind that for all +UNIX host platforms, Bochs networking cannot talk to the host machine. That +means the host machine can't be the gateway either. You need another physical +machine on the network that bochs can talk to. On Win32 this restriction does +not apply.

Note: When you have a working network configuration, you can make DLX Linux recreate +the same settings the next time you boot. Just add the ifconfig and route +commands to the end of /etc/rc.d/rc.inet1. I won't try to describe how +to use the vi editor in this limited amount of space...

To configure a name +server, set up /etc/resolv.conf with the IP address of +your name server as shown. +
   dlx:~# echo 'nameserver 192.168.0.1' > /etc/resolv.conf


PrevHomeNext
Simulating a Symmetric Multiprocessor (SMP) MachineUpConfiguring and using a tuntap network interface
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/enter-special-keys.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/enter-special-keys.html new file mode 100644 index 0000000..a3fe94f --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/enter-special-keys.html @@ -0,0 +1,186 @@ + +How to enter special key combination
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.15. How to enter special key combination

Your window manager may trap the key combination you want to enter +in Bochs guest OS, for example control+alt+delete. Here is a work-around:

Press and hold control+alt, +move your mouse cursor outside of the Bochs window. Release them, move +the cursor back in the Bochs window and press delete.

This should work for any key combination.

If you need one key combination frequently, set it up as user key combination +in your configuration file. This key combination is sent to the guest OS +when you press the user button in the headerbar. +Depending on the used display_library option, +it may even be possible to edit the shortcut before sending it.


PrevHomeNext
BIOS TipsUpNotes about VESA usage
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/faq.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/faq.html new file mode 100644 index 0000000..18cba2d --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/faq.html @@ -0,0 +1,632 @@ + +FAQ
Bochs User Manual
PrevChapter 1. Introduction to BochsNext

1.9. FAQ

1.9.1. Is Bochs Open Source?
1.9.2. How do you pronounce "Bochs"?
1.9.3. Who is the author of Bochs?
1.9.4. Who maintains Bochs now? +
1.9.5. Tell me about performance when running Bochs. +
1.9.6. Does Bochs use a disk partition to install the OS? +
1.9.7. Why can't I use Bochs with my current Win95 installation? +
1.9.8. Is there a developer's email list for Bochs? +
1.9.9. Is there an IRC channel for Bochs? +
1.9.10. Do you know of any snapshots of Bochs running Win95? +
1.9.11. Does Bochs support a CD-ROM? +
1.9.12. Does Bochs support a sound device? +
1.9.13. Does Bochs support a network card? +
1.9.14. What applications are known to run inside of Bochs? +
1.9.15. I am new to Bochs, how do I start? +

1.9.1. Is Bochs Open Source?

Yes! Bochs is released under the GNU LGPL, + much thanks to MandrakeSoft, makers + of the Linux-Mandrake distribution. +

1.9.2. How do you pronounce "Bochs"?

Phonetically the same as the English word "box". It's just a play on the word "box", since techies like to call their machines a "Linux box", "Windows box", ... Bochs emulates a box inside a box. +

1.9.3. Who is the author of Bochs?

Kevin Lawton is the primary author of Bochs. There have been bug fixes, + enhancements, and code contributions from some few hundred people, so + it is not possible to list them all. Recently, Kevin has been working + on a PC virtualization project called plex86. In Fall 2002, he + made contributed some major CPU speedups and helped with integration + and debugging of the x86-64 emulation code. +

1.9.4. Who maintains Bochs now? +

With Kevin's help, in April 2001, the members of the bochs-developers + mailing list set up a new official Bochs site hosted by Source Forge. The admins on this + project are Greg Alexander, Don Becker, Christophe Bothamy, and Bryce + Denney. +

1.9.5. Tell me about performance when running Bochs. +

Because Bochs emulates every x86 instruction and all the devices in a PC + system, it does not reach high emulation speeds. Kevin reported + approximately 1.5MIPS using Bochs on a 400MHz PII Linux machine. Users + who have an x86 processor and want the highest emulation speeds may want + to consider PC virtualization software such as plex86 (free software) + or VMware (proprietary and commercial). Another related project is + QEMU. +

1.9.6. Does Bochs use a disk partition to install the OS? +

No. It uses a disk image file, which is simply a large file, like any other file, on your platform's disk. +

1.9.7. Why can't I use Bochs with my current Win95 installation? +

Think about this. If you had two different PC's, they would require different hardware drivers. So you may not be able to safely move a disk drive with Win95 on it, from one to the other. Bochs is no different. It emulates a certain set of hardware devices, and requires each OS be configured for those devices. +

1.9.8. Is there a developer's email list for Bochs? +

Yes. For instructions on joining, refer to + Chapter 7. +

1.9.9. Is there an IRC channel for Bochs? +

Yes. You will usually find Bochs developers and users on IRC at irc.freenode.net:6667, channel #bochs. +

1.9.10. Do you know of any snapshots of Bochs running Win95? +

Yes! Look for "screen shots" on bochs.sourceforge.net or on other Bochs sites. +

1.9.11. Does Bochs support a CD-ROM? +

Yes, a CD-ROM is supported in Linux, Windows, BeOS, and most BSDs. The +CD-ROM drivers for Bochs allow the guest operating system to access the +host operating system's CD-ROM data directly. +

1.9.12. Does Bochs support a sound device? +

Yes, there is Sound Blaster emulation support for most common operation systems, + see Section 4.3 for details. +

1.9.13. Does Bochs support a network card? +

Yes. Bochs contains a model of an NE2000 compatible network card. + Networking is not supported on all platforms. See + Section 1.7 for details. +

1.9.14. What applications are known to run inside of Bochs? +

Well, lot's of different OS's run inside of Bochs, so + thousands. I'm assuming you are asking about Windows programs. + To give you a few, the following ones from the Winstone'98 tests + worked: Access 97, CorelDRAW! 7, Excel 97, Lotus 1-2-3 97, Word 97, + PowerPoint 97, Quattro Pro 7, WordPerfect 7.

Also, I've compiled an entire OS kernel inside Bochs before. Not +to mention, running DOOM, though at then-pathetic speeds. +

1.9.15. I am new to Bochs, how do I start? +

You should read Chapter 4 first. Next, you can check Chapter 9 + if there are already instructions on how to install your (guest) OS inside of Bochs. +


PrevHomeNext
Supported PlatformsUpRelease Notes
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/features.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/features.html new file mode 100644 index 0000000..de00f3c --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/features.html @@ -0,0 +1,536 @@ + +Features
Bochs User Manual
PrevChapter 1. Introduction to BochsNext

1.7. Features

The following table shows the features of Bochs and which platforms they +currently work with.

Table 1-1. Bochs Features

FeatureSupported?Description
configure scriptYesBochs uses GNU autoconf to configure Makefiles and headers. + Autoconf helps Bochs to compile on a wide variety of platforms. +
386,486,Pentium EmulationYesBochs can be configured to emulate one of several families of Intel hardware. Some Pentium features are unsupported, such as MTRR or SMM (System Management Mode).
P6 and later CPU EmulationYesBochs can be configured to emulate any P6 family processor including optional MMX and SSE instructions. +
Pentium 4 EmulationIncompleteA few Pentium 4 features are incomplete, such as an on-chip APIC extensions (XAPIC) for SMP simulation. +
x86-64 Extensions EmulationYesBochs can be configured to emulate x86-64 with all Intel (CMPXCHG16B instruction) or AMD (RDTSCP instruction) extensions.
Command Line DebuggerYesPowerful command line debugger (optional) that lets you stop + execution and examine registers and memory, set breakpoints, etc. Unfortunatelly + the debugger still lacks x86-64 support and almost unusable for debugging + x86-64 workloads. +
Floating PointYesUses software floating point engine based on SoftFloat floating point emulation library. +
Enhanced BIOSYesImplements ElTorito, EDD v3.0, basic APM feature, PCIBIOS features + and the PCI interrupt routing table. The latest version of the Bochs BIOS + has a 32-bit init for ACPI, SMM and SMP. +
VGAYesVGA color graphics emulation in a window. +
VBE (VESA) SupportYesCurrently resolutions up to 1024x768x32bpp are supported. + You must compile Bochs with VBE enabled and use the LGPL'd VGABIOS. + For more information see Section 8.16. +
Cirrus Logic video cardYesCirrus Logic CL-GD5430 ISA or CL-GD5446 PCI video card support. + For more information see Section 8.17.
Floppy diskYesSupports floppy disk images on all platforms: 2.88M 3.5", 1.44M 3.5", 1.2M 5.25", + 720K 3.5" and 360K 5.25". On Unix and Windows 9x/NT/2000/XP, Bochs can access the + physical floppy drive. +
Multiple ATA channelsYesEmulates up to 4 ATA channels. Up to 8 ATA/ATAPI emulated devices can be attached, + two per ATA channel. + So you can have eight hard disks or seven hard disks and a CD-ROM or four hard + disks and four CD-ROMs, or one hard disk and seven CD-ROMs, etc... +
Hard diskYesEmulates ATA-6/IDE hard drives via image files. Physical + hard disk access is supported on some architecture, but NOT recommended, primarily for safety reasons. + Hard disk up to 127GB are supported, on any platform that support large files access. +
CD-ROMYesEmulates ATAPI-4/IDE CD-ROM. The CD-ROMs can read from an ISO disk image + on any platform. On Windows (9x/ME/NT/2000/XP), Linux, SunOS, FreeBSD, + NetBSD, OpenBSD, Amiga/MorphOS, MacOSX and BeOS, Bochs can read from the + physical CD-ROM drive. Starting with version 1.4, Bochs is even able to boot from + a bootable CD or bootable ISO image. +
KeyboardYesEmulates a PS/2 keyboard with North American key mappings. Optional keyboard layout + remapping files are provided to support localized keyboard in X11 (German, French, Italian, Spanish, + Danish, Swedish, Russian). +
MouseYesEmulates a serial, PS/2 or USB mouse with 3 buttons + optional mouse + wheel support. +
Sound BlasterYesEmulates a Sound Blaster 16 card (ISA, no plug&play). On Windows, Linux, FreeBSD, MacOS 9 and + MacOSX, the output can be sent to the host computer's sound system, see + Section 4.3 for details. +
Network cardYesEmulates an NE2000 compatible network card. On Windows NT/2000, + Linux, FreeBSD, and NetBSD, Bochs will forward packets to and from the + operating system so that the guest OS can talk on the physical network. + Unfortunately, on some platforms the guest OS can talk to any machine on + the network BUT NOT the host machine. On Windows and on systems that + allow the TAP or TUN/TAP interface, there is no such limitation. Often + the host machine may be configured so the guest OS has access to the + internet. On MacOSX, you may download the TUN driver from: + http://chrisp.de/en/projects/tunnel.html +
Parallel PortYesParallel port emulation was added by Volker Ruppert for Bochs 1.3. + Data that is sent to the parallel port by the guest OS can be saved into a + file or sent directly into the parallel port device (Unix only). +
Serial PortYesThe serial port (single 16550A UART emulation) is usable, on GNU/Linux, + NetBSD, OpenBSD, FreeBSD and MacOSX as host and guest. On other OSes the + emulation is present, but the connection to hard- or software of the host is + not implemented yet. Up to 4 ports are available. +
GameportYesEmulates a standard PC gameport. The connection to a real joystick is + currently supported on Linux and win32 only. +
PCIYesEmulates most of the i440FX PCI chipset. The Host-to-PCI bridge + (PMC/DBX), the PCI-to-ISA bridge and the PCI IDE controller (PIIX3) are + available. For PCI cards there are 5 PCI slots supported. +
USBincompleteThe USB root hub and the devices 'mouse', 'tablet', 'keypad' and + 'disk' are available. Plugging in and removing devices at runtime is + possible, but still experimental. Access to real hardware is not + implemented yet. +
PluginsYesPlugins are supported on Linux, MacOS X, Solaris, and Cygwin.
16/32 bit addressingYes16 or 32 bit operand sizes, stack size, and addressing
v8086/pagingYesVirtual-8086 mode including optional v8086 mode extensions (VME) and paging
PICYesMaster and slave programmable interrupt controller. +
CMOS functionsYesCMOS functions
Dynamic Translation/VirtualizationNoBecause Bochs is designed to be portable, it does not attempt + to do any dynamic code translation or virtualization. See + Section 1.1 for details. +
Simulate a MultiprocessorYesBochs can be configured to simulate up to 8 processors. This + feature is still experimental, but it can boot Linux 2.2 kernels with SMP + support. Please note that this does NOT mean that Bochs can run + faster on a physical SMP machine. +
Take advantage of your SMP boxNoAt present, Bochs does not use threads or parallel processing, so it + will not run any faster on multiprocessor hardware. +
Copy and PasteYesDepending on the host platform, the text-mode screen text can be + exported to the clipboard. Text in the clipboard can also be pasted, through + Bochs, to the guest OS, as simulated keystrokes. +

PrevHomeNext
Third Party Software Licensing and Temporary FilesUpSupported Platforms
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/feedback-support.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/feedback-support.html new file mode 100644 index 0000000..c46d213 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/feedback-support.html @@ -0,0 +1,323 @@ + +Feedback and Support
Bochs User Manual
PrevNext

Chapter 7. Feedback and Support

7.1. The Bochs project on SourceForge

The Bochs project page +on SourceForge provides these features: +

  • Project summary page with screenshots and download statistics

  • Download area for Bochs release packages and disk images

  • Mailing list archives

  • Source code browser

  • Tickets section (bug reports, patches, feature requests etc.)

  • Discussion boards (e.g. "Help" and "Open Discussion")

  • Project news page (used for release announcements)

7.1.1. SourceForge tickets section (bug and patch trackers)

There are some requirements when submitting bug reports, patches and feature +requests for Bochs to make it easier to reproduce bugs and test patches.

7.1.1.1. Reporting errors from Bochs compilation

When reporting errors while building Bochs to the bochs-developers mailing list or the SF bug +tracker for the Bochs project, this information is required to fix the issue: +

  • host platorm / build environment

  • Bochs release version or SVN revision

  • configure options used

  • full error message

  • config.log output if configure failure

  • source file name and line number if compile error

Before reporting us the issue, make sure that a similar one hasn't been already +reported or someone created a patch to fix it. If you are familiar with C++ +and you can write some code to fix your problem, you can post it in the bochs-developers mailing list +or submit the patch in SF patch tracker for Bochs.

7.1.1.2. Reporting Bochs runtime issues

If Bochs does not work properly (e.g. panic, segfault, malfunction of emulated device) +we need some information to find out what's going on: +

  • Bochs version used (version number if binary release / SVN revision + if self-compiled)

  • host platorm / build environment (if self-compiled)

  • bochsrc options used

  • error message (if panic or program termination)

  • log file output (related section only if too big)

7.1.1.3. Submitting a patch for Bochs

Patches for Bochs should be provided in the "unified diff" format. In addition +to the patch file and a detailed description this information is required: +

  • patch applies to Bochs release version / SVN revision

  • test case (if required)

When you are are interested in writing a patch to fix bugs or add new features, +you should have a look at the developer documentation. +For some parts of the Bochs code we have already written some basic information.


PrevHomeNext
Text-mode is broken in some ancient DOS program Mailing Lists
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/get-src-cvs.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/get-src-cvs.html new file mode 100644 index 0000000..f312eed --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/get-src-cvs.html @@ -0,0 +1,833 @@ + +Tracking the source code with CVS
Bochs User Manual
PrevChapter 3. InstallationNext

3.2. Tracking the source code with CVS

CVS, or Concurrent Version System, is a software development tool that helps +to keep track of the different revisions of each file. It is used by many +open source (and commercial) projects to allow multiple developers to share +their changes to the source code. The Bochs source code and documentation +are available using CVS[1].

3.2.1. Checking out Bochs

When you have CVS installed, the first step is to do a login and checkout. The +initial checkout command is long and ugly, but usually you only have to do it +once. The example below shows the CVS checkout process in Unix. On the +Windows platform, you can download a CVS client from cvshome.com, or +use CVS within Cygwin[2]. + +

Figure 3-1. Checking out Bochs in CVS

  user$ cvs -d:pserver:anonymous@bochs.cvs.sourceforge.net:/cvsroot/bochs login
+  (Logging in to anonymous@bochs.cvs.sourceforge.net)
+  CVS password:    (there is no password, just press Enter)
+  user$ cvs -z3 -d:pserver:anonymous@bochs.cvs.sourceforge.net:/cvsroot/bochs checkout bochs
+  cvs server: Updating bochs
+  U bochs/.bochsrc
+  U bochs/.conf.AIX.4.3.1
+  U bochs/.conf.beos-x86-R4
+  U bochs/.conf.macos
+     .
+     .   (This might take a few minutes, depending on your network connection.)
+     .
+  U bochs/patches/patch.seg-limit-real
+  user$ cd bochs
+  user$ ls
+  Bochs.proj.hqx  bxversion.h   fpu/                osdep.cc
+  CHANGES         config.h.in   gui/                osdep.h
+  COPYING         configure*    install-x11-fonts*  patches/
+  CVS/            configure.in  instrument/         pc_system.cc
+  Makefile.in     cpu/          iodev/              pc_system.h
+  README          bx_debug/     load32bitOShack.cc  state_file.cc
+  TESTFORM.txt    disasm/       logio.cc            state_file.h
+  bios/           doc/          macintosh.txt       win32.txt
+  bochs.h         docs-html/    main.cc
+  bochs.rsrc.hqx  dynamic/      memory/
+  build/          font/         misc/
+  user$ _

Note: This is just an example output of a checkout of an older version of Bochs. + You most likely will see more/other files.

Tip: If you have write access to the Bochs CVS tree, the checkout +command is different for you. See the Developers Guide[3] for details.

Tip: If you use remote CVS for other projects, you might have already set +the environment variable CVS_RSH in your configuration +files. For the CVS checkout to work as shown above, the +CVS_RSH variable should either be empty or set to +rsh.

The CVS checkout process (above) gives you a directory called bochs that +contains the very latest source code. I will refer to this directory +as $BOCHS. In each subdirectory directory there's also a +directory called "CVS" which tells the cvs software where the code was checked +out, what version you have, and where to go for future updates.

3.2.2. Getting the Latest Version

Most developers use CVS to always give them the latest source code. The minute +that any developer checks in a change, they are available to everyone else +through CVS. You just have to type cvs update -d -A in the +$BOCHS directory, and CVS will retrieve any files and directories that have +been changed since you did a checkout. If you update regularly, each update +takes a short time because it downloads only the files that changed. The +-d option tells cvs to download new directories that +have been checked in, not just files. The -A option means +to get the most recent version of each file, as opposed to a release version. +See Getting a release version +Both -d and -A can be omitted in many +cases, once you are familiar with the process.

The cvs update -A -d command tells you if any new files have +been downloaded from the server, and it also tells you if you have modified any +of the CVS-controlled files. As it checks through the source directories, it +will list files that have changed, with a single letter before the name that +tells the status of that file. The most common status letters are listed +below. + +

Table 3-1. Status letters in a CVS update

LetterMeaningDescription
?unknown This file is in your bochs directory, but CVS does not know anything + about it. For example, when you compile Bochs, any files created + during the build process appear as ?. +
Uupdate cvs downloaded a new version of this file because it changed on the + server, usually because someone else did a checkin. +
Ppatch This does the same as U, but instead of sending the whole file + (update), only a diff/patch is sent, thus, less bandwidth is used. +
Mmodified You have changed this file on your disk, so it no longer matches the + version on the server. This is not a problem; it's just for your + information. If you want, you can discard your changes and + get a fresh copy by deleting the file and running cvs update again. +
Cconflict You have changed this file on your disk, but this change conflicts with + a change that was checked in. Conflicts occur when two people change + the same line of code in different ways. You need to edit the + conflicting file(s) and clean it up by hand. Or, sometimes it's + easiest to discard your own edits and download a fresh copy, by + deleting the conflicting file and running cvs update again. +

If you have been using cvs update with "sticky tags" to +retrieve other versions, as described later, cvs will remember which version +you were looking at. In this case, a cvs update will keep +your sources consistent with that version. If you want to get back to looking +at the latest code again, be sure to use the -A option to +clears the sticky tags.

3.2.3. Getting a Release Version

Once you have a CVS checkout, you can also use the update command to +get the Bochs source code for any release since March 2000. The command +is cvs update -d -r tagname. +The tag tells which release you want, and it can be one of the following: + +

Table 3-2. CVS Release Tags

Bochs versionRelease tag for CVS
2.3.5REL_2_3_5_FINAL
2.3REL_2_3_FINAL
2.2.6 (intermediate2)REL_2_2_6_FINAL
2.2.5 (intermediate1)REL_2_2_5_FINAL
2.2.1 (bugfix1)REL_2_2_1_FINAL
2.2REL_2_2_FINAL
2.1.1 (bugfix1)REL_2_1_1_FINAL
2.1REL_2_1_FINAL
2.0.2 (bugfix2)REL_2_0_2_FINAL
2.0.1 (bugfix1)REL_2_0_1_FINAL
2.0REL_2_0_FINAL
1.4.1 (bugfix1)REL_1_4_1_FINAL
1.4REL_1_4_FINAL
1.3REL_1_3_FINAL
1.2.1 (bugfix1)REL_1_2_1_FINAL
1.2REL_1_2_FINAL
1.1.2 (bugfix3)REL_1_1_2_BASE
1.1.1 (bugfix2)REL_1_1_1_BASE
1.1 (bugfix1)REL_1_1_BASE
March 25, 2000REL-bochs-2000-03-25
+ +

Tip: To get a complete list of allowed tags, type cvs stat -v README. Many of the tags are not generally useful.

+ +Once you have done an update with -r tagname, you have made a "sticky tag." The stickiness refers to the fact +that CVS remembers which tag you have used most recently. The tag is stored +in the CVS subdirectory, so it stays around even if you log off and +return later. After creating a sticky tag, any future cvs updates will +try to keep your directory in sync with the version you chose. In other +words, when developers check in changes you will not +see them because your directory is "stuck" looking at an old version. +To clear the sticky tag, use cvs update -A.

A variation on the sticky tag concept is a sticky date[4]. If some feature was working at some time in the past, but +is no longer working, you can ask CVS to give you the sources from any +date. cvs update -D 2001-06-14 will download the +Bochs source as they were on June 14, 2001. Again, use -A +to clear the sticky date and track the current sources.

3.2.4. More about CVS

Entire books have been written on CVS, so there's no sense in duplicating +it all here in the Bochs documentation. Some sources of additional +information are listed below.

  • The cvshome.com +site has tons of CVS FAQs and documentation, including the official CVS +manual by Per Cederqvist.

  • Another CVS FAQ is available at University of Utah.

Notes

[1]

You can download CVS software and documentation from +www.cvshome.org.

[2]

Cygwin is an open source Unix-like environment for Windows platforms, +available at www.cygwin.com.

[3]

See the Developers Guide +and/or look at CVS repository information, +section "Developer CVS Access via SSH", for instructions.

[4]

According to some sources, this is when you eat dinner with someone, and +accidentally spill a drink on him/her.


PrevHomeNext
InstallationUpInstalling a Binary
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/get-src-svn.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/get-src-svn.html new file mode 100644 index 0000000..f25c4bf --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/get-src-svn.html @@ -0,0 +1,881 @@ + +Tracking the source code with SVN
Bochs User Manual
PrevChapter 3. InstallationNext

3.2. Tracking the source code with SVN

SVN (Subversion) is a tool used by many software developers to manage changes +within their source code tree. SVN provides the means to store not only the +current version of a piece of source code, but a record of all changes (and who +made those changes) that have occurred to that source code. Use of SVN is +particularly common on projects with multiple developers, since SVN ensures +changes made by one developer are not accidentally removed when another +developer posts their changes to the source tree. The Bochs source code and +documentation are available using SVN[1].

3.2.1. Checking out Bochs

When you have SVN installed, the first step is to do a checkout. The initial +checkout command is long and ugly, but usually you only have to do it +once. The example below shows the SVN checkout process of the Bochs trunk in Unix. +On the Windows platform, you can download a SVN client from +subversion.apache.org, +or use SVN within Cygwin[2]. + +

Figure 3-1. Checking out Bochs in SVN

  user$ svn co http://svn.code.sf.net/p/bochs/code/trunk/bochs bochs
+  A    bochs/ltdl.c
+  A    bochs/Makefile.in
+  A    bochs/bochs.h
+  .
+  .   (This might take a few minutes, depending on your network connection.)
+  .
+  A    bochs/install.sh
+   U   bochs
+  Checkout, Revision 10754.
+  user$ cd bochs
+  user$ ls
+  aclocal.m4       cpu                 logio.cc        pc_system.cc
+  bios             cpudb.h             ltdl.c          pc_system.h
+  bochs.h          crc.cc              ltdlconf.h.in   plugin.cc
+  build            disasm              ltdl.h          plugin.h
+  bx_debug         doc                 ltmain.sh       README
+  bxversion.h.in   docs-html           main.cc         README-plugins
+  bxversion.rc.in  extplugin.h         Makefile.in     README.rfb
+  CHANGES          fpu                 memory          README-wxWindows
+  config.cc        gdbstub.cc          misc            TESTFORM.txt
+  config.guess     gui                 msrs.def        TODO
+  config.h.in      host                osdep.cc        win32_enh_dbg.rc
+  config.sub       install-sh          osdep.h         win32res.rc
+  configure        instrument          param_names.h   wxbochs.rc
+  configure.in     iodev               PARAM_TREE.txt
+  COPYING          load32bitOShack.cc  patches
+  user$ _

Note: This is just an example output of a checkout of specific version of the Bochs + trunk and folder. Depending on the checkout command and revision, you most + likely will see more/other files.

Tip: If you have write access to the Bochs SVN tree, see the Developers Guide +[3] for details.

The SVN checkout process (above) gives you a directory called bochs +that contains the very latest source code. I will refer to this directory +as $BOCHS. In this directory there's also a subdirectory called ".svn" +which tells the SVN software where the code was checked out, what version +you have, and where to go for future updates.

3.2.2. Getting the Latest Version

Most developers use SVN to always give them the latest source code. The minute +that any developer checks in a change, they are available to everyone else +through SVN. You just have to type svn update in the +$BOCHS directory, and SVN will retrieve any files and directories that have +been changed since you did a checkout. If you update regularly, each update +takes a short time because it downloads only the files that changed. +See also Getting a release version.

The svn update command tells you if any new files have +been downloaded from the server, and it also tells you if you have modified any +of the SVN-controlled files. As it checks through the source directories, it +will list files that have changed, with a single letter before the name that +tells the status of that file. The most common status letters are listed +below. + +

Table 3-1. Status letters in a SVN update

LetterMeaningDescription
?unknown This file is in your bochs directory, but SVN does not know anything + about it. For example, when you compile Bochs, any files created + during the build process appear as ?. +
Uupdate SVN downloaded a new version of this file because it changed on the + server, usually because someone else did a checkin. +
Aadded SVN downloaded a newly added file from the server. +
Ddeleted This file has been deleted on the server and SVN removed it from your + local copy. +
Cconflict You have changed this file on your disk, but this change conflicts with + a change that was checked in. Conflicts occur when two people change + the same line of code in different ways. You need to edit the + conflicting file(s) and clean it up by hand. Or, sometimes it's + easiest to discard your own edits and download a fresh copy, by + deleting the conflicting file and running svn update again. +

3.2.3. Getting a Release Version

You can also use the SVN checkout command to get the Bochs source code for +any release since March 2000. The command is +

  user$ svn co http://svn.code.sf.net/p/bochs/code/tags/tagname/bochs bochs
+The tagname tells which release you want, and it can be one of the following: + +

Table 3-2. Bochs Release Tags

Bochs versionRelease tag for SVNSVN revision
2.6.9 (intermediate)REL_2_6_9_FINAL13181
2.6.8 (intermediate)REL_2_6_8_FINAL12740
2.6.7 (intermediate)REL_2_6_7_FINAL12531
2.6.6 (bugfix)REL_2_6_6_FINAL12375
2.6.5 (intermediate)REL_2_6_5_FINAL12349
2.6.2 (bugfix)REL_2_6_2_FINAL11694
2.6.1 (intermediate)REL_2_6_1_FINAL11667
2.6REL_2_6_FINAL11395
2.5.1 (bugfix)REL_2_5_1_FINAL10946
2.5REL_2_5_FINAL10801
2.4.6REL_2_4_6_FINAL10202
2.4.5REL_2_4_5_FINAL9914
2.4.2REL_2_4_2_FINAL9568
2.4.1REL_2_4_1_FINAL9368
2.4REL_2_4_FINAL9289
2.3.7REL_2_3_7_FINAL8537
2.3.6REL_2_3_6_FINAL8111
2.3.5REL_2_3_5_FINAL7840
2.3REL_2_3_FINAL7538
2.2.6 (intermediate2)REL_2_2_6_FINAL7060
2.2.5 (intermediate1)REL_2_2_5_FINAL6942
2.2.1 (bugfix1)REL_2_2_1_FINAL6624
2.2REL_2_2_FINAL6476
2.1.1 (bugfix1)REL_2_1_1_FINAL5560
2.1REL_2_1_FINAL5441
2.0.2 (bugfix2)REL_2_0_2_FINAL4592
2.0.1 (bugfix1)REL_2_0_1_FINAL4491
2.0REL_2_0_FINAL4409
1.4.1 (bugfix1)REL_1_4_1_FINAL2513
1.4REL_1_4_FINAL2235
1.3REL_1_3_FINAL1705
1.2.1 (bugfix1)REL_1_2_1_FINAL912
1.2REL_1_2_FINAL797
1.1.2 (bugfix3)REL_1_1_2_BASE510
1.1.1 (bugfix2)REL_1_1_1_BASE57
1.1 (bugfix1)REL_1_1_BASE51
1.0 (bochs-2000_0325a)REL-bochs-2000-03-257

3.2.4. More about SVN

Entire books have been written on SVN, so there's no sense in duplicating +it all here in the Bochs documentation. Some sources of additional +information are listed below.

Notes

[1]

You can download SVN software and documentation from +subversion.apache.org.

[2]

Cygwin is an open source Unix-like environment for Windows platforms, +available at www.cygwin.com.

[3]

See the Developers Guide +and/or look at +SourceForge's Subversion documentation, +for instructions.


PrevHomeNext
InstallationUpInstalling a Binary
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-dos.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-dos.html new file mode 100644 index 0000000..146a3a8 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-dos.html @@ -0,0 +1,310 @@ + +DOS
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.8. DOS

You must read the message regarding software licenses in +Section 1.6 before you install or use MS-DOS, OS/2, DR-DOS, or any other DOS as a guest operating system in Bochs.

9.8.1. Accessing your CDROM

To access your CDROM in DOS, you must download an IDE CDROM driver. +Bochs emulates a very generic CDROM drive, and several drivers are known to +work. Others don't. This section describes how to set up your +config.sys and autoexec.bat to enable +the CDROM.

The drivers that have been reported to work are +OAKCDROM.SYS that comes with several versions of Windows +and SBIDE.SYS version 1.21 from Creative +Labs[1] and OAKCDROM.SYS that comes with several versions of Windows. +Copy the driver to your boot disk, and then set up the startup files as follows.

config.sys:
+  device=himem.sys
+  device=oakcdrom.sys /D:CD001
+      -or-
+  device=sbide.sys /D:CD001 /P:1f0,14,3f6
+
+autoexec.bat:
+  mscdex.exe /M:10 /D:CD001

If the files mentioned in config.sys and +autoexec.bat are not in the root directory, give the full +pathname, like c:\windows\himem.sys.

9.8.2. SB16 driver for DOS

To use the SB16 device in DOS you need to load a driver for it. The file SBBASIC.EXE contains a self-extracting archive with all required file. +After unpacking it to C:\SB16 you can execute INSTALL.EXE +to install the driver. The file DISK.ID should contain the version +string SDR-31STD-1-US (Revision 1).

9.8.3. Bootdisks of early DOS versions

On the Web there are bootdisks available for most of the DOS versions ever released, +but some of them have been reported to fail in Bochs. The bootdisk for MS-DOS 1.25 +contains a boot sector of a newer DOS version, so it would fail on real hardware, +too. The floppy image for MS-DOS 2.11 has a boot sector that tries to boot from +hard disk instead of the floppy.

Notes

[1]

To get it, go to Creative Labs web +site, click on Support, then click Download Files. You get to a screen +where you must select the operating system and the product for which you want +the driver. Choose DOS as the operating system, and "CD-ROM: 4x and above" as +the product. There are several choices, but you want +sbide121.exe from April 15, 1997. Version 2.0 does not +work. The download file is a self-extracting ZIP file, so on +DOS or Windows you just run it; on other platforms you can try using +the unzip command. The driver is called SBIDE.SYS.


PrevHomeNext
GNU (Also known as GNU/Hurd)UpWindows 95
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-freebsd.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-freebsd.html new file mode 100644 index 0000000..770f90d --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-freebsd.html @@ -0,0 +1,370 @@ + +FreeBSD 5.2.1
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.5. FreeBSD 5.2.1

Contributed by Alexander Schuch. +

This section describes how to install FreeBSD 5.2.1 (miniinst) inside of Bochs, using an ISO image. +

9.5.1. Getting FreeBSD

As 5.2.1-RELEASE-i386-miniinst.iso (240M) is no longer available from + the FreeBSD FTP server, you might want to ask a (file) search engine of your choice + for a download location. Once you downloaded the file, you should check its integrity + using the provided MD5 checksum from the + FreeBSD 5.2.1 release announcement. +

9.5.2. Preparing Bochs

Create a new hard disk image using bximage (see + Section 8.19) with a size of at least 350M, as the standard + installation uses 280M on its own. +

Next, you need to setup your bochsrc so that Bochs knows about your + (still empty) hard disk, as well as about your ISO image. Make Bochs boot from CD-ROM and + start the emulation. +

9.5.3. Installing FreeBSD

This is just a very short step-by-step installation guide for FreeBSD in Bochs. It + doesn't explain what you do nor why you do it, it just tells you how to do it. + For in-deepth information refer to the FreeBSD handbook: + Installing FreeBSD. +

FreeBSD boots up and shows a nice (text-mode) boot option screen. Just press + return there, that is, use the default option. After loading the + kernel and needed device drivers, select 'Standard' in the installation menu. +

A fdisk like partition program is loaded next, where you just press A + to use the entire disk, followed by Q to finish the selection. The next + dialog asks for the boot manager you want to use. Select 'Standard' and continue. +

In the Disklabel Editor, you have to setup the layout of your partition. If your (virtual) + hard disk is large enough, you can press A for auto-layout. However, you + need to make sure that the /usr partition is at least + 250M large, or you will end up with a 'disk full' error message during installation. If + this is not the case, select one partition after another and press D to + delete it again. After you deleted all partitions, create two new ones. The first one will + be a swap partition; press C, enter '32M' as size and select 'Swap' from + the dialog. Press C again, and accept the remaining capacity for your + filesystem partition. Choose 'FS' as partition type and enter '/' (slash) as mount point. + Your partition layout is complete now; press Q to leave the editor. + +

Note: This 'all-in-one' partition layout is not recommended for a FreeBSD installation on a + real box; use 'auto-layout' or something comparable to that there. +

+

You now can choose what set of programs/files (distribution) you want to install. Take + 'User' (option 8), and select 'No' when asked to install the ports collection. You are + back in the distribution selection, where you select the first item, called 'Exit'. + Choose to install from 'CD/DVD' and answer the 'Are you sure?' dialog with 'yes'. +

Now, while FreeBSD installs, it is a very good time to take a look at the + FreeBSD documentation, especially + the FreeBSD handbook + and the FreeBSD FAQ. +

9.5.4. Post-installation configuration

All files are installed on your (virtual) hard disk now, and FreeBSD is ready for getting set + up. As this is a very basic FreeBSD installation, you just answer 'no' to nearly all questions, + but the one about your mouse: Answer 'yes' for PS/2 mouse, and choose 'Exit' at mouse configuration. + The miniinst FreeBSD ISO image contains nearly no binary packages, so don't browse the package + collection. Then, when asked to create a new user account, answer 'yes' and create a new user + called 'bochs' (or whatever you like). You might want to use /bin/csh + or /bin/tcsh as shell rather than /bin/sh. Next, + you are asked for the super user (root) password. The installation is finished now, there is + no need to visit the general configuration menu again - answer 'no' to that question. FreeBSD + will then reboot. Shutdown Bochs, as soon as the (virtual) computer boots. +

9.5.5. Using FreeBSD

Open your bochsrc and change the boot sequence, so that Bochs will boot + from hard disk, rather than from CD-ROM from now on. Start Bochs again and watch the FreeBSD + boot process. +

Your keyboard might use the wrong keymap, so login (into FreeBSD) as super user and use + /stand/sysinstall to start the FreeBSD configuration program. Choose + 'keymap' and select the keymap you want to use. +

You have successfully installed FreeBSD now. You might want to shutdown FreeBSD using + shutdown -h now, quit Bochs, and create a backup of your hard disk + image, before you start playing around. +


PrevHomeNext
OpenBSDUpFreeDOS Beta 8
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-freedos.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-freedos.html new file mode 100644 index 0000000..8f377ea --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-freedos.html @@ -0,0 +1,191 @@ + +FreeDOS Beta 8
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.6. FreeDOS Beta 8

This has been contributed by Volker Ruppert. + +
1. Download FDB8_144.DSK and base1.zip from www.freedos.org
+2. Unpack base1.zip to a local directory
+3. Create harddisk image with bximage (e.g. c.img with 10 MB)
+4. Create floppy image 'base1.img' with bximage
+5. Set up mtools.conf to access the new floppy image
+6. Copy the installation files from the local directory to the floppy using mcopy
+
+7. Set up Bochs for the FreeDOS installation:
+
+   boot: floppy
+   floppya: 1_44=FDB8_144.DSK, status=inserted
+   floppyb: 1_44=base1.img, status=inserted
+   ata0-master: type=disk, path=c.img, cylinders=20, heads=16, spt=63
+
+8. Unfortunately the format command fails here if it is called from the install
+   program. So I chose this way to prepare the main installation:
+
+   a. Start bochs and select 'Clean Boot [4]' in the install menu
+   b. Partition the harddisk with fdisk
+   c. After the reboot select 'Clean Boot [4]' again
+   d. Format the harddisk with 'format c: /s'
+   e. Press the reset button to reboot and select 'Mini Install [0]'
+
+7. Follow the instructions of the installation program. The source for the
+   installation is 'b:\'. After completing the installation you have to copy
+   the config.sys and autoexec.bat from the FreeDOS directory (e.g. C:\FDOS)
+   to 'c:\'.
+
+8. Quit Bochs and change the boot drive to 'c'. FreeDOS should boot from harddisk
+   without errors.
+
+9. I haven't tried the mouse or cdrom features inside of FreeDOS yet.


PrevHomeNext
FreeBSD 5.2.1UpGNU (Also known as GNU/Hurd)
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-gnu.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-gnu.html new file mode 100644 index 0000000..ff68cd5 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-gnu.html @@ -0,0 +1,820 @@ + +GNU (Also known as GNU/Hurd)
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.7. GNU (Also known as GNU/Hurd)

9.7.1. Installing GNU

This has been contributed by Bruno Bonfils (asyd at debian-fr dot org)

9.7.1.1. Introduction

Since I don't have enough computers to dedicate a box to GNU, I'm trying +to do my own harddrive image disk. I thougt there was +some documentation about how to do that. But since I didn't find +anything and I decided to write a small doc. I hope this document will be +useful for some people who wants to try the GNU/Hurd.

9.7.1.2. The testing box

Debian (Sid) GNU/Linux 2.4.19 
+
+ii  bochs          1.4.1.no.elpin IA-32 (x86) PC emulator
+ii  bochs-x        1.4.1.no.elpin Bochs binary with X interface.
+ii  grub           0.92+cvs200209 GRand Unified Bootloader
+ii  gcc-i386-gnu   1.7-8          Cheap cross-compiler for GNU/Hurd.
+ii  mig-i386-gnu   1.2-1          The GNU distribution of the Mach 3.0 interface
+ +If you don't have time and if you trust me, you can download here +[1] +my own image file. (You don't need to run native-install)

9.7.1.3. Creating the image

Note: In this example, I use a 112 MB image disk, but I think you +can use any size without some problem.

Use createdisk command like this : + +
# createdisk gnu.img 112 
+
+Disk Geometry:
+C: 227
+H: 16
+S: 63
+Total size: 117153792 bytes

Note on a paper or on your memory the disk geometry. Then, use the +losetup command to create a loopback on the whole disk. +
# losetup /dev/loop1 gnu.img

Now, call fdisk on /dev/loop1. Go into expert mode, and modify the +disk geometry using the c, h, s commands. Return in normal mode, and +create an unique primary partition which uses the whole disk. Then, +detach the /dev/loop1 using : + +
# losetup -d /dev/loop1

9.7.1.4. Installing GNU

  • Attach the partition

    +First of all, you need to create a filesystem on the disk. Use the +command losetup and -o <offset> option to attach /dev/loop1 on the first +partition of an image disk. Offset is computed like this :

    +offset = sector * block_size (512) + +
    # losetup -o 32256 /dev/loop1 gnu.img

  • Preparing the filesystem

    According to the GNU/Hurd Installation Guide +[2] +, use mke2fs to create a filesystem. + +
    # mke2fs -o hurd /dev/loop1
    + +Just mount /dev/loop1 like a typical dev. + +
    # mount /dev/loop1 /mnt/gnu

  • Finish the installation

    Download a GNU archive as indicated in the Hurd Installation Guide, and decompress it in /mnt/gnu. + +
    # cd /mnt/gnu
    +# tar --same-owner -xvzpf ~/gnu-latest.tar.gz

9.7.1.5. Bochs Configuration

Copy default configuration (/usr/share/doc/bochs/examples/bochsrc.gz on debian) +on your home directory and edit it with your favorite editor (GNU Emacs, i hope ;).

For my image file I have the following configuration : + +
romimage: file=/usr/share/bochs/BIOS-bochs-latest
+megs: 128
+vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest
+floppya: 1_44=/dev/fd0, status=ejected
+ata0-master: type=disk, path="/home/asyd/travail/hurd/gnu.img", cylinders=227, heads=16, spt=63 # edit me
+ata0-slave: type=cdrom, path=/dev/cdrom, status=inserted
+boot: disk
+log: /dev/stdout
+panic: action=ask
+error: action=report
+info: action=report
+debug: action=ignore
+vga_update_interval: 300000
+keyboard_serial_delay: 250
+keyboard_paste_delay: 100000
+cpu: ips=1000000
+mouse: enabled=0
+private_colormap: enabled=0
+fullscreen: enabled=0
+screenmode: name="sample"
+ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0
+keyboard_mapping: enabled=0, map=
+keyboard_type: xt
+i440fxsupport: enabled=0
+ +note most of them are actually in the default Debian example file. If you use +these lines, don't forget to read the Networking section.

9.7.1.6. Note on GNU Mach

Remember that the Hurd is not a kernel, it's just a collection of libraries +and programs, so we can't actually boot the Hurd. We boot GNU Mach, and +then launch the base servers.

The default GNU Mach which is provided by the default GNU archive +contains some modules / drivers which are not needed in bochs +environment. If you use it, you'll probably have some kernel panic +while booting. Don't be afraid and just say alwayscont.

Note: in my archive, I use a recompiled GNU Mach which contains only the +drivers which are needed (--enable-floppy --enable-ide --enable-kmsg +--enable-ne2000). If you want more informations on how to compile your own +GNU Mach, just send me a mail and I'll add the section in this +document.

9.7.1.7. Final Step

Create a grub floppy disk or use my floppy image +[3] +Adapt your bochsrc +file according to your choice. If you want install Grub on the image disk, +remember to copy stage1, stage2 Grub's files into /mnt/gnu/boot/grub.

Launch bochs - as root if you want networking (using sudo for example).

If you have stage1 and stage2 file, you can install Grub on the MBR. +
<grub> root (hd0,0)
+<grub> setup (hd0)

Finally, booting GNU mach + +
<grub> root (hd0,0)
+<grub> kernel /boot/gnumach.gz root=hd0s1
+<grub> module /boot/serverboot.gz
+<grub> boot
+ +Now, you can read the official GNU/Hurd Installation Guide +[4] +.

9.7.1.8. Networking

You can try to test networking between the GNU/Linux (host OS) and the GNU/Hurd. +First of all, please read +[5] +, I currently have the *same* problem. +[6]

Verify your kernel configuration, you need to have : + +
CONFIG_NETLINK_DEV=m
+CONFIG_ETHERTAP=m
+ +(or y instead or m). Check if /dev/tap0 file exist, else create it +with + +
# mknod /dev/tap0 c 36 16
+ +and run this command on the guest os : + +
# ifconfig tap0 192.168.100.1 netmask 255.255.255.0
+ +Use ip 196.168.100.10 on the GNU/Hurd and you can ping 192.168.100.1

9.7.1.9. Thanks

  • Mmenal

  • #hurdfr, #hurd, #bochs channels (Freenode network)

  • All people who help me everyday on IRC

Copyright (c) Bruno Bonfils

Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 +or any later version published by the Free Software Foundation.

Notes

[1]

My own harddisk Image File (~20Mo)

[2]

GNU/Hurd Installation guide

[3]

Grub Floppy image : (coming soon)

[4]

GNU/Hurd Installation guide

[5]

new ethertap interface for linux, by Bryce Denney

[6]

This can be solved by using the tuntap interface (see Section 8.10)


PrevHomeNext
FreeDOS Beta 8UpDOS
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-knoppix.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-knoppix.html new file mode 100644 index 0000000..107db1f --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-knoppix.html @@ -0,0 +1,222 @@ + +Knoppix
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.2. Knoppix

Contributed by Alexander Schuch. +

9.2.1. Getting Knoppix

Knoppix is a live CD (700M) or live DVD (3.2G) based on Debian GNU/Linux, with lots of + ready-to-run programs (web browser, office suite, a few games, and more), using + KDE as desktop environment. It can be booted directly from CD, without + any installation needed. You can download it from knoppix.org. +

9.2.2. Preparing Bochs

As Knoppix runs completely from CD/DVD, you don't need to setup a hard disk. You just need to set up + the location of the downloaded ISO image in your bochsrc, and make Bochs boot + from it. Because Knoppix contains a graphical user interface, and has no other storage space but + the emulated RAM, it needs at least 128MB of it, see + megs option. Furthermore, you need to enable VBE support in + Bochs (see Section 8.16). +

9.2.3. Using Knoppix

There is nothing more to do! Just start Bochs and wait for Knoppix to load... +

Note: You are logged in as normal user, if you want to become super user, just su. + There is no password needed (empty password). +


PrevHomeNext
Guest operating systemsUpMinix
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-minix.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-minix.html new file mode 100644 index 0000000..b9ce79f --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-minix.html @@ -0,0 +1,150 @@ + +Minix
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.3. Minix

Please see the Minix on Bochs on Windows How-To by Al Woodhull.


PrevHomeNext
KnoppixUpOpenBSD
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-openbsd.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-openbsd.html new file mode 100644 index 0000000..6f25751 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-openbsd.html @@ -0,0 +1,146 @@ + +OpenBSD
Bochs User Manual
PrevChapter 9. Guest operating systemsNext


PrevHomeNext
MinixUpFreeBSD 5.2.1
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-osr5.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-osr5.html new file mode 100644 index 0000000..bf9f641 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-osr5.html @@ -0,0 +1,421 @@ + +SCO OpenServer 5.0.5
Bochs User Manual
PrevChapter 9. Guest operating systems 

9.16. SCO OpenServer 5.0.5

Contributed by Carl Sopchak

You must read the message regarding software licenses in +Section 1.6 before you install SCO OpenServer 5.0.5 as a guest operating system in Bochs.

Back in April and May of 2002, I did some work on Bochs +in order to get it to install and boot SCO's OpenServer 5.0.5 (OSR5). +Since that time, I have had several e-mails asking about this error message +or that. The newsgroup posts done at the time had all of the information that I knew, +so I pointed people there. (I had not used Bochs since...) +In February of 2003, I got another such e-mail. +Since the sender indicated they were willing to pay me to get this going for them, +I agreed to spend a few hours on it (for free, which is not common :-}). Subsequently, +I decided to document this once and for all. (I did not charge anyone anything, this time...)

Note: These steps were originally used with Bochs 1.4.1 (or thereabouts, +since I was using CVS heavily at the time). It is possible (likely) that later versions of Bochs +are more tolerant/bug free, and this install may be abbreviated. However, I have not tried +to streamline it at all.

These steps were performed and confirmed using Bochs version 2.0.2, and SCO OpenServer version 5.0.5. +The host OS was Red Hat Linux 8.0.

First, I downloaded the tarball, and extracted the source tree. I decided to use the tarball +instead of the RPM so that I knew what options were compiled in, etc. +
linux-$ tar -xzvf bochs-2.0.2.tar.gz

Next, I configured and compiled Bochs... +
linux-$ cd bochs-2.0.2
+linux-$ ./configure --enable-cdrom --enable-ne2000 --enable-host-specific-asms
+linux-$ make
+The --enable-host-specific-asms should only be used if the host OS is an Intel x86 based OS.

I then created my disk image: +
linux-$ ./bximage
+========================================================================
+                                bximage
+                  Disk Image Creation Tool for Bochs
+========================================================================
+
+Do you want to create a floppy disk image or a hard disk image?
+Please type hd or fd. [hd] hd
+
+What kind of image should I create?
+Please type flat, sparse or growing. [flat] 
+
+Enter the hard disk size in megabytes, between 1 and 32255
+[10] 2048
+
+I will create a hard disk image with
+  cyl=4161
+  heads=16
+  sectors per track=63
+  total sectors=4194288
+  total size=2047.99 megabytes
+
+What should I name the image?
+[c.img] hd0.img
+
+Writing: [] Done.
+
+I wrote 2147475456 bytes to hd0.img.
+
+The following line should appear in your .bochsrc:
+  ata0-master: type=disk, path="hd0.img", cylinders=4161, heads=16, spt=63

I then created my .bochsrc file. I did this via the interactive portion of Bochs, with the +end result as follows: +
floppya: 1_44="/dev/fd0", status=inserted
+floppyb: 1_44="b.img", status=inserted
+ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
+ata0-master: type=disk, path="hd0.img", cylinders=4161, heads=16, spt=63, translation=auto, biosdetect=auto, model="Generic 1234"
+ata0-slave: type=cdrom, path="/dev/cdrom", status=inserted, biosdetect=auto, model="Generic 1234"
+ata1: enabled=0
+ata2: enabled=0
+ata3: enabled=0
+romimage: file=bios/BIOS-bochs-latest
+vgaromimage: file=bios/VGABIOS-lgpl-latest
+megs: 64
+parport1: enabled=1, file="lp.pipe"
+com1: enabled=0
+# no sb16
+boot: cdrom
+floppy_bootsig_check: disabled=0
+vga_update_interval: 300000
+keyboard_serial_delay: 250
+keyboard_paste_delay: 100000
+cpu: ips=3000000
+clock: sync=realtime, time0=0
+text_snapshot_check: 0
+mouse: enabled=0
+private_colormap: enabled=0
+i440fxsupport: enabled=0
+# no ne2k
+# no loader
+log: osr5.log
+logprefix: %t-%e-%i%d
+debugger_log: -
+panic: action=ask
+error: action=report
+info: action=report
+debug: action=ignore
+pass: action=fatal
+keyboard_mapping: enabled=0, map=
+keyboard_type: mf
+user_shortcut: keys=none
+config_interface: textconfig
+display_library: x
+Some important things to note are that you want to boot from the cdrom, and you do NOT want the ne2000 +card configured initially. (We'll add that later...)

At this point, Bochs is ready to roll! Insert the OSR5 install CD into the drive, and start Bochs. +You should soon see the SCO "boot:" prompt: +
SCO OpenServer(TM) Release 5
+
+boot
+: defbootstr disable=fdi,dptr
+ +Note the disable= parameter that you need. These two SCO drivers cause the install to fail, so they +need to be disabled for the install boot. You will not need this once OSR5 is installed.

During the install of OSR5, there are two default configuration answers that need to be changed. +For the hard disk setup, you should turn bad tracking off, since it's unnecessary on an emulated disk. +(It won't hurt to do it, it will just take a VERY long time!) +For the network setup, change the network card to Deferred. You can change other settings, if you so +desire. However, I would do the initial install with as little configured as you can get away with, then +add whatever else is needed (one step at a time) after the initial install completes.

Let the install copy the files. Go get lunch. Take a nap. Go have dinner... +This can take a LONG time. On my Pentium 4 1.7GHz system, this +step took just over eight hours! (BTW, it was MUCH longer in version 1.4.1. Great job, guys!)

After the install finishes, you will need to change the following lines in .bochsrc file: +
ne2k: ioaddr=0x300, irq=10, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0
+boot: disk
+Obviously, if you're not using Linux, the ethmode and ethdev values on the ne2k line will be different. +Also, since Bochs uses "raw" network card access, you'll have to "setuid root" on the Bochs executable: +
linux-$ chown root bochs
+linux-$ chmod u+s bochs
+(If there is a way to give a "normal user" CAP_NET_RAW capability, that would be an alternative. +I don't know how to do that...) +Restart Bochs. Now, you can just press Enter at the OSR5 boot: prompt, because the offending +drivers have been linked out of the kernel.

Before you configure the network card, I'd strongly suggest getting the latest "nat" driver from SCO. +Version 5.0.5b of this driver, according to the SCO web site, "correct[s] possible system lockup +under high load due to internal buffer overflow." The driver can be found +here. +To get the Disk Image file into SCO, I downloaded the VOL.000.000 file to my linux box, +and used tar to get it on to a floppy: +
linux-$ tar -cvf /dev/fd0 VOL.000.000
+I then used tar within OSR5 to move it from the floppy to the /tmp directory: +
osr5-# cd /tmp
+osr5-# tar -xvf /dev/fd0135ds18
+You can then use 'custom' to install the driver from the image file. +You will then want to use 'scoadmin network' to configure the network card. Choose +the Novell NE2000 card, and set the parameters to match the ne2k: line in the .bochsrc file. +DO NOT have OSR5 look for the card, as Bochs may likely crash. (It did in version 1.4.1.)

You can also configure a printer, if you want. Using the spoolpipe utility that I wrote +(which can be found in Bochs' misc directory), you can print from OSR5 through the parallel +port, and you'll hardly notice +that the printing is going through an extra layer of operating system! +(You could also set up a printer using network printing, if the printer is not on the host machine...)

Obviously, dont forget to apply the release supplements and other patches that are considered +"must haves" for OSR5: rs505a, oss600a, oss497b (others?).

That's about as far as I have got. I played around with OSR5 within Bochs a bit, but I +can by no means say that I did any kind of real testing, let alone exhaustive testing.

And of course, YMMV! :-)


PrevHome 
Windows XPUp 
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win2k-server.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win2k-server.html new file mode 100644 index 0000000..4cb0022 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win2k-server.html @@ -0,0 +1,150 @@ + +Windows 2000 Server
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.14. Windows 2000 Server

You must read the message regarding software licenses in +Section 1.6 before you install Windows 2000 Server as a guest operating system in Bochs.


PrevHomeNext
Windows 2000UpWindows XP
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win2k.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win2k.html new file mode 100644 index 0000000..20b5168 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win2k.html @@ -0,0 +1,152 @@ + +Windows 2000
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.13. Windows 2000

You must read the message regarding software licenses in +Section 1.6 before you install Windows 2000 as a guest operating system in Bochs.


PrevHomeNext
Windows MEUpWindows 2000 Server
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win7.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win7.html new file mode 100644 index 0000000..6e5c790 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win7.html @@ -0,0 +1,152 @@ + +Windows 7
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.7. Windows 7

You must read the message regarding software licenses in +Section 1.6 before you install Windows 7 as a guest operating system in Bochs.


PrevHomeNext
Windows XPUpSCO OpenServer 5.0.5
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win95.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win95.html new file mode 100644 index 0000000..7a4df96 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win95.html @@ -0,0 +1,1049 @@ + +Windows 95
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.9. Windows 95

You must read the message regarding software licenses in Section 1.6 + before you install Windows 95 as a guest operating system in Bochs. +

Tip: If you want to use higher screen resolutions than 640x480 with more than 16 colours, + you should enable the Cirrus video card, see Section 8.17, as Windows 95 + comes with drivers for that video card. +

9.9.1. How to Install Windows 95 with floppies

Using Windows95 for PCs without Windows, 1.44M floppy distribution

Preparing for the install

Copy the floppies to files on your workstation. Keep in mind, +they are of 2 formats - 1.44M & 1.680M. The boot disk and +disk#1 are 1.44M. The rest of them (disk#2..disk#13) are +1.680M format. You may need a Linux workstation to do this +part, though it should be possible on others if the OS provides +a way to specify alternate floppy media geometries.

  format   tracks   heads  sectors/track
+  1.44M:     80       2        18
+  1.680M:    80       2        21
+
+
++- On linux, you achieve this, via the 'setfdprm' command, and
+|  associated parameters in the '/etc/fdprm' file.  Here's an
+|  excerpt from that file:
+|
+|    # /etc/fdprm  -  floppy disk parameter table
+|    1440/1440	2880    18   2  80    0 0x1B 0x00 0xCF     0x6C
+|    1680/1440	3360	21   2  80    0 0x0C 0x00 0xCF     0x6C # ?????
+|
+|  To copy the floppies, you would do something like:
+|
+|    linux-> cp /dev/fd0 win95_boot (after inserting the boot diskette)
+|    linux-> cp /dev/fd0 win95_d1   (after inserting disk #1)
+|
+|  Then switch to the alternate 1.680M geometry:
+|
+|    linux-> setfdprm -p /dev/fd0 1680/1440
+|    linux-> cp /dev/fd0 win95_d2   (after inserting disk #2)
+|    linux-> cp /dev/fd0 win95_d3   (after inserting disk #3)
+|    ...
+|    linux-> cp /dev/fd0 win95_d13  (after inserting disk #13)
+|
+|  And revert back to the default 1.44M geometry if desired
+|
++-   linux-> setfdprm -p /dev/fd0 1440/1440

You should end up with something similar to the following listing:

  -rw-r--r--   1 user     group    1474560 Oct 31 12:04 win95_boot
+  -rw-r--r--   1 user     group    1474560 Jul 15  1997 win95_d1
+
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d2
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d3
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d4
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d5
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d6
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d7
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d8
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d9
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d10
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d11
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d12
+  -rw-r--r--   1 user     group    1720320 Jul 15  1997 win95_d13

Create a hard disk image file. For example, for a 62M disk with +the following settings in bochsrc:

  ata0-master: type=disk, path=62M.img, cylinders=940, heads=8, spt=17
+
+use (940 * 8 * 17 * 512bytes-per-sector = 127840):
+
+  unix-> dd if=/dev/zero of=62M.img bs=512 count=127840

Setup your bochsrc file. For example:

  megs: 16
+  boot: disk
+  ata0-master: type=disk, path=62M.img, cylinders=940, heads=8, spt=17
+  floppya: 1_44=1.44, status=inserted
+  vgaromimage: file=bios/VGABIOS-lgpl-latest
+  romimage: file=bios/BIOS-bochs-latest
+  log: ./bochs.out
+  vga_update_interval: 300000
+  keyboard_serial_delay: 200

You'll also need a floppy image file, sort of a working file, +which you copy the distribution files into, one by one, as +they are needed. This is the file you point the 'floppya:' +directive in the bochsrc file to. Copy the Win'95 boot disk +to your floppy working file ('1.44' in the bochsrc example):

  unix-> /bin/cp -f win95_boot 1.44

Beginning the install

Fire up bochs and boot the Win'95 boot diskette:

  unix-> bochs boot:floppy
+
+  Microsoft Windows 95 Setup

Quit Setup to DOS to use FDISK.

  '[F3]', '[F3]'

FDISK C: to use the whole disk for the primary partition.

  A:\> fdisk
+  '[Return]'
+  '[Return]'
+  '[Return]'

Power down Bochs - click the mouse on the 'Power' button +in the GUI toolbar. Fire up bochs again.

  unix-> bochs boot:floppy
+
+  Microsoft Windows 95 Setup

Quit Setup to DOS to use FORMAT.

  '[F3]', '[F3]'
+  A:\> format /u c:

(answer 'Y' and enter a volume label as desired)

Click on the floppy A icon in the GUI toolbar. You should +see an 'X' through it signifying it's logically ejected. +Now we're ready for Disk1:

  unix-> /bin/cp -f win95_d1 1.44

Click on the floppy A icon again to logically insert +disk1. The 'X' should go away. Now run SETUP.EXE which is +on disk1.

  A:\> setup /C
+  To continue ...
+  '[Return]'
+  Welcome to Windows 95 Setup!...
+  '[Return]'  (to select Continue button)
+  Please insert "Disk2"...

From now on, keep in mind that you must click the floppy A +icon to tell bochs you're ejecting the floppy (in theory) +BEFORE you copy over your floppy working file on your +workstation, and click on it again AFTERWARDS, to insert it. +This is most critical, if you transition from images of +floppies with different format. (disk1=1.44M, disk2=1.680M) +You're giving bochs a chance to look at the size of the +image file, and switch to a different sectors-per-track.

  (Click the floppyA icon to eject)
+  unix-> /bin/cp -f win95_d2 1.44
+  (Click the floppyA icon to insert)
+
+  '[Return]'  (select OK button)
+  Software License Agreement
+  '[Tab]'
+  '[Return]'  (select Yes button)
+  Windows 95 Setup Wizard
+  '[Return]'  (select Next button)
+  Choose Directory
+  '[Return]'  (select Next button)
+  Setup Options
+  '[Down-Arrow]', '[Down-Arrow]', '[Down-Arrow]' (selects custom)
+  '[Return]'  (select Next button)
+  User Information
+  Name:
+  "Your name here"
+  '[Tab]'
+  Company:
+  "Your company here"
+  '[Return]'
+  Key Identification
+  Key:
+  "123-4567890"  (from your Certificate of Authenticity)
+  '[Return]'  (select Next button)
+  Product Identification
+  '[Return]'  (select Next button)
+  Analyzing Your Computer
+  '[Down-Arrow]'  (No, I want to modify the hardware list)
+  '[Return]'  (select Next button)
+  Analyzing Your Computer

Let me just note that you can get around in this screen, +by the Down-Arrow key, Tab to move to a different area, +and space to toggle selection. For some options, it's +much easier to first unselect every device of that +type, than select the one you want.

The ultimate selection you're trying to achieve is:

  CD-ROM Drive                    (none)
+  Display                         Default Standard VGA Display Adapter
+  Floppy Disk Controllers         Standard Floppy Controller
+  Hard Disk Controllers           Standard IDE/ESDI Hard Disk Controller
+  Keyboard                        Keyboard
+  Mouse                           (none)
+  Network Adapter                 (none)
+  PCMCIA Socket                   (none)
+  Ports                           (none)
+  SCSI Controllers                (none)
+  Sound, MIDI, or Video...        (none)

The exact sequence I used was:

  [Space]  (unselect all CD-ROMs)
+  [Down-Arrow]
+  [Space]  (unselect all Displays)
+  [Tab]  (move to Manufacturer and model section)
+  13 [Down-Arrows] (Default Standard VGA Display Adapter)
+  [Space] (to select this adapter)
+  4 [Tabs] (get back to Hardware types section)
+  2 [Down-Arrows] (get to Hard Disk Controllers)
+  [Space] (to unselect all Hard Disk Controllers)
+  [Tab]   (to get to Manufacturer and model section)
+  3 [Down-Arrows] (get to Standard IDE/...)
+  [Space] (to select this device)
+  4 [Tabs] (get back to Hardware types section)
+  2 [Down-Arrows] (get to Mouse)
+  [Space] (to unselect all Mouse types)
+  [Down-Arrow] (get to Network Adapter)
+  [Space] (to unselect all Network Adapters)
+  [Down-Arrow] (get to PCMCIA Socket)
+  [Space] (to unselect all PCMCIA Socket types)
+  [Down-Arrow] (get to Ports)
+  [Space] (to unselect all Ports)
+  [Down-Arrow] (get to SCSI Controllers)
+  [Space] (to unselect all SCSI Controllers)
+  [Down-Arrow] (get to Sound, MIDI...)
+  [Space] (to unselect all Sound, MIDI...)
+  3 [Tabs] (get to Next button)
+  [Return]  (select Next button)
+
+  Analyzing Your Computer
+  [Return] (select Next button)
+
+  Get Connected
+  [Return] (select Next button)
+
+  Select Components

Well, you have to decide this one. Remember, use [Down-Arrow], +[Tab], and [Space]. [Tab] to the Next button when you're done +and type [Return].

  Network Configuration
+  '[Return]' (to take default config, or change it as you want)
+
+  Computer Settings
+  '[Return]' (to take current settings)
+
+  Startup Disk

If you do NOT want to create a Startup Disk, you could type

  '[Down-Arrow]'  (select No, I do not want a startup disk)
+  '[Return]'      (select Next button)

If you DO want to create a Startup disk.

  '[Return]'      (select Next button)

It is possible to create a startup disk after the installation, so you may skip the creation of a startup disk if it becomes problematic.

Either way, the following appears,

  Start Copying Files
+  '[Return]'
+
++- If you optioned to create a Startup Disk, the following appears:
+|
+|    Label a disk "Windows 95 Startup Disk"...
+|
+|  Click the floppyA icon to eject.  Now copy any floppy image file
+|  which has a 1.44M format on it, onto your floppy working file.
+|  Win '95 will erase any files on it.  Use the 'win95_boot' file,
+|  since it's a 1.44M format.
+|
+|    unix-> /bin/cp -f win95_boot 1.44
+|
+|  Click on floppyA to insert.
+|
+|    '[Return]'
+|    Setup has finished creating your startup disk...
+|    '[Return]'  (select OK button)
+|
+|    Please insert the disk labeled 'Windows 95 Disk 2'...
+|
+|  Click the floppyA icon to eject.
+|  Copy the working floppy disk image file to something signifying
+|  it's the startup disk.  Then copy the disk#2 image file onto the
+|  working file.
+|
+|    unix-> cp 1.44 win95_startup
+|    unix-> /bin/cp -f win95_d2 1.44
+|
+|  Click on floppyA to insert.
+|
++-   '[Return]'  (select OK button)
+
+In any case (startup disk or not), the rest is very methodical.
+
++->  Please insert the disk labeled 'Windows 95 Disk 3'...
+|
+|    (Click the floppyA icon to eject.)
+|      unix-> /bin/cp -f win95_d3 1.44
+|    (Click the floppyA icon to insert.)
+|
+|    '[Return]'  (select OK button)
+|
+|  Just repeat this process, until SETUP has asked for all
++- 13 floppies in the distribution.  Of course, change
+   'win95_d3' to each number in the succession; win95_d4,
+   win95_d4, ... , win95_d13.

After asking for all the floppy disks in the distribution, +Windows '95 will let you know it's going to restart your +computer. Acknowledge this, and then bochs will bomb upon +attempt to reboot.

Fire up bochs again. The 'boot:disk' is not necessary if +you have the 'boot: disk' directive in your '.bochsrc' file.

  unix-> bochs boot:disk

You'll get a screen full of garbage text for a while Win '95 +updates your configuration files. I'm not handling that +text screen mode correctly. Then the window switches to +a blank graphics screen (say 2 to 5 minutes).

  Windows 95 is now setting up your hardware and any Plug
+  and Play devices you may have.

You'll see the magnifying glass circulating about the +picture (icon) representing your computer for quite +awhile.

  Windows is now setting up the following items...
+
+  Setting up Control Panel
+  Programs on the Start menu
+  Windows Help
+  MS-DOS program settings
+  Time zone

You can play with the Time Zone if you want. I just +accept the one that comes up. I like being on Tijuana +time anyhow!

  '[Return]'
+
+  Set up printer

Bochs printing support varies from host OS to host OS. Parallel port emulation was added in Bochs 1.3 for Unix platforms. Check to see if printing is supported for your host OS in Section 1.7 or the forums. You can skip this part during installation and set up printing features later. Cancel print setup in this manner:

  '[Tab]'
+  '[Return]'  (select Cancel button)
+
+  Windows 95 is now finalizing settings for your computer

Windows '95 should now display the 'Welcome to Windows 95' +screen, and give you one of it's helpful 'Did you know' tips. +My suggestion, is for you to shutdown Win '95 at this point, +and make a backup copy of your hard drive image file. +Otherwise, you are done, though you may want to check +out the section on getting rid of the 'splash' screen upon +boot. In that case, shutdown is necessary also.

  '[Return]'  (selects Close button)
+  '[Ctrl]', '[Esc]', '[^Esc]', '[^Ctrl]'

It's helpful to give slight intentional delays when typing +multi-key sequences like the one above. The '^' means a +release of that key.

  'u'  (shortcut for Shut Down)
+
+  Shut down Windows...
+  '[Return]'  (select Yes button)

Your window changes to a different size graphics mode. The +message 'It is now safe to shutdown your computer' will be +displayed briefly, but then the screen goes blank due to +bochs not handling something in that graphics mode correctly. + +Power down by clicking on the 'Power' button in the bochs +GUI toolbar. The bochs window disappears as bochs stops +execution. Make a backup copy.

  unix-> cp 62M.img 62M.win95.installedOK

Getting rid of Win '95 'splash' screen upon bootup.

When Win '95 boots up, it typically displays the intro +screen while it boots (splash screen). It uses a graphics +mode I don't handle well, mostly because it's not important +enough to spend the time on it. You can tell Win '95 +not to display this screen anyways, which I prefer.

Using the MTOOLS package, if you have a drive letter +associated with your hard disk image file, for example:

  ~/.mtoolsrc: drive c: file="/path/62M.img" partition=1

You can look at and modify the contents of your drive +image file, using commands on your workstation.

Note: WARNING: You MUST power down bochs if you are running any software that does any kind of disk caching!!! Yes, Windows '95 does disk caching.

Look at the attributes associated with c:/MSDOS.SYS.

  unix-> mattrib c:/MSDOS.SYS

Copy it to your workstation, with the text mode translation +flag.

  unix-> mcopy -t c:/MSDOS.SYS .

Edit the file, adding "Logo=0" under the Options section. Save the file.

  [Options]
+  BootMulti=1
+  BootGUI=1
+  Network=0
+  Logo=0      <------- add this line

Copy it back to your disk image. Restore proper +attributes to what they were before. For example.

  unix-> mcopy -t MSDOS.SYS c:/
+  unix-> mattrib -a +s +h +r c:/MSDOS.SYS

Finishing up after the install

You should now delete any temporary copies of the floppy disk +image files, used to facilitate installation.

  unix-> /bin/rm -i win95_boot win95_d*

OK, you're done!!! Make sure you tell bochs to boot the +hard drive either in '.bochsrc' or by the 'boot:disk' option, +and fire it up.

  unix-> bochs

9.9.2. Installing a Japanese version of Windows 95

The following has been contributed by dohzono at hf dot rim dot or dot jpa : + +
Here is a tip for installing Japanese win95.
+
+                    *
+
+I made a boot floppy and installed the W95 disk image. I used "CD for
+new machines" (not an upgrade version). Host OS is FreeBSD-4.0R. It
+seems working.
+
+When you make a boot floppy with W95(J), there is a line containing
+
+  DEVICE=JDISP.SYS /HS=LC
+
+in the config.sys (Highspeed Scroll?). jdisp.sys can have options:
+
+        /HS=ON
+        /HS=LC
+        /HS=OFF
+
+and bochs runs with /HS=OFF option (I've heard that VMware requires
+/HS=LC option).
+
+# If you choose /HS=ON, you can read usual Japanese messages on the
+# screen, but it doesn't scroll (the cursor goes downward and out of
+# the screen). If you choose /HS=LC, you can see some images
+# (corrupted messages), and also it doesn't scroll.
+
+Here is my boot floppy's config.sys. I just changed the option like
+above (/HS=OFF), and added a line for the CD driver.
+
+  DEVICE=BILING.SYS
+  DEVICE=JFONT.SYS /MSG=OFF
+  DEVICE=JDISP.SYS /HS=OFF
+  DEVICE=JKEYB.SYS
+  device=gscdrom.sys /d:mscd000 /v
+
+After installing to the HD image, I made a change to the line of
+c:/config.sys
+
+  DEVICE=JDISP.SYS
+
+to
+
+  DEVICE=JDISP.SYS /HS=OFF
+                   ^^^^^^^


PrevHomeNext
DOSUpWindows NT 4.0
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win98.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win98.html new file mode 100644 index 0000000..87c73b0 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-win98.html @@ -0,0 +1,1806 @@ + +Windows 98
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.11. Windows 98

You must read the message regarding software licenses in +Section 1.6 before you install Windows 98 as a guest operating system in Bochs.

Tip: If you want to use higher screen resolutions than 640x480 with more than 16 colours, +you should enable the Cirrus video card, see Section 8.17, as Windows 98 +comes with drivers for that video card.

There are two ways to get Windows 98 running as a guest operating system in Bochs:

  • mcopy Windows 98 - The first method is to copy files from a functional +Windows 98 installation partition. This initially will be less time consuming, as you will +not have to install the OS or the applications running on it. On the other +hand, you do not have the benefit of having an new installation especially +geared for Bochs. You will need mtools and your Windows 98 CD-ROM.

  • Classic Install - The second method is to do a fresh installation of Windows 98 on your virtual +hardware. This is a slow, tedious process. You will have the benefits, +however, of having a clean registry and a slimmer installation running only the +components you need. All you need for this method is your Windows 98 CD-ROM +and your license key.

You should NOT use your existing Windows 98 installation +for both your real hardware and as a guest OS in Bochs. When Windows 98 +detects changes in hardware, it will make changes in the installation. It will +deactivate certain drivers and devices and activate or install others. This is +what happens when you run an existing installation for the first time in Bochs.

9.11.1. Windows 98 Method 1: mcopy Windows 98 into Hard Disk Image (Linux Host)

In this method, files will simply be copied from a functional Windows +98 partition. For the impatient, here is a short summary:

  • Remove unnecessary files from your Windows partition.

  • Create a disk image with bximage.

  • Update your .bochsrc configuration file for the diskimage.

  • Use mtools to partition and format the image; the +copy all the windows files to the image.

  • Finally, start the simulation and let Windows reconfigure itself.

9.11.2. Locating Your Partitions

Make sure that your MS Windows partition is mounted. Check +/etc/fstab to see if and where it is mounted. For more +information on fstab, type man fstab at the command +prompt. You may also very carefully type fdisk -l and +df as root for more information on the partitions of your +computer. For example:

# cat /etc/fstab
+/dev/hda7       /              reiserfs     defaults 1 1
+/dev/hda5       /boot          ext2         defaults 1 2
+/dev/cdrom      /media/cdrom   auto         ro,noauto,user,exec 0 0
+devpts          /dev/pts       devpts       defaults 0 0
+/dev/hda3       /home          reiserfs     defaults 1 2
+/dev/hda1       /home2         ext2         defaults 1 2
+/dev/fd0        /media/floppy  auto         noauto,user,sync 0 0
+proc            /proc          proc         defaults 0 0
+usbdevfs        /proc/bus/usb  usbdevfs     defaults,noauto 0 0
+/dev/hda6       swap           swap         pri=42 0 0
+
+# fdisk -l
+Disk /dev/hda: 255 heads, 63 sectors, 1247 cylinders
+Units = cylinders of 16065 * 512 bytes
+
+   Device Boot    Start       End    Blocks   Id  System
+/dev/hda1   *         1       510   4096543+   b  Win95 FAT32
+/dev/hda2           511       794   2281230    5  Extended
+/dev/hda3           795      1247   3638722+  83  Linux
+/dev/hda5           511       513     24066   83  Linux
+/dev/hda6           514       539    208813+  82  Linux swap
+/dev/hda7           540       794   2048256   83  Linux
+
+# df
+Filesystem           1k-blocks      Used Available Use% Mounted on
+/dev/hda7              2048188   1844552    203636  91% /
+/dev/hda5                23302      3584     18515  17% /boot
+/dev/hda3              3638604    549220   3089384  16% /home
+shmfs                    63240         0     63240   0% /dev/shm
+//server/C$            4096512   3808000    288512  93% /shares/SERVER1/c
+//server/D$           13823744   3854848   9968896  28% /shares/SERVER1/d
+/dev/hda1              4032092   1897220   3794432  50% /windows/c

In this example, the Windows partition is on +/dev/hda1. It is mounted as +/windows/c and is it taking up 1,897,220 bytes, or roughly 2 gigabytes. This +means that the disk image you would need to create in this instance would need to be +at least that size if you plan to put all the files from your Windows +partition there.

9.11.3. Cleaning Up Your MS Windows Partition

You will save some space if you omit what is in your My Documents and Windows Update directory. You may also want to use the Windows Disk Cleanup to delete all your temporary files:

  • Reboot into Windows 98

  • Double click on "My Computer"

  • Right click on your "C" drive. A small menu should appear.

  • Click on "Properties"

  • Click on "Disk Cleanup"

  • Make sure "Temporary Internet Files", "Temporary Files", "Downloaded Program Files", and "Recycle Bin" are all selected.

  • Click on the "OK" button.

  • When it says "Are you sure you want to delete files?", click "Yes"

You will want to minimize the amount of files you will have to transfer to your new disk image. +Before you reboot into Linux, you may want to do a search for *.tiff, +*.jpg, *.avi, *.mov, *.mpg, *.mp3, *.wav, *.ra, *.rm, *.ram, and *.wmf files. +Move these somewhere under the My +Documents hierarchy. Do so only if it does not disrupt your setup, + and if the files are not already there:

  • Open up My Documents

  • From the File Menu, click on File => New => +Folder

  • Type big_files in the folder name box.

  • Double Click on the big_files folder. +Leave this window open.

  • Click on Start => Find => Files or Folders

  • In the Named: input box, type *.tiff, *.jpg, *.avi, *.mov, *.mpg, *.mp3 *.wav *.ra *.rm *.ram *.wmf

  • The Look In field should be C:\, and the Inlcude Subfolders checkbox should be checked.

  • Press Enter.

  • Drag and drop files that are NOT part of a program, NOT in the +Program Files Directory, and NOT in the +Windows directory into an empty space in your +big_files folder. Be sure you know what you are +moving.

  • When the files are done moving, reboot into Linux: +Start => Shutdown => OK

9.11.4. Mounting Your Windows Partition

If you have a Network File System (NFS) mounted, you +could also use these files as source files. In example shown in the previous +section, the filesystem +mounted on /share/SERVER1/c is from a Windows 2000 server.

If your Windows 98 partition is not mounted, and it lives on +/dev/hda1, type the following as root:

mkdir /windows
+mkdir /windows/c
+mount -t vfat /dev/hda1 /windows/c/
+ls /windows/c/

You should now see the Windows 98 partition's directories, to include Windows and Program Files these two directories are key to your new guest installation.

9.11.5. Choosing the Size of Your Disk Image

You are going to prepare two disk images, +the primary hard disk image, and the backup image. The backup image will save you from +disaster when you make a change that makes your first image unusable. This +backup image is not required, but it is highly recommended. The primary disk image will +be called c.img +The backup image will be called +c.img.bak . + You must consider several things when +choosing the size of the disk image:

  • The size of your Windows installation.

  • The amount of free space you have available in your home +directory. If you do not have enough free space in your home directory, find +another partition to put this image on, and ensure that you have the proper +permissions for this file (type man +chmod).

  • Whether or not you choose to have a concurrent backup image in your home +directory (c.img.bak). If you do this, you will need +twice as much space.

It is important to keep your guest OS image independent of your office files so that you can easily restore your setup to a previous state without changing your office files, in case something did not go right. I cannot stress enough the importance of doing this.

9.11.6. Setting Up the Disk Image

Once you have decided on the size of your hard disk image, follow +the instructions in +Section 8.1 using the mtools method. Start by making a +directory called ~/win98 .

[david@domain]$ mkdir ~/win98
+[david@domain]$ cd ~/win98
+[david@domain]$ bximage
+========================================================================
+                                bximage
+                  Disk Image Creation Tool for Bochs
+========================================================================
+
+Do you want to create a floppy disk image or a hard disk image?
+Please type hd or fd. [hd] hd
+
+What kind of image should I create?
+Please type flat, sparse or growing. [flat] 
+
+Enter the hard disk size in megabytes, between 1 and 32255
+[10] 1
+
+I will create a hard disk image with
+  cyl=2
+  heads=16
+  sectors per track=63
+  total sectors=2016
+  total size=0.98 megabytes
+
+What should I name the image?
+[c.img]
+
+Writing: [] Done.
+
+I wrote 1032192 bytes to c.img.
+
+The following line should appear in your bochsrc:
+  ata0-master: type=disk, path="c.img", cylinders=2, heads=16, spt=63
+[david@domain]$  

If you are creating a 2 gig image, you will want to type +2000 when it asks you for the size, instead of +1, as I did in this example.

9.11.7. Create the .bochsrc Configuration File

Now that you have the disk image information, it is time to create the +~/win98/.bochsrc file. In the following example, you will need to replace all +instances of /home/david/ with your own home directory. +All paths in the ~/win98/.bochsrc file must be absolute.

# .bochsrc FILE FOR WINDOWS 98 AS GUEST OS IN LINUX
+
+# Set aside the RAM for bochs and make sure you have enough RAM left over for your system.
+# Type "cat /proc/meminfo" at the prompt to find out how much RAM you have.
+megs: 64
+
+# Filename of ROM images go here.  Be sure to check your installation for the location
+# of these two files (type: man find).  Paths must be absolute.
+romimage: file=/usr/local/etc/bochs/bios/BIOS-bochs-latest
+vgaromimage: file=/usr/local/etc/bochs/bios/VGABIOS-lgpl-latest
+
+# Floppies are commented out, but you may need them later.
+# floppya: 1_44=/dev/fd0, status=inserted
+# floppyb: 1_44=/home/david/win98/floppyb.img, status=inserted
+
+# Cylinder, head, and spt info taken from bximage program output
+ata0-master: type=disk, path="/home/david/win98/c.img", cylinders=3657, heads=16, spt=63
+
+# Have your Windows 98 CD in the drive, but always boot from hard disk.
+# Comment this line out if you are using a disk image for the CD-ROM
+# (See next comment).
+ata0-slave: type=cdrom, path=/dev/cdrom, status=inserted
+
+# You can optionally run the following command:
+# dd if=/dev/cdrom of=/home/david/win98/win98.iso
+# and uncomment the next line
+# ata0-slave: type=cdrom, path=/home/david/win98/win98.iso, status=inserted
+
+# choose the boot disk.
+boot: disk
+
+# where do we send log messages?
+log: bochsout.txt
+
+# enable mouse
+mouse: enabled=1
+
+# enable SB16
+sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, loglevel=2, log=sb16.log, dmatimer=600000

9.11.8. Make Hard Disk Image Acessible by Mtools

Now that you have your disk image, you want to make it accessible by mtools. +Add the following line to the ~/.mtoolsrc file:

drive c: file="/home/david/win98/c.img" partition=1

Replace /home/david with your home directory.

Save and close .mtoolsrc. Next, execute the following commands to +create a partition table for the drive image:

mpartition -I -s spt -t cyl -h heads c:
+mpartition -cpv -s spt -t cyl -h heads c:

For example, for my 2 gig virtual drive, I used:

mpartition -I -s 63 -t 3657 -h 16 c:
+mpartition -cpv -s 63 -t 3657 -h 16 c:

9.11.9. Format Partition and Copy Files

Next, format the partition you just created using the mformat command:

mformat c:

You may want to set your My Documents directory aside:

mkdir ~/mydocsbak
+cd ~/mydocsbak
+tar cfvz mydocs.tar.gz '/windows/d/My Documents'
+mv '/windows/d/My Documents' .

Now you are ready to copy the files!

cd ~/win98
+mcopy -s /windows/d/* c:
+mmd "c:/My Documents"

Put your My Documents folder back where it belongs:

cd /windows/d
+mv '/home/david/mydocsbak/My Documents' .

Make a backup copy of your c.img:

cd ~/win98
+cp c.img c.img.bak

9.11.10. The Fun Begins

Now it is time to fire up Bochs. Windows will initially freak out when it notices its environment has changed completely (and wouldn't you?). You may have to reboot your guest OS a few times as Windows deactivates certain devices and drivers and installs others. Since installations vary, there are no step-by-step instructions for this process. Just remember that you can always restore with your backup image if things go wrong:

cd ~/win98
+cp -f c.img.bak c.img

Make sure you get the order right. When you boot Bochs again, you will see everything as it was when you last did a cp c.img c.img.bak. If you have a large disk image, such as two Gigs, it might take a few minutes for the file to copy.

9.11.11. Windows 98 Method 2: Classic Install (Linux Host)

In this method, Windows 98 is installed using the CD-ROM, much the same way one +would install Windows 98 into a real computer with no operating system. This +process could take up to 12 hours, so I recommended that you begin at the end of +your day. You could check on it once or twice when you get up for the midnight +snack, and continue in the morning.

Here's a summary for the impatient:

  • Copy the cdimage to harddisk to increase speed.

  • Create a disk image with bximage.

  • Update your .bochsrc configuration file for the +diskimage and the cdimage. Make sure that to disable the +IPS parameter for full speed, unless you really need +it to slow down the boot prompts.

  • Boot from CD, then use fdisk to partition the image +and format c: /s to format it.

  • Start the installation with setup from the commandline. +Enter information as necessary.

  • You can either use the keyboard only to give information, or enable and +disable the mouse with the middle button or F12.

  • When there are CPU panics, choose alwayscont to ignore +them. Amazingly, the install will work in spite of them.

9.11.12. Saving Your Windows 98 CD as a Disk +Image

Since this second method involves installing from the Windows 98 +CD-ROM, you will speed things up considerably if you put an image of this +disc on you hard drive. These days, some computers are shipped with "Recovery +Disks" that have the Original Equipment Manufacturer (OEM) label on the MS +Windows 98 disk. In these cases, it is not always easy to tell which CD-ROM +contains the operating system. These types of disks may or may not work for +this purpose; more than likely it will be problematic. Make sure you have a +disk that is labeled "Windows 98" with the Microsoft logo. You will find the +product key on the "Certificate of Authenticity" provided to you by Microsoft. +This can be either on the aqua/purle/white book titled Microsoft +Windows 98: Getting Started, or on your PC. You may also find it in +the CD-ROM packaging. The product key is in squarish typeset next to a bar code.

Under Linux, insert your Windows 98 CD in your CD-ROM drive. Make a directory called win98 under your home directory. Copy the image using the dd command:

[david@host david]$ mkdir ~/win98
+[david@host david]$ dd if=/dev/cdrom of=~/win98/win98.iso

The appropriate line to the configuration file will be added after the hard disk image is made.

9.11.13. Making the Windows 98 Hard Disk Image

Since you can select what components you want with MS Windows and which ones +you do not, you have the option of having a slim installation that requires +less disk space. The actual Windows portion can be as little as 150 megabytes. +If you only plan to run Microsoft Word plus a couple of programs, +one Gigabyte will be more than sufficient.

It is recommended that you put your office and personal files on a separate image. +This allows for easier backup and restoration of your installation as you go along.

Type "df" at the command prompt to see how much disk space you have:

[david@host david]$ df
+Filesystem           1k-blocks      Used Available Use% Mounted on
+/dev/hda6              5580848   3328772   1968580  63% /
+/dev/hda2                21958      5763     15061  28% /boot
+/dev/hda5              4464560   1350568   2887200  32% /home
+none                    192272         0    192272   0% /dev/shm
+/dev/hda1              7054136   3037024   3658772  46% /home2
+/dev/hda3              4142332   1843132   2299200  45% /windows/d
+[david@192 user]$

In this case, /home is mounted on /dev/hda5. There is 2,887,200 bytes, or roughly 2.8 Gigabytes available. There is enough space for the primary 1 Gigabyte image (c.img) and the backup image (c.img.bak). You will now create the image using bximage:

[david@host david]$ bximage
+========================================================================
+                                bximage
+                  Disk Image Creation Tool for Bochs
+========================================================================
+
+Do you want to create a floppy disk image or a hard disk image?
+Please type hd or fd. [hd] hd
+
+What kind of image should I create?
+Please type flat, sparse or growing. [flat] 
+
+Enter the hard disk size in megabytes, between 1 and 32255
+[10] 1000
+
+I will create a hard disk image with
+  cyl=2031
+  heads=16
+  sectors per track=63
+  total sectors=2047248
+  total size=999.63 megabytes
+
+What should I name the image?
+[c.img] c.img
+
+Writing: [] Done.
+
+I wrote 1048190976 bytes to c.img.
+
+The following line should appear in your bochsrc:
+  ata0-master: type=disk, path="c.img", cylinders=2031, heads=16, spt=63

You will need the output of bximage for your ~/win98/.bochsrc file. Be sure to +copy down the line that begins with ata0-master, etc. onto +a piece of paper or onto your desktop clibpoard. See the example provided below +for details on the syntax.

9.11.14. Create the .bochsrc Configuration File

Now that you have the disk image information, it is time to create the +~/win98/.bochsrc file. In the following example, you will need to replace all +instances of /home/david/ with your own home directory. +All paths in the ~/win98/.bochsrc file must be absolute.

# .bochsrc FILE FOR WINDOWS 98 AS GUEST OS IN LINUX
+
+# Set aside the RAM for bochs and make sure you have enough RAM left over for your system.
+# Type "cat /proc/meminfo" at the prompt to find out how much RAM you have.
+megs: 64
+
+# Filename of ROM images go here.  Be sure to check your installation for the location
+# of these two files (type: man find).  Paths must be absolute.
+romimage: file=/usr/local/etc/bochs/bios/BIOS-bochs-latest
+vgaromimage: file=/usr/local/etc/bochs/bios/VGABIOS-lgpl-latest
+
+# Floppies are commented out, but you may need them later.
+# floppya: 1_44=/dev/fd0, status=inserted
+# floppyb: 1_44=/home/david/win98/floppyb.img, status=inserted
+
+# Cylinder, head, and spt info taken from bximage program output
+ata0-master: type=disk, path="/home/david/win98/c.img", cylinders=2031, heads=16, spt=63
+
+# If you ran the following command:
+#      dd if=/dev/cdrom of=/home/david/win98/win98.iso
+#   you can use the CD-ROM image on your hard drive:
+ata0-slave: type=cdrom, path=/home/david/win98/win98.iso, status=inserted
+
+# Optionally, if you have your Windows 98 CD in the drive
+#   you can uncomment the next line, but the installation
+#   process will be slower.
+# ata0-slave: type=cdrom, path=/dev/cdrom, status=inserted
+
+# choose the boot disk.
+boot: cdrom
+
+# where do we send log messages?
+log: bochsout.txt
+
+# enable mouse
+mouse: enabled=1
+
+# enable SB16
+sb16: midimode=1, midi=/dev/midi00, wavemode=1, wave=/dev/dsp, loglevel=2, log=sb16.log, dmatimer=600000

9.11.15. Create the Primary DOS Partition and set it Active

Change into the ~/win98 directory. Fire up Bochs. (If Bochs does not +start, double check your .bochsrc file and make sure there are no mispellings). +Choose "CD-ROM" when Windows prompts you to choose hard disk or CD-ROM. You +can use your arrow keys to select your option, or type the number "2".

Microsoft Windows 98 CD-ROM Startu Menu
+============================================
+
+1.  Boot From Hard Disk
+2.  Boot From CD-ROM
+
+Enter your choice: _

Tip: If you are not given enough time to make this choice, close Bochs, and +add the following line to your .bochsrc:

cpu: ips=1000000

Fire up Bochs again. If you have a 1 Gigahertz processor, an ips setting of 1 million +will keep you on your toes when it comes time to select the CD-ROM. +Just be sure to comment this line out or delete it before you begin the actual +installation, otherwise it will take too long to complete this project.

However, if you can manage to press quickly any key before the time is up, +you don't need to do use this trick.

After you select the CD-ROM as your boot method, you will now see a menu with three choices:


Microsoft Windows 98 CD-ROM Startu Menu
+============================================
+
+1.  Start Windows 98 setup from CD-ROM.
+2.  Start computer with CD-ROM support.
+3.  Start computer without CD-ROM support.
+
+Enter a choice: _

Type "2" and press "Enter" to Start computer with CD-ROM support. This will take you to a DOS prompt. At the DOS prompt, type fdisk and press "Enter".

A:\>fdisk

You will now be taken to a screen asking you if you would like to enable large disk support. Type "Y" and press "Enter". You will now see the following menu:

                            Microsoft Windows 98
+                          Fixed Disk Setup Program
+
+                                 FDISK Options
+
+Current fixed disk drive: 1
+
+Choose one of the following:
+
+1. Create DOS partition or Logical DOS Drive
+2. Set active partition
+3. Delete partition or Logical DOS Drive
+4. Display partition information
+
+
+Enter choice: [1]
+
+
+
+
+Press Esc to exit FDISK

Type "1" and press "Enter" to select Create DOS partition or Logical DOS Drive. You will be taken to another menu:

                 Create DOS Partition or Logical DOS Drive
+
+Current fixed disk drive: 1
+
+Choose one of the following:
+
+1.  Create Primary DOS Partition
+2.  Create Extended DOS Partition
+3.  Create Logical DOS Drive(s) in the Extended DOS Partition
+
+
+Enter choice: [1]
+
+
+
+
+Press Esc to return to FDISK Options

Type "1" and press enter to select Create Primary DOS Partition. You will then be asked the following:

Do you wish to use the maximum available size for a Primary DOS partition
+and make the partition active (Y/N).................? [Y]

Type "Y" and press "Enter". You should then see the following message:

You MUST restart your system for your changes to take effect.
+Any drives you have created or changed must be formatted
+AFTER you restart.
+
+Shut down Windows before restarting.
+
+
+
+
+Pres Esc to exit FDISK_

Type "Esc" to exit FDISK. You should be back at the DOS prompt. Click +on the Bochs "Power" button.

9.11.16. Formatting the Disk Image

We now need to format the virtual "C" drive for your guest OS.

Fire up Bochs from the ~/win98 directory. Type "2" and press "Enter" to +select booting from the Windows 98 CD-ROM. Then Type "2" and press "Enter" to select +booting with CD-ROM support. You should be at the DOS prompt once again. Select the "D" drive, change to the "WIN98" directory, and type "format c:". You will then be asked the following:

A:/>D:
+
+D:/>cd WIN98
+
+D:/WIN98>format c: /s
+
+WARNING, ALL DATA ON NON-REMOVABLE DISK
+DRIVE C: WILL BE LOST!
+Proceed with Format (Y/N)?_

Type "Y" and press "Enter" to format. The process should take no more +than a minute on a modern computer. You will then be asked for the disk +label. Hit "Enter". If you are successful, you should see output +similar to the following:

Formatting 999.1M
+Format complete.
+Writing out file allocation table
+Complete.
+Calculating free space (this may take several minutes)...
+Complete.
+
+Volume label (11 characters, ENTER for none)?
+
+1,045,577,728 bytes total disk space
+1,045,577,728 bytes available on disk
+
+        4,096 bytes in each allocation unit.
+      255,267 allocation units available on disk.
+
+Volume Serial Number is 555D-1F23
+
+
+D:\WIN98>

It is now time to comment out the "cpu: ips=1000000" line in your ~/win98/.bochsrc file. +Close Bochs by clicking the Bochs power button with your mouse. Open up ~/win98/.bochsrc +with your favorite editor and put a hash (#) mark in front of the cpu line.

You are now ready to begin the installation.

9.11.17. Starting the Installation

Fire up Bochs from the ~/win98 directory. Type "2" and press "Enter" to +select booting from the Windows 98 CD-ROM. Then Type "2" and press "Enter" to select +booting with CD-ROM support. You should be at the DOS prompt once again. Select the "D" drive, change to the "WIN98" directory, and type "setup":

A:\>D:
+D:\>cd WIN98
+D:\WIN98>setup

Tip: You can also use setup /is to bypass scandisk.

Tip: If Windows 98 setup complains about the (emulated) computer being too slow or about +a missing co-processor (in case you compiled Bochs without support for that), you can +use the undocumented /nm switch to bypass the hardware check: +setup /nm.

Answer the question of the Windows 98 installer. You can either supply +answers with the keyboard including the arrow keys, or activate the +mouse with the middle mouse button or F12.

I choose a minimal installation to save space on the harddisk image, +but others should probably also work.

(Add additional detailed step-by-step information here if really +necessary)

At some stage during the installation, the simulation will stop with +an audible beep and notify you about a CPU panic. Don't worry, choose +alwayscont to ignore all such future panics (there +will be several others). Windows will install properly in spite of those +errors.

If you want, you can create checkpoints of your harddisk image at +apropriate times (before a reboot, for example). Stop the simulation +by clicking on the Tool icon, copy the image file, +and continue by pressing return in the bochs terminal window. +Optionally, gzip the copied disk image to conserve +some space.

Add more details, if needed.


PrevHomeNext
Windows NT 4.0UpWindows ME
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-winme.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-winme.html new file mode 100644 index 0000000..02cf9bb --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-winme.html @@ -0,0 +1,407 @@ + +Windows ME
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.12. Windows ME

9.12.1. Installing Windows ME

You must read the message regarding software licenses in +Section 1.6 before you install Windows ME as a guest operating system in Bochs.

This has been contributed by Sancho Roberto :

Date: Sun, 21 Oct 2001 02:24:22 -0700 (PDT)
+From: Sancho Roberto (rsanchov at yahoo dot com)
+To: bochs-developers@lists.sourceforge.net
+Subject: [Bochs-developers] WinMe install tips
+Parts/Attachments:
+
+1) Install Win98 
+
+   My Windows Me is an update version, that is, it upgrades over Win98.
+   So the first think I have to do is to install on a HD image a
+   Win98
+
+   It is not necessary to do the full install. What I've done is
+     - Create a HD image (Win98.img) with 500MB
+     - Format It, install MSDOS6 on it so I can boot from c
+     - Make a W98 directory.
+     - Copy using mtools the instalation directory from the original
+       Win98 CD
+     - Run bochs
+     - run the setup program into the W98 directory
+     - Select WIN98 as Windows directory. All other setup options
+       are left by default.
+     - I don't care about HW detection, etc. Just uncompressing
+       the cab files to the WIN98 directory es enought for WinMe.
+       (Note that Win98 is not functional and cannot boot)
+       
+2) Copy the WinMe install files to the HD
+
+   In Win98.img, with mtools, I create a directory called WinMe.
+   Again, I copy the contents of the Win9x directory from the original
+   WinMe CD. Note that I copy the CD to my HD, and then with mtools
+   from my HD to win98.img. I also delete then W98 directory.
+
+3) Create WinMe.img   
+
+   Now, I created another blank HD called WinMe.img with 500MB.
+   I format it and install MSDOS6 so I an boot using it.
+
+4) Prepare the instalation Bochs
+
+   I edit the bochsrc.txt file so
+   - WinMe.img is ata0-master
+   - Win98.img is ata0-slave
+
+5) Running setup
+
+   I start bochs: the C: drive is empty (it only contains the
+   MSDOS6 command.com, IO.SYS, etc). The D: drive has: 
+      D:\W98 - The "installed" Windows 98
+      D:\WINME - Windows Me setup files
+
+   I go to the WINME directory and run:
+
+      SETUP xxxx 
+
+   The description of the setup options can be found in the Microsoft Knowledge page as
+   Q186111 - Description of the Windows 95, Windows 98, and Windows Me Setup Switches
+
+   I've done a lot of trials with this setup options until I finally
+   found a correct way to finnish the installation. These are the setup
+   options I used. I've copied a brief description (from the KB) and added
+   my comments.
+
+   /m - bypass the playing of the Setup sound (.wav) files.
+        Not necessary as my Bochs has no sound device activated 
+
+   /nf - Do not prompt to remove the floppy disk from the drive
+         Maybe not necessary. Just in case
+
+   /nh - This switch bypasses running the Hwinfo.exe program at 0 
+         percent files and RunOnce.
+
+         If not present, freezes on HW detection
+
+   /ie - This switch bypasses the Windows 98 Startup Disk wizard screens. 
+         To speed things up - I allways can create a Statup disk latter
+
+   /iv - This switch bypasses displaying the Setup screens during 
+         an upgrade within Windows.
+         To speed things up 
+
+   /c - This switch bypasses running SMARTDrive.
+        Maybe not necessary. Just in case
+
+   /im - Causes setup to ignore the conventional memory check.
+         Maybe not necessary. Just in case
+
+   /is - This switch causes Setup not to run ScanDisk.
+         Very important as SCANDISK freezed bochs
+
+   /iq - If you use the /is switch to bypass ScanDisk or if ScanDisk 
+         does not complete successfully, Setup checks your drive for cross-linked files. 
+         The /iq switch prevents Setup from doing this.
+
+         Very important. If not used, Setup stop the installation 
+         with a message "error found in C:, run scandisk and setup again"
+         (or something like this). Of course, there is no errors in C:
+         because is an empty, just formatted disk, but the WinMe setup
+         thinks so. The only way to progress from this point is
+         with this switch
+
+   /it - This switch bypasses checking for the presence of "dirty" or "deadly" 
+         terminate-and-stay-resident programs (TSRs) that are known to 
+         cause problems with Windows Setup.
+         Maybe not necessary. Just in case
+
+   /p b;g=3
+
+      b: This switch enables Prompt Before mode. It prompts 
+         you before a detection module is called so that you can 
+         step through each detection module manually and decide 
+         if you want to skip it. 
+
+         Very important. See bellow
+
+      g: This switch controls how verbose the built-in progress bar is
+
+
+   There is another main issue that must be handled
+
+   WinMe requires a 150MHz computer as a minimum. If you try to run
+   the WinMe setup, you will receive a message telling you so, and the
+   installation will stop.
+
+   The only way I found to solve this problem is to change the IPS
+   value in bochsrc.txt. I raised the IPS value until setup stop
+   complaining. In my machine (P3 @ 450MHz), I achieved this with
+
+      cpu: ips=500000000
+
+   This this IPS value, the keyboard and mouse are updated each
+   100 seconds. This makes very difficult to type the CD-KEY numbers,
+   select type of instalation, etc.
+
+   One way to solve this is to lower the vga_update_interval and
+   the keyboard_serial_delay. I lower the value until 
+      - I have a minimum response from keyboard and mouse (say 
+        1 second delay between keypress/mousemove and the
+        screen update)
+      - I still pass the 150 MHz check 
+   
+   The values I used are    
+   
+      vga_update_interval: 10000
+      keyboard_serial_delay: 200
+
+   They may be diferent for other computers.
+   Note that bochs, on starting up complains about vga_update_interval
+   with the message "bochsrc.txt: vga_update_interval not big enough!":
+   ignore it.
+
+6) Follow the Windows Me setup instruction ...
+
+   Just a warning: it is very, very, very, *VERY* (very) slow ...
+   Two days running non stop on my PC.
+   Don't wait ... enjoy yourself during the process ... you that the time.
+
+7) Hardware nightmare
+
+   At a given moment, you are prompted to detect the hardware.
+   There is a prompt for each type of device: Bus, keyboard, mouse, 
+   HD, CDROM, etc. 
+
+   Say NO to everything.
+
+   If you say YES, sometimes setup will detect your HW, but normaly
+   it will crash with GPF on COMMCTRL.DLL (setup crash, but bochs 
+   still alive. Nice!).
+
+   If you sat CANCEL, setup will stay in this screen forever (ok, ok,
+   I have just wait 10 hours).
+
+8) Configuring 
+
+   Setup will configure you PC. You can set your timezone, etc.
+
+   Then Setup will create the Statup menu icons. Here, time to time,
+   you will get a GPF in PIFMGR.DLL. Just press Ok and continue.
+
+   Again this procedure is very very very very very very slow.
+   Worse of all, you cannot leave it running by night. You must
+   press Ok a lot of times to clean the GPF.
+
+9) Restart.
+
+   At last, setup will restart the PC. Exit Bochs. I recomend to make
+   a copy of WinMe.img just to save all your time.
+
+10) Run bochs again
+
+   Setup will do some stuff ... just wait
+
+   After a while, the Start button appearch on the lower left corner
+   of the screen!
+
+   Just for safe, I executed within WinMe msconfig.exe, and in the
+   advanced tab set the Disk Compatibility mode". Also, I've turned 
+   of the menu and windows animations, to speed thinks up a bit. Also
+   it may be a good idea to turn off scandisk on setup.
+
+   Do not forget to exit from Windows with the Shutdown menu ...
+
+11) That's all
+
+   Now you can comment out the ata0-slave line in the bochsrc.txt. WinMe.img
+   contains a working WinMe.
+
+   NOTE: if you lower the IPS, WinMe will be unstable ... surelly 
+         a timing issue. But even if IPS is high, lowering 
+         vga_update_interval and keyboard_serial_delay will help
+         on getting an acceptable usability.
+
+         DO not forget to use your Pentium 10 at 500 GHz to get a
+         good speed within Windows.
+
+Some bugs i've found
+
+- MSDOS Scandisk freeze
+- Hw detection is very problematic
+- If bochs is visible when it switchs from text mode to graphic mode,
+  the size of the window is correct. But if Bochs is minimized when
+  doing so, the size of the Bochs window is incorrect. It does not
+  take into account the height of the top banner (the one with the 
+  disk icons, mouse, snapshot, etc), so the botton of the screen 
+  is clipped.
+- Dont expect to run WinMe at full speed unless you use your Pentium10 at 1500 GHz
+- (not a bug, but a comment) The splash screen when booting/shutdown 
+  WinMe is double height. I personally prefer to see the full image
+  as it was time ago.
+ +


PrevHomeNext
Windows 98UpWindows 2000
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-winnt4.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-winnt4.html new file mode 100644 index 0000000..59e2b6b --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-winnt4.html @@ -0,0 +1,186 @@ + +Windows NT 4.0
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.10. Windows NT 4.0

You must read the message regarding software licenses in +Section 1.6 before you install Windows NT 4.0 as a guest operating system in Bochs.

Here are the known issues about installing and running Windows NT4.0 :

  • If you want to use the LGPL'd VGABIOS to install Windows NT 4.0 you'll need +version 0.4c or higher. With older versions you'll get a black screen after +first reboot.

  • to log in you must press ctrl-alt-del, and it is likely that the window manager +will trap this key combination. You can either use the trick described in +Section 8.15 or define a user short-cut +(callable through the user short-cut gui button) +in you configuration file, for example: +
    user_shortcut: keys=ctrl-alt-del


PrevHomeNext
Windows 95UpWindows 98
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-winxp.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-winxp.html new file mode 100644 index 0000000..754a08e --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guest-winxp.html @@ -0,0 +1,154 @@ + +Windows XP
Bochs User Manual
PrevChapter 9. Guest operating systemsNext

9.15. Windows XP

You must read the message regarding software licenses in +Section 1.6 before you install Windows XP as a guest operating system in Bochs.

Windows XP has been reported to install from the cd, and run inside Bochs. + The only known issue is to set the IPS to, at least, a value of 10000000. +


PrevHomeNext
Windows 2000 ServerUpSCO OpenServer 5.0.5
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guests.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guests.html new file mode 100644 index 0000000..b708cf1 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/guests.html @@ -0,0 +1,164 @@ + +Guest operating systems
Bochs User Manual
PrevNext

Chapter 9. Guest operating systems

What disk images are available.
+Installing from scratch.
+What works
+Known problems


PrevHomeNext
Using the bxcommit tool Knoppix
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/harddisk-modes.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/harddisk-modes.html new file mode 100644 index 0000000..e7866a4 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/harddisk-modes.html @@ -0,0 +1,1311 @@ + +Disk Image Modes
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.18. Disk Image Modes

Bochs can handle independent disk image format for each +disk present on the ata interfaces. + +The disk image type is selected in the configuration file +by the "mode" option of the ataX-xxx directives. +Example: + +
ata0-master: type=disk, mode=flat, path=10M.sample, cylinders=306, heads=4, spt=17

Note: If unspecified, the default "mode" is flat.

Table 8-3. Supported Disk Modes

NameDescriptionFeatures
flat one file, flat layout + accessible with mtools or winimage-like tools +
concat multiple files, concatenated + mappable to contained partitions +
external accessed through an external C++ class + developer specific, needs a C++ class at compile time +
dll accessed through a DLL + developer specific, windows only +
sparse up to 10 layers stackable files + commitable, rollbackable, growing +
vmware3 vmware3 disk support + vmware version 3 compatibility +
vmware4 vmware4 disk support + vmware version 4 compatibility +
undoable flat file with a commitable redolog + commitable, rollbackable +
growing one growing file growing +
volatile flat file with a volatile redolog + always rollbacked +

8.18.1. flat

8.18.1.1. description

In flat mode, all sectors of the harddisk are stored in one flat file, +in lba order.

8.18.1.2. image creation

Flat disk images can be created with the bximage utility +(see Section 8.19 for more information).

8.18.1.3. path

The "path" option of the ataX-xxx directive in the configuration file +must point to the flat image file.

8.18.1.4. external tools

Flat images content can be accessed from the host by the +following tools : +

8.18.1.5. typical use

Flat mode is Bochs default harddisk layout. This is also +the layout of disk images provided on Bochs websites.

8.18.1.6. limitations

On some host OSes, Bochs flat disk images are limited to 2GiB.

8.18.2. concat

8.18.2.1. description

In concat mode, all sectors of the harddisk are stored in several flat files, +in lba order.

8.18.2.2. image creation

Disk images for the usage in 'concat' mode can be created with the bximage +utility (see Section 8.19 for more information).

8.18.2.3. path

The "path" option of the ataX-xxx directive in the configuration file +must point to the first file (e.g. win95-1). The lower layer files names are +found by adding 1 to the last character (e.g. win95-2, win95-3, etc.).

8.18.2.4. external tools

If every single file contains a complete partition, they can be accessed +with same tools as the 'flat' mode images.

8.18.2.5. typical use

If the partition sizes and file sizes are set up correctly, this allows you to +store each partition in a separate file, which is very convenient if you want +to operate on a single partition (e.g. mount with loopback, create filesystem, +fsck, etc.).

8.18.2.6. limitations

On some host OSes, there is a limit of 2GiB per file.

8.18.3. external/dll

8.18.3.1. description

This mode is only useful for developers and needs an additional C++ class +compiled in, or an additional DLL linked to Bochs.

8.18.4. sparse

8.18.4.1. description

Sparse disk support has been added by JustinSB. Sparse disk features are: +

  • Large hard drive can be created, and only used space will be stored + in the file. In practice, on Unix, this is not a large gain as it is + done anyway. +

  • Multiple sparse drive images can be mounted on top of each other. + Writes go to the top image. This allows several similar configurations + to share a master "base" file, and also allows filesystem rollback or + no-write options. Up to 10 disk images can be layered on top of each other. +

8.18.4.2. image creation

Sparse disk images must be created with the bximage utility +(see Section 8.19 for more information). +Be sure to enter "sparse" when selecting the image type.

8.18.4.3. path

The "path" option of the ataX-xxx directive in the configuration file +must point to the top layered file. The lower layer files names are found by +substracting 1 from the last character (must be a digit)

8.18.4.4. external tools

No external tool support Sparse disk images yet.

8.18.4.5. typical use

8.18.4.5.1. Space Saving

Create a sparse disk image using bximage. Set size to eg 10GB. + Only allocated space will be stored, + so your drive image should be only about as large as the files stored on it. +

8.18.4.5.2. Disk Rollback

  • Create a sparse disk image called "c.img.0". Point .bochsrc at "c.img.0". + In bochs, install your favourite OS. Switch off bochs. +

  • Create a sparse disk image (of the same size) + and name it "c.img.1". Point .bochsrc at "c.img.1" + "c.img.0" is visible, but all writes go to "c.img.1". + After using bochs, you can simply delete + "c.img.1" to undo changes and go back to a clean OS install. +

+

8.18.4.5.3. Disk Optional Commit

  • Create a sparse disk image called "c.img.0". Point .bochsrc at "c.img.0". + In bochs, install your favourite OS. Switch off bochs. +

  • Create a sparse disk image (of the same size) and name it "c.img.1". + Point .bochsrc at "c.img.1" + "c.img.0" is visible, but all writes go to "c.img.1". + After using bochs, if you want to keep the + changes, use the (currently non-existant) merge utility + to make a single unified drive image. +

  • Alternatively simply create a new partition on top called "c.img.2". +

+

8.18.4.5.4. Common Base

  • Create a sparse disk image called "base.img". Point .bochsrc at "base.img". + In bochs, install your favourite OS. Switch off bochs. +

  • Create a sparse disk image (of the same size) and name it "www.img.1". + Make "wwww.img.0" a symlink to + "base.img". Point .bochsrc at "www.img.1". Using bochs, install a webserver. +

  • Create a symlink to "base.img" called "db.img.0". + Create a sparse disk image (of the same size) + and name it "db.img.1". Point .bochsrc at "db.img.1". + Using bochs, install a database server. +

Now both a database server and webserver can be + run in separate virtual machines, but they share the common OS image, + saving drive space. +

8.18.4.6. limitations

There is a need for supporting utilities (yet unwritten) : +

  • to merge two sparse disk images into a single image

  • to defragment a sparse disk image and remove unused space

8.18.5. vmware3/vmware4

8.18.5.1. description

Sharvil Nanavati has added vmware3/4 disk image support into Bochs +for Net Integration Technologies, Inc. +You should be able to use disk images created by vmware version 3 and 4.

8.18.5.2. image creation

Create such disk image with vmware version 3 or 4.

8.18.5.3. path

The "path" option of the ataX-xxx directive in the configuration file +must point to the vmware3/4 disk image.

8.18.5.4. external tools

give a look at vmware3/4 tools : disk image creation, etc.

8.18.5.5. typical use

If you want to use an existing vmware3/4 disk image.

8.18.5.6. limitations

Only vmware versions 3 and 4 disk image files are supported.

8.18.6. undoable

8.18.6.1. description

Undoable disks are commitable/rollbackable disk images. + An undoable disk is based on a read-only flat image + (see Section 8.18.1), associated with + a growing redolog, that contains all changes (writes) + made to the flat image content.

This redolog is dynamically created at runtime, if it does not + previously exists.

All writes go to the redolog, reads are done from the + redolog if previously written, or from the flat file + otherwise.

If unspecified with the "journal" option of the ataX-xxx directive, + the redolog file name is created by adding a ".redolog" + suffix to the flat image name.

File size of the redolog can grow up to the total disk + size plus a small overhead due to internal data managment + (about 3% for a 32MiB disk, + less than 0.5% for a 2GiB disk).

After a run, the redolog will still be present, so the changes + are still visible the next time you run Bochs with this disk image.

After a run, the redolog can be committed (merged) + to the flat image with the bxcommit utility.

After a run, the redolog can be rollbacked (discarded) + by simply deleting the redolog file.

Note: In this mode, the flat file is always open in read-only mode, + so it can safely be stored on a read-only medium (for example on a cdrom).

8.18.6.2. image creation

The flat disk images must be created with the bximage utility +(see Section 8.19 for more information). + The growing redolog is created automatically if needed.

8.18.6.3. path

The "path" option of the ataX-xxx directive in the configuration file + must be the flat image name. The redolog name can be set with the "journal" + option of the same directive. + If not set, the redolog name is created by adding the + ".redolog" suffix to the flat image name.

8.18.6.4. external tools

See Section 8.18.1.4 for tools + to access the flat disk image content.

Note: The up-to-date content can only be seen after you commit the redolog + to the flat file with the bxcommit utility.

8.18.6.6. limitations

to be completed

8.18.7. growing

8.18.7.1. description

Growing disk images start as a small files, and + grow whenever new data is written to them. +

Once a sector is + written in the growing file, subsequent writes to the same + sector will happen in place. +

File size of Growing disk images can go up to the total disk + size plus a small overhead due to internal data managment. + (about 3% for a 32MiB disk, + less than 0.5% for a 2GiB disk). +

8.18.7.2. image creation

Growing disk images must be created with the bximage utility +(see Section 8.19 for more information). +Be sure to enter "growing" when selecting the image type.

8.18.7.3. path

The "path" option of the ataX-xxx directive in the configuration file + must be the growing image name.

8.18.7.4. external tools

No external tool support Growing disk images yet.

8.18.7.5. typical use

Growing disk images can be used whenever you want to maximize disk space. +However, please note that Bochs will not check if enough disk space is available +before writing new data. If no disk space is available, a panic will occur.

8.18.7.6. limitations

to be completed

8.18.8. volatile

8.18.8.1. description

Volatile disks are always-rollbacked disk images. + An volatile disk is based on a read-only flat image + (see Section 8.18.1), associated with + a growing temporary redolog, that contains all changes (writes) + made to the flat image content. All data written to + the disk image are lost at the end of the Bochs + session.

The redolog is dynamically created at runtime, when + Bochs starts, and is deleted when Bochs closes (win32) + or just after it has been created (Unix).

All writes go to the redolog, reads are done from the + redolog if previously written, or from the flat file + otherwise.

If unspecified with the "journal" option of the ataX-xxx directive, + the redolog file name is created by adding a ".redolog" + suffix to the flat image name.

File size of the redolog can grow up to the total disk + size plus a small overhead due to internal data managment + (about 3% for a 32MiB disk, + less than 0.5% for a 2GiB disk).

After a run, the redolog is not any more present, so the changes + are discarded.

Note: In this mode, the flat file is always open in read-only mode, + so it can safely be stored on a read-only medium (for example on a cdrom).

8.18.8.2. image creation

The flat disk images must be created with the bximage utility +(see Section 8.19 for more information). + The growing redolog is created automatically.

8.18.8.3. path

The "path" option of the ataX-xxx directive in the configuration file + must be the flat image name. The redolog name can be set with the "journal" + option of the same directive. + If not set, the redolog name is created by adding the + ".redolog" suffix to the flat image name. + A random suffix is also appended to the redolog name.

8.18.8.4. external tools

See Section 8.18.1.4 for tools + to access the flat disk image content.

8.18.8.6. limitations

to be completed


PrevHomeNext
Notes about Cirrus SVGA usageUpUsing the bximage tool
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/howto.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/howto.html new file mode 100644 index 0000000..092f95d --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/howto.html @@ -0,0 +1,593 @@ + +Tips and Techniques
Bochs User Manual
PrevNext

Chapter 8. Tips and Techniques

8.1. How to make a simple disk image

This was contributed by Greg Alexander in October 2001.

What you need: + +

  • An executable version of Bochs. See Downloading Bochs and Compiling Bochs.

  • The bximage program, included with Bochs.

  • A FreeDOS boot disk, or a boot disk from another OS capable of +producing DOS partitions (e.g. a Linux install disk).

  • (Optional) mtools, a program for manipulating DOS disks/images.

8.1.1. Create a flat image

Option 1: Using the Unix dd utility:

You will need to know the geometry of the disk you want to +create. You have to compute the disk sector count: + +
Sectors = Cylinders * Heads * SectorsPerTrack

Use the dd command to create your file: + +
dd if=/dev/zero of=teaching.img bs=512 count=sectors
+(replace "sectors" with the number you computed at the +previous step).

When you'll update your configuration file, please +fill in the same cylinders, heads and sector per +track values.

Option 2: Run bximage to create a disk image file. +You will be greeted with the following prompt: + +
========================================================================
+                                bximage
+                  Disk Image Creation Tool for Bochs
+========================================================================
+
+Do you want to create a floppy disk image or a hard disk image?
+Please type hd or fd. [hd] 

Since we are creating a hard disk image, accept the default of hd by +pressing Enter or typing 'hd' and pressing +Enter. Next, bximage will ask for the type of +hd to create: + +
What kind of image should I create?
+Please type flat, sparse or growing. [flat] 

We want to create a simple flat image, so accept the default +by pressing Enter. Then, bximage will ask +for the size of the disk image you want to create, in Megabytes: + +
Enter the hard disk size in megabytes, between 1 and 32255
+[10] 

Enter the size of the hard disk you want to create, and press +Enter. +Bochs will give you some information about the image it is creating, and +ask you for a filename to use for the file it is creating. I told it to +use the default of 10 megabytes, and was given the following information +along with the prompt for a filename: + +
[10] 10
+
+I will create a hard disk image with
+  cyl=20
+  heads=16
+  sectors per track=63
+  total sectors=20160
+  total size=9.84 megabytes
+
+What should I name the image?
+[c.img] 

At this point, type in the filename you want to use for the image. The +default of "c.img" is appropriate if this will be your only hard disk +image. After you have typed in the name of the filename you want to +use, press Enter. Bximage will tell you it is writing the disk and +will display a status bar as you wait. When it is finished, it will +give you a final status report and tell you a line that should be added +to your bochsrc when you want to use this disk image. I named my +10 Megabyte image "teaching.img" and the output of bximage looked like +this: + +
[c.img] teaching.img
+
+Writing: [..........] Done.
+
+I wrote 10321920 bytes to teaching.img.

The following line should appear in your bochsrc: +
  ata0-master: type=disk, path="teaching.img", mode=flat, cylinders=20, heads=16, spt=63

At this point, a file called "teaching.img" was created in my current +directory and is ready to be used as an image file for a Bochs session.

Tip: You may want to name your image teaching_20-16-63.img +so that you always know the values to use for CHS.

8.1.2. Partition and format your image file

Option 1: Using FreeDOS (Advantage: Creates a MBR on the partition.)

First, you need to edit the bochsrc file that Bochs uses for +configuration information (see Section 5.2). Open bochsrc +with a text editor. Remove all lines in the file which start with "ata0-master:". Add the "ata0-master:" +line that was displayed when you ran bximage to bochsrc at the +same place where you removed the old "ata0-master:" lines from.

Also, you need to download or create a FreeDOS (or DOS, or Windows, or +Linux) disk image. Modify the "floppya:" line in your bochsrc to point +at the downloaded FreeDOS floppy image and change its status to "status=inserted".

Save and close your bochsrc. Now run Bochs (see Chapter 5).

Use the standard FreeDOS commands fdisk and +format to format your hard +drive image. You must make the image bootable to be able to boot +without a floppy disk. However, creating a bootable disk image is best +done with a boot disk from the OS you intend to install on the image.

Option 2: Using mtools (Disadvantage: Cannot create bootable images +without a MBR image.)

Use a text editor to add the following line to the file ~/.mtoolsrc:

drive c: file="path/filename.img" partition=1

Save and close .mtoolsrc. Next, execute the following commands to +create a partition table for the drive image:

mpartition -I -s spt -t cyl -h heads c:
+mpartition -cpv -s spt -t cyl -h heads c:

For example, for my 10 meg drive, I used: +
mpartition -I -s 63 -t 20 -h 16 c:
+mpartition -cpv -s 63 -t 20 -h 16 c:

Next, format the partition you just created using the mformat command: + +
mformat c:

And you now have a formatted disk image containing a single DOS +partition.

Note: The mpartition command doesn't handle images larger than 1024 cylinders properly. +The partition size reported by fdisk is okay, but mformat reports only 504 MB +(tested with mtools 3.9.9).


PrevHomeNext
Mailing List Etiquette Use mtools to manipulate disk images
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/index.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/index.html new file mode 100644 index 0000000..97c6d4f --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/index.html @@ -0,0 +1,1465 @@ + +Bochs User Manual

Bochs User Manual

Kevin Lawton

Bryce Denney

N. David Guarneri

Volker Ruppert

Christophe Bothamy

Edited by

Michael Calabrese

Stanislav Shwartsman


Table of Contents
1. Introduction to Bochs
1.1. What is Bochs?
1.2. Who uses Bochs?
1.3. Is Bochs right for me?
1.4. Will it work for me?
1.5. Bochs License
1.6. Third Party Software Licensing and Temporary Files
1.7. Features
1.8. Supported Platforms
1.9. FAQ
2. Release Notes
3. Installation
3.1. Downloading Bochs
3.2. Tracking the source code with CVS
3.2.1. Checking out Bochs
3.2.2. Getting the Latest Version
3.2.3. Getting a Release Version
3.2.4. More about CVS
3.3. Installing a Binary
3.3.1. Windows
3.3.2. Linux RPM
3.3.3. MacOS X DMG
3.4. Compiling Bochs
3.4.1. Standard Compile
3.4.2. Configure Options
3.4.3. Transcript of Successful Compilation
3.4.4. Compiling on Win32 with Microsoft VC++
3.4.5. Compiling on Win32 with Cygwin
3.4.6. Compiling on MacOS 9 with CodeWarrior
3.4.7. Compiling on MacOS X
3.4.8. Compiling on BeOS
3.4.9. Compiling on Amiga/MorphOS
3.4.10. Compiling with the RFB interface
3.4.11. Compiling with the SDL interface
3.4.12. Compiling with the wxWidgets interface
3.4.13. Building an RPM on Linux
3.4.14. Compile Problems
4. Setup
4.1. What does Bochs need?
4.2. bochsrc
4.2.1. megs
4.2.2. cpu
4.2.3. romimage
4.2.4. optromimage1, optromimage2, optromimage3 or optromimage4
4.2.5. vgaromimage
4.2.6. vga
4.2.7. floppya/floppyb
4.2.8. ata0, ata1, ata2, ata3
4.2.9. ata0-master, ata0-slave, ata1-*, ata2-*, ata3-*
4.2.10. boot
4.2.11. floppy_bootsig_check
4.2.12. config_interface
4.2.13. display_library
4.2.14. log
4.2.15. logprefix
4.2.16. debug/info/error/panic
4.2.17. debugger_log
4.2.18. com[1-4]
4.2.19. parport[1-2]
4.2.20. sb16
4.2.21. vga_update_interval
4.2.22. keyboard_serial_delay
4.2.23. keyboard_paste_delay
4.2.24. ips
4.2.25. clock
4.2.26. mouse
4.2.27. private_colormap
4.2.28. i440fxsupport
4.2.29. pcidev
4.2.30. usb1
4.2.31. gdbstub
4.2.32. ne2k
4.2.33. keyboard_mapping
4.2.34. keyboard_type
4.2.35. user_shortcut
4.2.36. cmosimage
4.2.37. magic_break
4.3. Sound Blaster 16 Emulation
4.3.1. How well does it work?
4.3.2. Output to a sound card
4.3.3. Installation on Linux
4.3.4. Features planned for the future
4.3.5. Description of the sound output classes
4.4. How to write your own keymap table
5. Using Bochs
5.1. Command line arguments
5.2. Search order for the configuration file
5.3. The configuration interface 'textconfig'
5.3.1. The start menu
5.3.2. The Bochs headerbar
5.3.3. The runtime configuration
5.4. Save and restore simulation
6. Common problems and what to do about them (Troubleshooting)
6.1. Bochs panics! What can I do?
6.2. Mouse behavior, enabling and disabling
6.3. Text-mode is broken in some ancient DOS program
7. Mailing Lists
7.1. bochs-developers mailing list
7.2. bochs-announce mailing list
7.3. bochs-cvs mailing list
7.4. Mailing List Etiquette
8. Tips and Techniques
8.1. How to make a simple disk image
8.1.1. Create a flat image
8.1.2. Partition and format your image file
8.2. Use mtools to manipulate disk images
8.3. Bochs GNU/Linux DiskTools
8.4. Win32 only: Tools to manipulate disk images
8.4.1. Winimage
8.4.2. DiskExplorer
8.4.3. Ben Lunt's MTOOLs for Bochs and Win32 and/or DOS
8.5. X Windows: Color allocation problems
8.6. Screen saver turns on too quickly
8.7. Mounting a disk image using the loop device
8.7.1. ...on Linux
8.7.2. ...on FreeBSD
8.8. Simulating a Symmetric Multiprocessor (SMP) Machine
8.9. Setting Up Networking in DLX Linux
8.10. Configuring and using a tuntap network interface
8.10.1. Tuntap description
8.10.2. Set up the linux Kernel + [1]
8.10.3. Configure Bochs to use the tuntap interface
8.10.4. Set up the private network between the host and the guest
8.10.5. Set up the host to masquerade the guest network accesses
8.11. Using Bochs internal debugger
8.11.1. Execution Control
8.11.2. BreakPoints
8.11.3. Manipulating Memory
8.11.4. Info commands
8.11.5. Manipulating CPU Registers
8.11.6. Disassembly commands
8.11.7. Instruction tracing
8.11.8. Instrumentation
8.11.9. Instrumentation commands
8.11.10. Other Commands
8.11.11. Related links
8.12. Using Bochs and the remote GDB stub
8.12.1. Configuring Bochs
8.12.2. Running Bochs
8.12.3. Running GDB
8.13. Using the serial port
8.13.1. Logging serial port output to a file
8.13.2. Interactivity : connecting to a virtual terminal
8.13.3. Interactivity : connecting to a pseudo terminal
8.14. BIOS Tips
8.14.1. Booting from CD-ROMs
8.14.2. Disk translation
8.15. How to enter special key combination
8.16. Notes about VESA usage
8.16.1. Instructions to setup Bochs VBE in Windows Guest OS
8.17. Notes about Cirrus SVGA usage
8.18. Disk Image Modes
8.18.1. flat
8.18.2. concat
8.18.3. external/dll
8.18.4. sparse
8.18.5. vmware3/vmware4
8.18.6. undoable
8.18.7. growing
8.18.8. volatile
8.19. Using the bximage tool
8.20. Using the bxcommit tool
9. Guest operating systems
9.1. Linux
9.2. Knoppix
9.2.1. Getting Knoppix
9.2.2. Preparing Bochs
9.2.3. Using Knoppix
9.3. Minix
9.4. OpenBSD
9.5. FreeBSD 5.2.1
9.5.1. Getting FreeBSD
9.5.2. Preparing Bochs
9.5.3. Installing FreeBSD
9.5.4. Post-installation configuration
9.5.5. Using FreeBSD
9.6. FreeDOS Beta 8
9.7. GNU (Also known as GNU/Hurd)
9.7.1. Installing GNU
9.8. DOS
9.8.1. Accessing your CDROM
9.8.2. SB16 driver for DOS
9.8.3. Bootdisks of early DOS versions
9.9. Windows 95
9.9.1. How to Install Windows 95 with floppies
9.9.2. Installing a Japanese version of Windows 95
9.10. Windows NT 4.0
9.11. Windows 98
9.11.1. Windows 98 Method 1: mcopy Windows 98 into Hard Disk Image (Linux Host)
9.11.2. Locating Your Partitions
9.11.3. Cleaning Up Your MS Windows Partition
9.11.4. Mounting Your Windows Partition
9.11.5. Choosing the Size of Your Disk Image
9.11.6. Setting Up the Disk Image
9.11.7. Create the .bochsrc Configuration File
9.11.8. Make Hard Disk Image Acessible by Mtools
9.11.9. Format Partition and Copy Files
9.11.10. The Fun Begins
9.11.11. Windows 98 Method 2: Classic Install (Linux Host)
9.11.12. Saving Your Windows 98 CD as a Disk +Image
9.11.13. Making the Windows 98 Hard Disk Image
9.11.14. Create the .bochsrc Configuration File
9.11.15. Create the Primary DOS Partition and set it Active
9.11.16. Formatting the Disk Image
9.11.17. Starting the Installation
9.12. Windows ME
9.12.1. Installing Windows ME
9.13. Windows 2000
9.14. Windows 2000 Server
9.15. Windows XP
9.16. SCO OpenServer 5.0.5

  Next
  Introduction to Bochs
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/install-binary.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/install-binary.html new file mode 100644 index 0000000..e865337 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/install-binary.html @@ -0,0 +1,888 @@ + +Installing a Binary
Bochs User Manual
PrevChapter 3. InstallationNext

3.3. Installing a Binary

This section is divided up by platform, since installing a binary package +is different on different platforms.

3.3.1. Windows

The Bochs binaries for Windows are distributed in an EXE installer package. +The Bochs installer can be started like any other Windows program and it brings +up the installation wizard. Here you can select the destination folder and the +installation options. The wizard installs the files and creates the registry +keys, start menu and desktop links.

Previous releases of Bochs were distributed as ZIP packages, too. These packages +contained the same set of files as the installer package from the same version.

If you are new to Bochs you should try out the DLX Linux demo distributed with +Bochs. The installation wizard has created a link on the desktop if you decided +to install the demo. If you doubleclick the icon two windows will appear: +one is the Bochs Display window, and the other is text window that is used for +the runtime configuration and for log messages if no logfile is specified.

You can find more information on the DLX Linux demo in the next section below the +DLX Linux screenshot.

Table 3-3. Files in Bochs directory (Windows version)

FileDescription
BIOS-bochs-latest default ROM BIOS image for Bochs
BIOS-bochs-legacy ROM BIOS image without 32-bit init code
bochs.exe the main Bochs executable
bochs.ico the Bochs icon (used for links in start menu and on the desktop)
bochsdbg.exe the main Bochs executable with debugger enabled
bochsrc-sample.txt sample Bochs configuration file
bxcommit.exe tool for committing redologs to flat disk images
bximage.exe tool for making new disk images
CHANGES.txt what has changed between versions
COPYING.txt copy of the LGPL license
README.txt the read-me file from the source distribution.
TODO.txt the TODO file from the source distribution.
niclist.exe tool to find out the network interface name
penguin.ico the Linux logo (used for the DLX link in start menu)
sb16ctrl.exe tool to control sb16 in Bochs
sb16ctrl.txt examples of sb16ctrl commands
VGABIOS-elpin-2.40 VGA BIOS image for Bochs
VGABIOS-elpin-LICENSE.txt license for VGA BIOS
VGABIOS-lgpl-latest LGPL'd VGA BIOS image for Bochs
VGABIOS-lgpl-latest-debug LGPL'd VGA BIOS image for Bochs with debug output to the logfile
VGABIOS-lgpl-latest-cirrus LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled
VGABIOS-lgpl-latest-cirrus-debug LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled and debug output to the logfile
VGABIOS-lgpl-README.txt readme for the LGPL'd VGA BIOS
uninstall.exe uninstall program for Bochs (created by the installation wizard)
dlxlinux\ directory containing DLX linux sample disk image and configuration files
dlxlinux\readme.txt description of DLX linux
dlxlinux\bochsrc.txt Bochs configuration file for DLX
dlxlinux/hd10meg.img disk image file (10 meg)
dlxlinux\start.bat Run this BAT file to try out DLX Linux inside Bochs!
dlxlinux\testform.txt Form for reporting success or failure
doc\index.htmla local copy of all Bochs documentation (online copy)
keymaps\*.map keymap tables (on Windows used for the paste feature only)

3.3.2. Linux RPM

RPM stands for "RedHat Package Manager." An RPM is a compressed file +containing files to be installed on your system. Many Linux distributions, +not just RedHat ones, can install files from an RPM. First, download the +Bochs RPM for your architecture to your computer. For example, if you have an +Intel-compatible computer, be sure to get the RPM that says "for Linux x86 +distributions" or "i386". Once you have the package on your local disk, you +should become the root user and install it as follows[1]: + +

Figure 3-2. Installing an RPM in Linux

  user$ su
+  Password: 
+  root# ls -l bochs-1.2.1.i386.rpm
+  -rw-rw-r--    1 user     user      1877515 Sep 14 09:02 bochs-1.2.1.i386.rpm
+  root# rpm -i bochs-1.2.1.i386.rpm
+  Looking for fonts to install... /usr/local/bochs/latest/
+  Looking for X11 Font Path... /usr/lib/X11/fonts
+  Installing vga.pcf... ok    (it was already there)
+  Running mkfontdir...
+  Done installing Bochs fonts for X11.
+  root# exit
+  user$ _

All RPM installations are done as the root user because they require +permission to update system files and directories. If you do not have root +access you need to compile Bochs in your home directory.

RPM installation can fail for a few reasons. It will fail if you already +have a Bochs package installed. In this case, try upgrading the old package +to the new package with rpm --upgrade NAME.i386.rpm. +Another potential problem is missing RPM dependencies. If you are getting +errors about missing files or RPMs, then first you should try to +install the RPMs that provide the missing pieces. If that cannot be done, +download the source RPM and build a new binary RPM that is appropriate +for your platform. The command is rpmbuild --rebuild +NAME.src.rpm. As a last resort, you can run rpm with the +--nodeps option to ignore dependencies and install it +anyway, but if it is missing important pieces it may not run properly.

The Bochs RPM installs four new commands and associated manual pages: bochs, +bochs-dlx, bximage and bxcommit. First, let's try out the DLX Linux demo by typing +bochs-dlx. + +
  user$ bochs-dlx
+  ---------------------------------------------------------------
+	      DLX Linux Demo, for Bochs x86 Emulator
+  ---------------------------------------------------------------
+  Checking for bochs binary...ok
+  Checking for DLX linux directory...ok
+  Checking for /bin/gzip...ok
+  Checking for /usr/users/bryce/.bochsdlx directory...
+  ---------------------------------------------------------------
+  To run the DLX Linux demo, I need to create a directory called
+  /usr/users/bryce/.bochsdlx, and copy some configuration files
+  and a 10 megabyte disk image into the directory.
+  ---------------------------------------------------------------
+  Is that okay? [y/n]
+  y
+  Copying /usr/share/bochs/dlxlinux/bochsrc.txt -> /usr/users/bryce/.bochsdlx/.
+  Copying /usr/share/bochs/dlxlinux/README -> /usr/users/bryce/.bochsdlx/.
+  Copying /usr/share/bochs/dlxlinux/testform.txt -> /usr/users/bryce/.bochsdlx/.
+  Uncompressing /usr/share/bochs/dlxlinux/hd10meg.img.gz -> /usr/users/bryce/.bochsdlx/hd10meg.img
+  Entering /usr/users/bryce/.bochsdlx
+  Running bochs
+  ========================================================================
+			Bochs x86 Emulator 2.0.pre3
+		Build from CVS snapshot on December 4, 2002
+  ========================================================================
+ +Then you get a new X11 window containing the VGA display of the simulated +machine. First you see the VGA BIOS screen, then Linux uncompresses and +boots, and you get a login prompt. Type "root" and ENTER to log in to +DLX linux. +

Figure 3-3. Screenshot of Bochs running DLX Linux

Booting is complete when you see "dlx login:" and a cursor. At this login +prompt, type "root". On UNIX systems, root is the system admin user. +There is no password for root on this sample disk image, so it lets you log +in without typing any password. Now you should see a UNIX prompt, and you +can begin to type UNIX commands.

  Welcome to DLX V1.0 (C) 1995-96 Erich Boehm
+                      (C) 1995    Hannes Boehm
+
+  dlx login: root
+  Linux 1.3.89.
+  dlx:~# pwd
+  /root
+  dlx:~# cd /
+  dlx:~# ls
+  bin/       etc/       lost+found/       root/       usr/
+  boot/      fd/        mnt/              sbin/       var/
+  dev/       lib/       proc/             tmp/        zip/
+  dlx:/# df
+  Filesystem    1024-blocks   Used  Available Capacity Mounted on
+  /dev/hda1        10060      2736      6005     29%   /
+  dlx:/# _

When you get tired of playing with DLX Linux, just type "reboot" in the Bochs +window to shut down the DLX Linux operating system, and when it starts +to reboot again press the "Power" button at the top of the Bochs display +to end the application.

Here is a list of the files that are installed by the RPM, and a brief +description of each one.

Table 3-4. Files in RPM package

FileDescription
/usr/share/doc/bochs/CHANGES what has changed between versions
/usr/share/doc/bochs/COPYING copy of the LGPL license
/usr/share/doc/bochs/README the read-me file from the source distribution.
/usr/share/doc/bochs/TODO the TODO file from the source distribution.
/usr/bin/bochs the main Bochs executable
/usr/bin/bximage tool for making new disk images
/usr/bin/bxcommit tool for committing redologs to flat disk images
/usr/lib/bochs/plugins/* device and gui plugins for Bochs (plugin version only)
/usr/share/doc/bochs/bochsrc-sample.txt sample Bochs configuration file
/usr/share/man/man1/* man pages for bochs, bochs-dlx, bximage and bxcommit
/usr/share/man/man5/* man page for bochsrc
/usr/share/doc/bochs/index.html a local copy of all Bochs documentation ( Online copy )
/usr/share/bochs/BIOS-bochs-latest default ROM BIOS image for Bochs
/usr/share/bochs/BIOS-bochs-legacy ROM BIOS image without 32-bit init code
/usr/share/bochs/VGABIOS-elpin-2.40 VGA BIOS image for Bochs
/usr/share/bochs/VGABIOS-elpin-LICENSE license for VGA BIOS
/usr/share/bochs/VGABIOS-lgpl-latest LGPL'd VGA BIOS image for Bochs
/usr/share/bochs/VGABIOS-lgpl-latest-debug LGPL'd VGA BIOS image for Bochs with debug output to the logfile
/usr/share/bochs/VGABIOS-lgpl-latest-cirrus LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled
/usr/share/bochs/VGABIOS-lgpl-latest-cirrus-debug LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled and debug output to the logfile
/usr/share/bochs/VGABIOS-lgpl-README readme for the LGPL'd VGA BIOS
/usr/bin/bochs-dlx run this script to try out DLX Linux inside Bochs!
/usr/share/bochs/dlxlinux/ directory containing DLX linux sample disk image and configuration files
/usr/share/bochs/dlxlinux/readme.txt description of DLX linux
/usr/share/bochs/keymaps/*.map keymap tables for X11 and SDL

3.3.3. MacOS X DMG

This was contributed by Aard Vark in January 2003

The MacOS X binary distribution is a mountable disk +image (.dmg file). Once you've downloaded the binary +distribution file, just double click +on it to automatically unpack the archive and mount +the volume on the desktop. An icon will appear +exactly as if you'd inserted a CD-ROM +or removable storage device, and a finder window +containing the volume should automatically open. +It is likely to have an odd name +such as _dmg_top, but don't worry about that.

Copy the Bochs-2.0 (or whatever version) folder from +the disk image onto your hard disk. Either Home or +Applications would be sensible places to put it. +Because the disk image is mounted read only, you +can't run the included dlxlinux guest OS until +you've copied it to the hard disk.

Once you've installed the binaries, it's probably a +good idea to drag the _dmg_top volume to trash to +unmount it, so you don't get confused and try to +run bochs from there. Then open +the bochs folder from wherever you installed it.

The MacOS X version of bochs requires a terminal +window to run. If you just double click on the Bochs +icon, you'll get an error message telling you to +double click on "bochs.scpt" to start +Bochs in a new terminal window. You'll need to +configure Bochs before you will get very far with +the bochs.scpt in the top folder, +so to try out bochs open the dlxlinux folder and +double click on the bochs.scpt icon inside.

This will open a new terminal window which will +contain the Bochs startup messages, and a +configuration menu. The default option is +[5], which starts the simulation, so press enter to +do so. You will then get a new window containing +the VGA display of the simulated +machine. The new window will probably appear behind +the current terminal window, so either click on the +bochs icon in the dock or the simulation window to +bring it to the front. If you're quick +enough you'll then see the VGA BIOS screen, then +Linux uncompresses and boots, and you get a login +prompt. Type "root" and ENTER to log in to DLX Linux.

Once you've finished playing with DLX Linux, just +type "reboot" in the Bochs window to shut down the +DLX Linux operating system, and +when it starts to reboot again press the "Power" +button in the "MacBochs Hardware Controls" window +(it's the circle containing a vertical bar at the +far right - have a look at the Linux screenshots, +since the Mac version doesn't seem to have +descriptions or tool-tips).

Notes

[1]

Many distributions have their own RPM installer program, often graphical, and +they should work ok. It is helpful to be able to see the text output from +RPM, so if you use a fancy RPM installer, be sure to find the text output and +check that it looks correct.


PrevHomeNext
Tracking the source code with CVSUpCompiling Bochs
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/installation.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/installation.html new file mode 100644 index 0000000..612ecf6 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/installation.html @@ -0,0 +1,295 @@ + +Installation
Bochs User Manual
PrevNext

Chapter 3. Installation

3.1. Downloading Bochs

You can download Bochs from our web site at bochs.sourceforge.net. First, you +need to choose what version to get: a recent release or a development +version. If you trying to get things working for the first time, a release +version is recommended since it has been tested the most. The development +versions (sometimes called snapshots) may have some newer bug fixes and new +features, but have not been tested as much as the releases.

Second, you can choose to compile Bochs from source code or install a binary +(if one is available for your platform). Binary packages will be quicker to +install, and most include a small demo of a guest operating system called DLX +Linux to get you started. However, some features can only be enabled if you +compile Bochs yourself, for example the Bochs debugger. For multiuser systems, +you will probably need system administrator privileges (root) to install a +binary package. If you decide to get a binary, download it to your hard disk, +uncompress it, then go to the section called Installing a Binary for more information.

If you are going to compile Bochs yourself, you need the gzipped tarball +containing the source code, called +bochs-version.tar.gz. For +Windows and Mac, the prebuilt Makefiles are separate, so also get +the Makefiles for your platform. To unpack a compressed TAR file[1] on a Unix machine[2] +, type +
  gunzip -c bochs-version.tar.gz | tar -xvf -
+This creates a directory called +bochs-version full of +files. This directory will be referred to as $BOCHS. Go into +$BOCHS and you are ready to compile. Instructions for compiling +Bochs are in the section, Compiling Bochs.

Alternatively, you can also obtain the sources for any Bochs version using CVS. +See the CVS instructions for details.

Notes

[1]

A TAR file is a single file that contains many files packed inside. Bochs +TAR files are compressed with a program called gzip, and another program +called gunzip is used to uncompress them.

[2]

On Windows, look for software called WinZip to unpack the TAR.


PrevHomeNext
Release Notes Tracking the source code with CVS
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/internal-debugger.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/internal-debugger.html new file mode 100644 index 0000000..2779a05 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/internal-debugger.html @@ -0,0 +1,978 @@ + +Using Bochs internal debugger
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.11. Using Bochs internal debugger

Note, if you are looking for a graphical front-end for the +bochs debugger, you may want to check out +BFE. This is a +package written by a Bochs user which can interface with +the text based Bochs debugger. No linking is necessary. +It's not part of Bochs, but you may find it useful.

You can now conditionally compile in a GDB like command line debugger, that +allows you to set breakpoints, step through instructions, and other +useful functions. If there isn't a command for something you believe +is generally useful for the debugger, let me know and I'll implement +it if possible.

To use the debugger, you must configure Bochs with the +--enable-debugger and --enable-disasm flags. +For example: +
  ./configure --enable-debugger --enable-disasm

Note: You must use flex version 2.5.4 or greater. I have heard that +version 2.5.2 will not work.

When you first start up Bochs, you will see the command line prompt + +
  bochs:1>
+ +From here, you may use the following commands:

8.11.1. Execution Control

  c                           continue executing
+  continue
+
+  s     [count]               execute count instructions, default is 1
+  step  [count]
+  stepi [count]
+
+  Ctrl-C                      stop execution, and return to command line prompt
+  Ctrl-D                      if at empty line on command line, exit
+
+  q                           quit debugger and execution
+  quit
+  exit

8.11.2. BreakPoints

  NOTE: The format of 'seg', 'off', and 'addr' in these descriptions,
+        are as follows.  I don't have any way to set the current radix.
+
+        hexidecimal:    0xcdef0123
+        decimal:        123456789
+        octal:          01234567
+
+  vbreak seg:off              Set a virtual address instruction breakpoint
+  vb     seg:off
+
+  lbreak addr                 Set a linear address instruction breakpoint
+  lb     addr
+
+  pbreak [*] addr             Set a physical address instruction breakpoint
+  pb     [*] addr             (the '*' is optional for GDB compatibility)
+  break  [*] addr
+  b      [*] addr
+
+  info break                  Display state of all current breakpoints
+  bpe    n                    Enable a breakpoint
+  bpd    n                    Disable a breakpoint
+  delete n                    Delete a breakpoint
+  del    n
+  d      n

8.11.3. Manipulating Memory

  x  /nuf addr      Examine memory at linear address addr
+  xp /nuf addr      Examine memory at physical address addr
+     n              Count of how many units to display
+     u              Unit size; one of
+                      b Individual bytes
+                      h Halfwords (2 bytes)
+                      w Words (4 bytes)
+                      g Giant words (8 bytes)
+                      NOTE: these are *not* typical Intel nomenclature sizes,
+                            but they are consistent with GDB convention.
+     f              Printing format.  one of
+                      x Print in hexadecimal
+                      d Print in decimal
+                      u Print in unsigned decimal
+                      o Print in octal
+                      t Print in binary
+
+    n, f, and u are optional parameters.  u and f default to the last values
+    you used, or to w(words) and x(hex) if none have been supplied.
+    n currently defaults to 1.  If none of these optional parameters are
+    used, no slash should be typed.  addr is also optional.  If you don't
+    specify it, it will be the value the next address (as if you had
+    specified n+1 in the last x command).
+
+  setpmem addr datasize val    Set physical memory location of size
+                               datasize to value val.
+
+  crc  addr1  addr2            Show CRC32 for physical memory range addr1..addr2
+  info dirty                   Show physical pages dirtied (written to) since last display
+                               Values displayed are the top 20 bits only (page addresses)

8.11.4. Info commands

  info r|reg|regs|registers    List of CPU integer registers and their contents
+  info cpu                     List of all CPU registers and their contents
+  info fpu                     List of all FPU registers and their contents
+  info sse                     List of all SSE registers and their contents
+  info mmx                     List of all MMX registers and their contents
+  info creg                    Show CR0-CR4 registers and their contents
+  info sreg                    Show segment registers and their contents
+  info eflags                  Show decoded EFLAGS register
+  info break                   Information about current breakpoint status
+  info tab                     Show paging address translation

8.11.5. Manipulating CPU Registers

  set reg = expr    Change a CPU register to value of expression.
+                    Currently only general purpose registers are supported,
+                    you may not change:
+                      eflags, eip, cs, ss, ds, es, fs, gs.
+
+    Examples: set eax = 2+2/2
+              set esi = 2*eax+ebx
+
+  registers         List of CPU registers and their contents
+  regs
+  reg
+  r

8.11.6. Disassembly commands

  disassemble start end       Disassemble instructions in given linear address
+                              range, inclusive of start, exclusive of end.
+                              Use "set $disassemble_size =" to tell
+                              debugger desired segment size.  Use a value for
+                              end of less than start (or zero) if you only
+                              want the first instruction disassembled.
+
+  disassemble switch-mode     Switch between Intel and AT&T disassebly styles
+                              for debugger disassembler.
+
+  disassemble size = n        Tell debugger what segment size to use when
+                              the "disassemble" command is used.  Use values
+                              of 0, 16 or 32 for n.  Value of 0 means
+			      "use segment size specified by current CS
+			      segment". Default is 0.
+
+  set $auto_disassemble = n   Cause debugger to disassemble current instruction
+                              every time execution stops if n=1.  Default is 0.
+                              Segment size of current CPU context is used for
+                              disassembly, so the "disassemble size" variable is
+                              ignored.
+
+  set disassemble on          The same as 'set $auto_disassemble = 1'
+  set disassemble off         The same as 'set $auto_disassemble = 0'

8.11.7. Instruction tracing

  trace on                    Disassemble every executed instruction. Note
+                              that instructions which caused exceptions are
+                              not really executed, and therefore not traced.
+
+  trace off                   Disable instruction tracing.

8.11.8. Instrumentation

To use instrumentation features in bochs, you must compile in support for it. +You should build a custom instrumentation library in a separate directory in +the "instrument/" directory. To tell configure which instrumentation library +you want to use, use the "--enable-instrumentation" option. + +The default library consists of a set of stubs, and the following are +equivalent: + +
  ./configure [...] --enable-instrumentation
+  ./configure [...] --enable-instrumentation="instrument/stubs"
+ +You could make a separate directory with your custom library, +for example "instrument/myinstrument", copy the contents of +the "instrument/stubs" directory to it, then customize it. Use: + +
  ./configure [...] --enable-instrumentation="instrument/myinstrument"

8.11.9. Instrumentation commands

  instrument start            calls bx_instr_start()
+  instrument stop             calls bx_instr_stop()
+  instrument reset            calls bx_instr_reset()
+  instrument print            calls bx_instr_print()

8.11.10. Other Commands

ptime
+ +Print the current time (number of ticks since start of simulation). + +
sb delta
+ +Insert a time break point "delta" instructions into the future ("delta" is a 64-bit integer followed by "L", for example 1000L). + +
sba time
+ +Insert a time break point at "time" ("time" is a 64-bit integer followed by "L", for example 1000L). + +
record filename
+ +Record console input to file filename. The file consists of +zero or more lines of the form "%s %d %x", where the first word is the +event type, the second is a time stamp and the third is event specific +data. + +
playback filename
+ +Playback console input from file filename. Additional input can +be given directly in the console window. Events in the file will be +played back at times relative to the time when the playback command +was executed. + +
print-stack [num words]
+ +Print the num words top 16-bit words on the stack. Num +words defaults to 16. Only works reliably in protected mode when +the base address of the stack segment is zero. + +
watch stop
+ +Stop the simulation (and return to prompt) when a watch point is +encountered. + +
watch continue
+ +Do not stop the simulation when watch points are encountered. They will +still be logged. + +
watch
+ +Print current watch point status. + +
unwatch
+ +Remove all watch points. + +
watch read address
+ +Insert a read watch point at physical address address. + +
watch write address
+ +Insert a write watch point at physical address address. + +
unwatch read address
+ +Remove read watch point from physical address address. + +
unwatch write address
+ +Remove write watch point from physical address address. + +
modebp
+ +Toggles CPU mode switch breakpoint. + +
load-symbols [global] filename [offset]
+ +Load symbols from file filename. If the global keyword is +added, then the the symbols will be visible in all contexts for which +symbols have not been loaded. Offset (default is 0) is added to +every symbol entry. The symbols are loaded in the current (executing) +context.

The symbol file consists of zero or more lines of the format
"%x %s"
. + +
show [string]
+ +
  Toggles show symbolic info (calls to begin with).
+  show - shows current show mode
+  show mode     - show, when processor switch mode
+  show int      - show, when interrupt is happens
+  show call     - show, when call is happens
+  show ret      - show, when iret is happens
+  show off      - toggles off symbolic info
+  show dbg-all  - turn on all show flags
+  show dbg-none - turn off all show flags

8.11.11. Related links

add links +

  • Cosimulation

  • Instrumentation


PrevHomeNext
Configuring and using a tuntap network interfaceUpUsing Bochs and the remote GDB stub
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/introduction.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/introduction.html new file mode 100644 index 0000000..b204869 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/introduction.html @@ -0,0 +1,319 @@ + +Introduction to Bochs
Bochs User Manual
PrevNext

Chapter 1. Introduction to Bochs

1.1. What is Bochs?

Bochs is a program that simulates a complete Intel x86 computer. It +can be configured to act like a 386, 486, Pentium, Pentium II, +Pentium III, Pentium 4 or even like x86-64 CPU, including optional MMX, SSEx +and 3DNow! instructions. +Bochs interprets every instruction from power-up to reboot, and has +device models for all of the standard PC peripherals: keyboard, mouse, +VGA card/monitor, disks, timer chips, network card, etc. Because Bochs +simulates the whole PC environment, the software running in the simulation +"believes" it is running on a real machine. This approach allows Bochs +to run a wide variety of software with no modification, include most popular +x86 operating systems: Windows 95/98/NT/2000/XP and Vista, all Linux flavors, +all BSD flavors, and more.

Bochs is written in the C++ programming language, and is designed to run +on many different host platforms[1], including x86, PPC, Alpha, Sun, and MIPS. No matter what the +host platform is, Bochs still simulates x86 software. In other words, it +does not depend on the native instructions of the host machine at all. +This is both a strength and a weakness, and it's the major difference between +Bochs and many other x86 emulation software such as plex86, VMware, etc. +Because Bochs uses software simulation for every single x86 instruction, it +can simulate a Windows application on an Alpha or Sun workstation. However, +the downside of Bochs' approach is simulation performance. To model the +processor accurately, Bochs must run many instructions for every simulated x86 +instruction, and this makes the simulated machine many times slower than +the physical machine. Commercial PC emulators (VMware, Connectix, etc.) can +achieve much high emulation speed using a technique called +virtualization[2], but they are neither portable to non-x86 platforms nor open +source. The Plex86 project is +working toward an open-source x86 simulator with virtualization.

To do anything interesting in the simulated machine, Bochs needs to interact +with the operating system on the host platform (the host OS). When you press a +key in the Bochs display window, a key event goes into the device model for the +keyboard. When the simulated machine needs to read from the simulated hard +disk, Bochs reads from a disk image file on the host machine. When the +simulated machine sends a network packet to the local network, Bochs uses the +host platform's network card to send the packet out into the real world. These +interactions between Bochs and the host operating system can be complicated, +and in some cases they are host platform specific. Sending a network packet in +FreeBSD requires different code than sending the packet in Windows 95, for +example. For this reason, certain features are supported on some host +platforms and not others. On GNU/Linux, Bochs can simulate a network card that +communicates with the world, but on BeOS the simulated network card may not +work because the communication code between the device model and the BeOS +operating system has not been written.

Bochs was written by Kevin Lawton starting in 1994. It began as a +commercial product, which you could buy with source code for ... + [3] Finally, in March 2000, MandrakeSoft (now called +Mandriva) bought Bochs +(press release) +and made it open source under the GNU LGPL. + +In March 2001, Kevin helped a few developers to move all Bochs activities from +bochs.com to a new site at bochs.sourceforge.net. Since then the Bochs project +has settled into its new home, and around release times has even hit #1 most +active project of the week at SourceForge.

Notes

[1]

Since Bochs can run on one kind of machine and simulate another machine, we +have to be clear in our terminology to avoid confusion. The host platform is +the machine that runs the Bochs software. The guest platform is the operating +system and applications that Bochs is simulating.

[2]

Virtualization takes advantage of simulating x86 instructions on an +x86 machine, allowing large portions of the simulation to take place +at native hardware speed. Whenever the simulated machine talks to the +hardware or enters certain privileged modes (such as in kernel code), +the simulator typically takes control and simulates that code in +software at much slower speed, just like Bochs does.

[3]

We need a Bochs historian to help out here. For background, it would be +interesting to know how much Bochs used to cost and what it was used for. I +thought I saw an interview out there somewhere where Kevin says why he started +it and some more background information.


PrevHomeNext
Bochs User Manual Who uses Bochs?
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/is-bochs-right-for-me.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/is-bochs-right-for-me.html new file mode 100644 index 0000000..6d7ce93 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/is-bochs-right-for-me.html @@ -0,0 +1,181 @@ + +Is Bochs right for me?
Bochs User Manual
PrevChapter 1. Introduction to BochsNext

1.3. Is Bochs right for me?

Bochs is very useful for some applications, and not well suited to others. +This section tries to answer the question, "Is Bochs right for me?"

Bochs may or may not be right for you, depending on what it is you want to do. +Perhaps all you want to do is run one or two applications native to Microsoft Windows +on GNU/Linux, or vice-versa. Perhaps your biggest concern is speed and performance. +Maybe you don't mind tweaking a few files here and there when you want another application +to work in that setting. +In cases where the objective is to simulate x86 hardware on an x86, Plex86, Wine, and +VMware might be your best options.

On the other hand, perhaps you have a vital application running on an older operating +system that only runs well on old hardware. You are concerned that the life cycle of +this hardware is coming to an end, and your backup and restoration hardware and tools +no longer suffice for the amount of data that you have. You need to transfer backup +disk images over a network, and want to use modern procedures for hardware maintenance. +Perhaps the application is important enough to run on a larger computer, such as a +64-bit machine, or even a mainframe. Bochs would be an excellent option in such a scenario.

Perhaps your objective is to debug software or hardware drivers. Bochs offers a controlled +environment that can better assist you in determining cause and effect relationships. +You can take snapshots that show you what is going on behind the scenes. +You can isolate the line that caused that crash. You can have multiple +images and compare them under a microscope. +In these situation, Bochs could save you time and resources.

Information Technology changes faster than any other field. +It is very easy to forget transitional software that came and went. +But history is important to all fields, and to build on the future, +it is important to understand the past. Computer programmers, however, +do not have the same advantage as an architect, who can, for example, +take a trip to Greece and touch a pillar. Much of the history of Computer +Science is left on corroding floppies and malfunctioning hardware. +Bochs gives you the benefit of having one or more complete environments +where you can understand firsthand the behavior of operating systems and +programs. This cannot be achieved with an "emulator" such as Wine.


PrevHomeNext
Who uses Bochs?UpWill it work for me?
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/keymap.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/keymap.html new file mode 100644 index 0000000..f462364 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/keymap.html @@ -0,0 +1,1011 @@ + +How to write your own keymap table
Bochs User Manual
PrevChapter 4. SetupNext

4.4. How to write your own keymap table

Christophe Bothamy wrote the keymapping code for Bochs, and provided this +documentation for how to create new keymaps. Keymapping was first +implemented for X windows only, so there are many references to X-specific +values in this section. In Bochs 2.0 keymapping is also available for SDL +(Linux port) and wxWidgets (wxGTK port).

  The standard US Keyboard looks like this:
+
+          -------------------------------------------
+  Top row Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 
+          -------------------------------------------
+  2nd row ` 1 2 3 4 5 6 7 8 9 0 - = \ Back
+          -------------------------------------------
+  3rd row Tab Q W E R T Y U I O P [ ] Enter
+          -------------------------------------------
+  4rd row Caps A S D F G H J K L ; '
+          -------------------------------------------
+  5rd row lShift l\ Z X C V B N M , . / rShift
+          -------------------------------------------
+  6rd row lCtrl lAlt Space rAlt rCtrl
+          -------------------------------------------

Each key of the US keyboard maps to a Bochs constant named +BX_KEY_symbol. You can find the current list of +BX_KEY_symbol in +the BX_KEY table, below. Please note that +there is only one BX_KEY_symbol for each physical +key.

Now, for each key of the US keyboard, look at which symbols you can type on your +real keyboard. Each symbol maps to a X-windows +XK_symbol constant. In +X11/keysymdef.h, you will find the list of all possible +XK_symbol on your system. Alternatively, you can +use a small utility called "xev" that prints out the symbol names of a pressed +key. Note that the symbol name given by xev does not contain the XK_ prefix. +Don't forget to add a line for every symbol you can type on each key. For the +key BX_KEY_A, you can type both lowercase 'a' and uppercase 'A', so you would +need two different entries.

You can then create your own map file. Keymap files are found in the +"gui/keymaps" directory in the source code, or in the "keymaps" directory in +binary releases. Look at the existing keymap file as an example, and create a +file containing one line for each symbol. The first column tells what key or +combination of keys can be used to produce a given symbol. The second column +is the ASCII equivalent for that symbol, or a special keyword (none, space, +return, tab, backslash, or apostrophe). The third column is the X windows +keysym for that symbol.

For example : +
BX_KEY_0                                      '0'        XK_0
+BX_KEY_1                                      '1'        XK_1
+BX_KEY_2                                      '2'        XK_2
+BX_KEY_0+BX_KEY_SHIFT_L                       ')'        XK_parenright
+BX_KEY_1+BX_KEY_SHIFT_L                       '!'        XK_exclam
+BX_KEY_2+BX_KEY_SHIFT_L                       '@'        XK_at
+BX_KEY_A                                      'a'        XK_a
+BX_KEY_B                                      'b'        XK_b
+BX_KEY_A+BX_KEY_SHIFT_L                       'A'        XK_A
+BX_KEY_B+BX_KEY_SHIFT_L                       'B'        XK_B
+BX_KEY_TAB                                    tab        XK_Tab
+BX_KEY_ENTER                                  return     XK_Return
+BX_KEY_F1                                     none       XK_F1
+BX_KEY_F2                                     none       XK_F2
+BX_KEY_F3                                     none       XK_F3

Now that there are several keymap files in the Bochs distribution, it is +easiest to copy an existing keymap and follow the examples you see. When it +works, be sure to send it to the mailing list or post it on Source Forge so +that we can include it in the next release. You may need to look up some of +your country specific X11 symbols in X11/keysymdef.h.

Table 4-6. BX_KEY constants

BX_KEY constant Keyboard Symbol
BX_KEY_CTRL_L left Ctrl
BX_KEY_SHIFT_L left Shift
BX_KEY_F1 F1
BX_KEY_F2 F2
BX_KEY_F3 F3
BX_KEY_F4 F4
BX_KEY_F5 F5
BX_KEY_F6 F6
BX_KEY_F7 F7
BX_KEY_F8 F8
BX_KEY_F9 F9
BX_KEY_F10 F10
BX_KEY_F11 F11
BX_KEY_F12 F12
BX_KEY_CTRL_R right Ctrl
BX_KEY_SHIFT_R right Shift
BX_KEY_CAPS_LOCK CapsLock
BX_KEY_NUM_LOCK NumLock
BX_KEY_ALT_L left Alt
BX_KEY_ALT_R right Alt
BX_KEY_A A
BX_KEY_B B
BX_KEY_C C
BX_KEY_D D
BX_KEY_E E
BX_KEY_F F
BX_KEY_G G
BX_KEY_H H
BX_KEY_I I
BX_KEY_J J
BX_KEY_K K
BX_KEY_L L
BX_KEY_M M
BX_KEY_N N
BX_KEY_O O
BX_KEY_P P
BX_KEY_Q Q
BX_KEY_R R
BX_KEY_S S
BX_KEY_T T
BX_KEY_U U
BX_KEY_V V
BX_KEY_W W
BX_KEY_X X
BX_KEY_Y Y
BX_KEY_Z Z
BX_KEY_0 0
BX_KEY_1 1
BX_KEY_2 2
BX_KEY_3 3
BX_KEY_4 4
BX_KEY_5 5
BX_KEY_6 6
BX_KEY_7 7
BX_KEY_8 8
BX_KEY_9 9
BX_KEY_ESC Esc
BX_KEY_SPACE SpaceBar
BX_KEY_SINGLE_QUOTE '
BX_KEY_COMMA ,
BX_KEY_PERIOD .
BX_KEY_SLASH /
BX_KEY_SEMICOLON ;
BX_KEY_EQUALS =
BX_KEY_LEFT_BRACKET [
BX_KEY_BACKSLASH \
BX_KEY_RIGHT_BRACKET ]
BX_KEY_MINUS -
BX_KEY_GRAVE `
BX_KEY_BACKSPACE BackSpace
BX_KEY_ENTER Enter
BX_KEY_TAB Tab
BX_KEY_LEFT_BACKSLASH left \
BX_KEY_PRINT PrintScreen
BX_KEY_SCRL_LOCK ScrollLock
BX_KEY_PAUSE Pause
BX_KEY_INSERT Ins
BX_KEY_DELETE Del
BX_KEY_HOME Home
BX_KEY_END End
BX_KEY_PAGE_UP PageUo
BX_KEY_PAGE_DOWN PageDown
BX_KEY_KP_ADD Numeric Keypad +
BX_KEY_KP_SUBTRACT Numeric Keypad -
BX_KEY_KP_END Numeric Keypad 1
BX_KEY_KP_DOWN Numeric Keypad 2
BX_KEY_KP_PAGE_DOWN Numeric Keypad 3
BX_KEY_KP_LEFT Numeric Keypad 4
BX_KEY_KP_5 Numeric Keypad 5
BX_KEY_KP_RIGHT Numeric Keypad 6
BX_KEY_KP_HOME Numeric Keypad 7
BX_KEY_KP_UP Numeric Keypad 8
BX_KEY_KP_PAGE_UP Numeric Keypad 9
BX_KEY_KP_INSERT Numeric Keypad 0
BX_KEY_KP_DELETE Numeric Keypad .
BX_KEY_KP_ENTER Numeric Keypad Enter
BX_KEY_KP_MULTIPLY Numeric Keypad *
BX_KEY_KP_DIVIDE Numeric Keypad /
BX_KEY_UP UpArrow
BX_KEY_DOWN DownArrow
BX_KEY_LEFT LeftArrow
BX_KEY_RIGHT RightArrow
BX_KEY_WIN_L Left Windows
BX_KEY_WIN_R Right Windows
BX_KEY_MENU Menu
BX_KEY_ALT_SYSREQ Alt-Sysreq
BX_KEY_CTRL_BREAK Ctrl-Break
BX_KEY_INT_BACK Internet - back
BX_KEY_INT_FORWARD Internet - forward
BX_KEY_INT_STOP Internet - stop
BX_KEY_INT_MAIL Internet - mail
BX_KEY_INT_SEARCH Internet - search
BX_KEY_INT_FAVInternet - favorites
BX_KEY_INT_HOME Internet - home
BX_KEY_POWER_MYCOMP Powerkeys - my computer
BX_KEY_POWER_CALC Powerkeys - calculator
BX_KEY_POWER_SLEEP Powerkeys - sleep
BX_KEY_POWER_POWER Powerkeys - power
BX_KEY_POWER_WAKE Powerkeys - wake

PrevHomeNext
Sound Blaster 16 EmulationUpUsing Bochs
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/license.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/license.html new file mode 100644 index 0000000..5bc6f1b --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/license.html @@ -0,0 +1,253 @@ + +Bochs License
Bochs User Manual
PrevChapter 1. Introduction to BochsNext

1.5. Bochs License

Bochs is copyrighted by MandrakeSoft S.A.[1] +and distributed under the +GNU Lesser General Public License[2]. The following text appears at the +top of every source code file in the Bochs distribution: +
  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Notes

[1]

MandrakeSoft has web sites at +http://mandrakesoft.com and +http://www.linux-mandrake.com.

[2]

Complete text of the GNU LGPL is included with the source code in a file +called COPYING, and is also here.


PrevHomeNext
Will it work for me?UpThird Party Software Licensing and Temporary Files
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/loop-device-usage.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/loop-device-usage.html new file mode 100644 index 0000000..5960696 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/loop-device-usage.html @@ -0,0 +1,337 @@ + +Mounting a disk image using the loop device
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.7. Mounting a disk image using the loop device

This section describes how to access a floppy or hard disk image within Linux +using the loop device. Why would you want to do this? Let's say you have made +a small Linux disk image for Bochs, and you want to install some more software +on it. You have already downloaded the software onto your real system, so now +you want to transfer it to the Bochs disk image. A fast way to transfer +the files is to mount the disk image using the loop device.

8.7.1. ...on Linux

This section was contributed by Volker Ruppert. +
Today I have made some tests with the loop device, because I want to exchange 
+files with the bochs disk images.  This is what I found out:
+
+1.  Using Floppy images is easy, because there is no partition table:
+
+    losetup /dev/loop0 /usr/local/bochs/dlxlinux/floppya.img
+
+    Now you can use the image like a real floppy:
+
+    - format           : mkfs.minix /dev/loop0
+    - filesystem check : fsck.minix /dev/loop0
+    - mount            : mount /dev/loop0 -o loop /mnt/floppy
+
+    Before you want to restart bochs you must do this:
+
+    losetup -d /dev/loop0
+
+    Don't forget to umount before.
+
+2.  If you want access to a hard disk image, you have to calculate the size of
+    the first cylinder. This value is the offset argument for losetup.
+
+    offset = bytes per sector * sectors per cylinder
+
+    The command for dlxlinux image looks like this:
+
+    losetup /dev/loop0 /usr/local/bochs/dlxlinux/hd10meg.img -o 8704
+
+    For images created by bximage you must use the value 32256.
+
+3.  The hard disk image access doesn't work if the image contains more than
+    one partition.
+
+4.  I have made this tests with Linux and I don't know how
+    this could be done with other operating systems.

8.7.2. ...on FreeBSD

This section was contributed by Alexander Schuch.

The following example mounts a Windows 95 hard disk image called Windows 95 B (2031-16-63) +into the FreeBSD file system. It is specific to FreeBSD 5.x; for +hints on how to do the same task on FreeBSD 4.x, or for more information in +general, check the proper section of the FreeBSD handbook: +Network, Memory, and File-Backed File Systems. +You can use the same procedure for mounting floppy disk images.

# mdconfig -a -t vnode -f "Windows 95 B (2031-16-63)"
+md0
+mdconfig returns the device, your file now is accessable from. +
# mount -t msdosfs /dev/md0s1 /mnt
+If you already have other md devices configured, you need to substitute md0s1 +with, for example, md6s1.

Once you are done working with the image, unmount the md device and detach it. +
# umount /mnt
+# mdconfig -d -u 0
+And again, if there are other md devices configured, use the proper device +number. In case you forgot the number, just ask mdconfig, like: +
# mdconfig -l
+md7
+# mdconfig -d -u 7


PrevHomeNext
Screen saver turns on too quicklyUpSimulating a Symmetric Multiprocessor (SMP) Machine
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mailinglist-etiquette.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mailinglist-etiquette.html new file mode 100644 index 0000000..018624d --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mailinglist-etiquette.html @@ -0,0 +1,210 @@ + +Mailing List Etiquette
Bochs User Manual
PrevChapter 7. Mailing ListsNext

7.4. Mailing List Etiquette

Here are a few guidelines for use of the Bochs mailing lists:

  • Please check the documentation before asking questions, but on this list you +are very UNLIKELY to get flamed and insulted for being a Bochs beginner. +Sending commercial promotions to the list probably will get you some angry +responses though.

  • If you are having difficulty finding what you are looking for, try doing a search on Google. If you are searching for Bochs options, for example, you can use this syntax in the Google search box: +
    configuration options site:bochs.sourceforge.net
    +For best results, be sure not to put a space between "site:" and "bochs.sourceforge.net". Be sure to look at more than the first item on the search results.

  • If you still cannot find what you are looking for, be sure you are prepared when you post your question, and post in the right forum. Be sure you include important details, such as the operating system and version of your host, and what it is you are trying to do. If you are getting errors or something is not working, summarize what you checked and what you changed. This will help isolate the problem.

  • Bochs is for everyone. If you are an experienced Bochs user or developer and are helping someone else, be considerate of the other person's feelings. We share a common interest, and we need to encourage each other and be supportive.

  • Also, keep in mind that messages are limited to 40K, so if you want to share a +large screen shot or disk image, put it on a web or FTP site and tell people +how to find it. Patches are usually small enough that they aren't a problem, +especially if compressed.

  • Distribution of copyrighted material, or even offers to distribute copyrighted +material WILL NOT be tolerated. The Bochs Project does not distribute +any software (disk images) in violation of the license agreement, and users who +do so will be warned first and then blocked from the list if it happens again. +As an open source project, we rely on donated services from Source Forge and +other groups, and we can't afford to put them or ourselves at risk of legal +action.

  • It is possible to subscribe and unsubscribe by email. If you do this, you must +write to bochs-announce-request or bochs-developers-request. Don't forget the +"-request" part or your subscribe message will go to 300+ people.


PrevHomeNext
bochs-cvs mailing listUpTips and Techniques
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mailinglist.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mailinglist.html new file mode 100644 index 0000000..237367b --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mailinglist.html @@ -0,0 +1,200 @@ + +Mailing Lists
Bochs User Manual
PrevNext

Chapter 7. Mailing Lists

The Bochs community uses three mailing lists to communicate, called +bochs-developers, bochs-cvs and bochs-announce.

7.1. bochs-developers mailing list

Bochs-developers is the forum for all Bochs discussions and questions. On +average, subscribers get between five and ten messages per day. There are +about 350 subscribers. If this sounds like too much email, maybe the bochs-announce list is more appropriate for +you. Anyone may join the list, unless they abuse it of course.

To subscribe, go to the Bochs-Developers Info Page and type your email +address and a password into the web form and click +Subscribe. In a few minutes you will get a confirmation +email. Follow the directions in the email to complete the subscription +process. To unsubscribe, go to the same +page and type your email address in the blank at the bottom and click +on Edit Options. Then type your password and click +Unsubscribe.

Once you have subscribed, you can write to +<bochs-developers@lists.sourceforge.net> to send a message to +everyone on the list. While it's possible to post without being a subscriber, +it's not recommended. If you aren't a subscriber, you might miss the response +to your question.

Archive of bochs-developers messages


PrevHomeNext
Text-mode is broken in some ancient DOS program bochs-announce mailing list
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mouse-toggle.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mouse-toggle.html new file mode 100644 index 0000000..5884825 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mouse-toggle.html @@ -0,0 +1,155 @@ + +Mouse behavior, enabling and disabling
Bochs User Manual
PrevChapter 6. Common problems and what to do about them (Troubleshooting)Next

6.2. Mouse behavior, enabling and disabling

Refer to Section 5.3.2 for information on how to enable or + disable the mouse inside of Bochs at run-time. +

Mouse behavior +


PrevHomeNext
Common problems and what to do about them (Troubleshooting)UpText-mode is broken in some ancient DOS program
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mtools.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mtools.html new file mode 100644 index 0000000..c92e957 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/mtools.html @@ -0,0 +1,156 @@ + +Use mtools to manipulate disk images
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.2. Use mtools to manipulate disk images

Mtools is a set of programs that can read, write, and format DOS disk images. +There are links to the Mtools main page and a Win32 port of Mtools on the +Bochs Links page, +under Resources.

The mtools web site has a detailed manual. If anyone wants to write +instructions specific to Bochs, we can add it right here.


PrevHomeNext
Tips and TechniquesUpBochs GNU/Linux DiskTools
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/release-notes.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/release-notes.html new file mode 100644 index 0000000..c330721 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/release-notes.html @@ -0,0 +1,147 @@ + +Release Notes
Bochs User Manual
PrevNext

Chapter 2. Release Notes

The change log is stored in the Bochs source code in a file called +CHANGES. Click here to see the latest version of the CHANGES file.

The link above is provided by Source Forge and might change one day. If it +stops working, you can download the current source code with CVS and read +the CHANGES file there.


PrevHomeNext
FAQ Installation
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/rom-images.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/rom-images.html new file mode 100644 index 0000000..e8da27f --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/rom-images.html @@ -0,0 +1,255 @@ + +ROM images
Bochs User Manual
PrevChapter 4. SetupNext

4.2. ROM images

Just like a real PC, Bochs needs a system BIOS and VGA BIOS to initialize the +machine when it powers on or after a hardware reset. Bochs needs to load them +from image file into the emulated memory. The Bochs package contains a set of +system BIOS and VGA BIOS images. +

Table 4-1. System and VGA BIOS images

FileDescription
BIOS-bochs-latest default ROM BIOS image for Bochs
BIOS-bochs-legacy ROM BIOS image without 32-bit init code (for i386 and ISA graphics card emulation)
bios.bin-1.7.5 SeaBIOS ROM image
VGABIOS-elpin-2.40 legacy VGA BIOS image for Bochs
VGABIOS-lgpl-latest LGPL'd VGA BIOS image for Bochs
VGABIOS-lgpl-latest-debug LGPL'd VGA BIOS image for Bochs with debug output to the logfile
VGABIOS-lgpl-latest-cirrus LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled
VGABIOS-lgpl-latest-cirrus-debug LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled and debug output to the logfile

Bochs must be set up to use system and VGA BIOS like this: +

  romimage: file=BIOS-bochs-latest, address=0xfffe0000
+  vgaromimage: file=VGABIOS-lgpl-latest
+We recommend to use the ROM images distributed with Bochs or one of the latest +SeaBIOS images. BIOS images designed +for real hardware mostly do not work properly. Please see the Section 4.3.8 +for more information.

Bochs supports optional ROM images to be loaded into the ISA ROM space, +typically between C8000 and EFFFF (see Section 4.3.10). The PCI +versions of the Bochs network adapter emulations support loading a boot ROM into +the PCI ROM space (see Section 4.3.34).


PrevHomeNext
SetupUpThe configuration file bochsrc
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/sb16-emulation.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/sb16-emulation.html new file mode 100644 index 0000000..ba6bb79 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/sb16-emulation.html @@ -0,0 +1,529 @@ + +Sound Blaster 16 Emulation
Bochs User Manual
PrevChapter 4. SetupNext

4.3. Sound Blaster 16 Emulation

This section is a detailed description for configuring Sound Blaster 16 from +source. If you have a binary and all you want to know is what to put in your +bochsrc file, see sb16 option.

Sound Blaster 16 (SB16) emulation for Bochs was written and donated by +Josef Drexler, who has a +web page on the topic. +The entire set of his SB16 patches have been integrated into +Bochs, however, so you can find everything you need here.

SB16 Emulation has been tested with several soundcards and versions of Linux. Please give +Josef feedback on +whether is does or doesn't work on your combination of software and hardware.

4.3.1. How well does it work?

Right now, MPU401 emulation is next to perfect. It supports UART +and SBMIDI mode, because the SB16's MPU401 ports can't do anything else as well.

The digital audio basically works, but the emulation is too slow for fluent +output unless the application doesn't do much in the background (or the +foreground, really). The sound tends to looping or crackle on slower +computer, but the emulation appears to be correct. Even a MOD +player works, although only for lower sampling speeds.

Also, the MIDI data running through the MPU401 ports can be written +into a SMF, that is the standard midi file. The wave output +can be written into a VOC file, which has a format defined by +Creative Labs. This file format can be converted to WAV by +sox for example.

4.3.2. Output to a sound card

Output is supported on Windows, Linux, FreeBSD, MacOS 9 and MacOSX at the moment.

On Linux, the output goes to any file or device. If you have a wavetable synthesizer, +midi can go to /dev/midi00, otherwise you may need +a midi interpreter. For example, the midid program from the DosEmu project would work. +Wave output should go to /dev/dsp. These devices +are assumed to be OSS devices, if they're not some of the ioctl's might fail.

On Windows, midi and (wave) output go to the midi mapper and the wave mapper, +respectively. A future version might have selectable output devices.

4.3.3. Installation on Linux

4.3.3.1. Prerequisites

A wavetable synthesizer on /dev/midi00 +and a working /dev/dsp if you want real +time music and sound, otherwise output to midi and wave files is also possible. +Optionally, you can use a software midi interpreter, such as the midid program +from the DosEmu project instead of /dev/midi00.

4.3.3.2. Configuring Bochs

You need to configure Bochs using the --enable-sb16 +option. +There are a few values in config.h that are relevant to the sound functions. +Edit config.h after running configure, but before compiling.

BX_USE_SB16_SMF should be 1 unless you intend to have several sound cards +running at the same time.

BX_USE_SOUND_VIRTUAL can be 0 or 1, and determines whether the output class +uses virtual functions or not. The former is more versatile and allows to +select the class at runtime (not supported at the moment), while the latter +is slightly faster.

BX_SOUND_OUTPUT_C is the name of the class used for output. The default is +to have no output functions, so you need to change this if you want any sound. +The following are supported at the moment:

        bx_sound_linux_c    for output to /dev/dsp and /dev/midi00 on Linux
+                            (and maybe other OSes that use the OSS driver)
+        bx_sound_windows_c  for output to the midi and wave mapper of
+                            Windows 3.1 and higher.
+        bx_sound_output_c   for no output at all.

Setup the SB16 emulation in your bochsrc, according to instructions +in that file (see sb16 option).

4.3.3.3. Runtime configuration

The source for the SB16CTRL program that is used to modify +the runtime behaviour of the SB16 emulation is included in +misc/sb16/. It is a C +program that can be run from inside the emulation.

It currently supports the following commands:

Table 4-5. Supported options for sb16ctl

OptionDescription
-i number Show the selected emulator info string, + e.g. sb16ctrl -i 3 to show how many patch translations are active. +
-t six numbers Load a translation into the translation table. The numbers are: + "OldBankMSB,OldBankLSB,OldProgram,NewBankMSB,NewBankLSB,NewProgram". + All values can be 0..127 or 255. 255 for "Old" values means match + any and for "New" values means don't change, + e.g. sb16ctrl -t 255,255,0,255,255,32 + to change patch 0 (Piano) to patch 32 (Acoustic Bass). +
-r Reset the patch translation table e.g. sb16ctrl -r. +
-m some numbers Upload the given numbers to the midi output device. Note + that it should be a complete midi message, and also that it is + subject to patch translation, + e.g. sb16ctrl -m 0x80,64,0 + to send a note-off message to channel 0. +
-f filename Read in a file and execute the commands in it. These have + the same format as the above commands, except that they don't have + the dash "-" in front of them. + Comment lines are supported and start with a hash sign "#". +
-h Show a brief summary of the commands. +

All numbers can be valid parameters to the strtol() function, so hex and +octal notation is fine. They have to be delimited by either commas "," or +slashes "/", spaces are not allowed.

The command line can have any number of commands. However, if none are given, +"-f -" is assumed, which means commands are taken from stdin.

4.3.4. Features planned for the future

  • Port it to more OS's, but I can't do this myself.

  • Finish the OPL3 FM emulation by translating the music to midi data.

4.3.5. Description of the sound output classes

You can find a description of the sound output classes and more details on +Sound Blaster 16 emulation in the +developer documentation.


PrevHomeNext
bochsrcUpHow to write your own keymap table
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/screensaver.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/screensaver.html new file mode 100644 index 0000000..3112700 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/screensaver.html @@ -0,0 +1,171 @@ + +Screen saver turns on too quickly
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.6. Screen saver turns on too quickly

One thing you may notice is that the screen saver turns on (screen goes +blank) very quickly after you have stopped typing. The reason is that Bochs +simulates everything as fast as it can. If the CPU is very busy (running +instructions nonstop), simulated time goes by slowly. If the CPU is idle (just +waiting for you to type, for example), simulated time speeds up dramatically. +In any case, if the screen saver blanks out the screen, just press a key (try +shift or control) to restore the screen.

There are two strategies to fix this problem. One is to increase the +ips parameter of the cpu option +in your configuration file. This will cause the simulation time +to pass more slowly. The other strategy is to enable the experimental +realtime PIT, which tries to keep Bochs in sync with real time. See the bochsrc +option clock.


PrevHomeNext
X Windows: Color allocation problemsUpMounting a disk image using the loop device
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/search-order.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/search-order.html new file mode 100644 index 0000000..cc1e596 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/search-order.html @@ -0,0 +1,198 @@ + +Search order for the configuration file
Bochs User Manual
PrevChapter 5. Using BochsNext

5.2. Search order for the configuration file

If no configuration file is specified on the command line and config file loading +is not disabled, Bochs searches for a default configuration file. This is the search order: +

  1. .bochsrc in the current directory

  2. bochsrc in the current directory

  3. bochsrc.txt in the current directory

  4. (win32 only) bochsrc.bxrc in the current directory

  5. (Unix only) .bochsrc in the user's home directory

  6. (Unix only) bochsrc in the /etc directory


PrevHomeNext
Using BochsUpThe configuration interface 'textconfig'
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/serial-port.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/serial-port.html new file mode 100644 index 0000000..9a25a2a --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/serial-port.html @@ -0,0 +1,420 @@ + +Using the serial port
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.13. Using the serial port

This section describes what is possible to do with Bochs serial port emulation. + These examples use dlxlinux disk image + (downloaded from + http://bochs.sourceforge.net/guestos/dlxlinux3.tar.gz + ) running as guest, on a debian x86 linux 2.4.19 host.

For the examples to work in dlxlinux, after you login as root, you will need to + kill the running gpm, as it grabs the serial port. +
Welcome to DLX V1.0 (C) 1995-96 Erich Boehm
+                    (C) 1995    Hannes Boehm
+
+
+dlx login: root
+Linux 1.3.89.
+dlx:~# ps | grep gpm
+   30  S0 S     0:00 /usr/bin/gpm -t bare
+   40   1 S     0:00 grep gpm
+dlx:~# kill -9 30
+dlx:~#

8.13.1. Logging serial port output to a file

The first example shows how to log information sent to the serial port + on the guest system into a file on the host system. +

Update the com1: section of your configuration file: +
com1: enabled=1, mode=file, dev=serial.txt
+        
+ After you've launch dlxlinux, everything sent to the serial port will be + logged to serial.txt : +
dlx:~# echo "logging to the serial port" > /dev/cua0
+        
+
host$ cat serial.txt
+logging to the serial port
+host$
+        
+

8.13.2. Interactivity : connecting to a virtual terminal

The second example shows how to connect to the guest OS, using a + virtual terminal on the host OS. +

First, you need to find an unused virtual terminal. Typically, + X uses vt7; vt8 and up are unused. On my system, I can + switch from X to vt9 by pressing ctrl-alt-f9 : this virtual + terminal is not used, the screen is all black. Pressing alt-f7 + switches back to X. +

Once you found an unused vt, update the com1: section of your + configuration file: +
com1: enabled=1, mode=term, dev=/dev/tty9
+        
+ The number must be set according to the terminal you want to use (here 9). +

Now, launch dlxlinux. After you log in as root and kill gpm, + enter the following command: +
dlx:~# /sbin/agetty 38400 cua0
+        
+ If you switch to vt9, you can see dlx welcome banner, and the login prompt: +
Welcome to DLX V1.0 (C) 1995-96 Erich Boehm
+                    (C) 1995    Hannes Boehm
+
+
+dlx login: 
+ Note that dlxlinux is configured so you can not login as root from a + serial port. If you want to login, you have to create a new user first. +

Also, if you plan to use this feature, the best would be to deactivate + gpm in /etc/rc.d/rc.local, and add a agetty line in /etc/inittab, + for example: +
T0:1234:respawn:/bin/agetty 38400 cua0
+

8.13.3. Interactivity : connecting to a pseudo terminal

The third example is very similar to the second one, except that we + connect to the guest OS with kermit as client, and we the connection + is done through a pseudo terminal. +

This example uses /dev/ptyp0 and /dev/ttyp0 as pseudo terminal pair. + We will tie Bochs to the controlling terminal, whereas kermit will + use the slave terminal. +

Update the com1: section of your configuration file: +
com1: enabled=1, mode=term, dev=/dev/ptyp0
+        
+ and lauch dlxlinux. After you log in as root, enter the command: +
dlx:~# /sbin/agetty 38400 cua0
+        
+ Then in the host OS, launch kermit : +
host$ kermit -l /dev/ttyp0
+C-Kermit 7.0.196, 1 Jan 2000, for Linux
+ Copyright (C) 1985, 2000,
+  Trustees of Columbia University in the City of New York.
+Type ? or HELP for help.
+(/tmp/) C-Kermit>connect
+Connecting to /dev/ttyp0, speed 0.
+The escape character is Ctrl-\ (ASCII 28, FS)
+Type the escape character followed by C to get back,
+or followed by ? to see other options.
+----------------------------------------------------
+
+Welcome to DLX V1.0 (C) 1995-96 Erich Boehm
+                    (C) 1995    Hannes Boehm
+
+
+dlx login: 
+        
+ The same comments as for example 2 apply here. +


PrevHomeNext
Using Bochs and the remote GDB stubUpBIOS Tips
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/setup.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/setup.html new file mode 100644 index 0000000..baf9ac7 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/setup.html @@ -0,0 +1,289 @@ + +Setup
Bochs User Manual
PrevNext

Chapter 4. Setup

4.1. What does Bochs need?

These are the minimum requirements for running an OS inside of Bochs: +

  • the Bochs executable

  • the BIOS image (usually called BIOS-bochs-latest)

  • the VGA BIOS image (e.g. VGABIOS-lgpl-latest or VGABIOS-elpin-2.40)

  • at least one bootable media, either as disk image (floppy, hard disk or CD-ROM) or physical disk (floppy or CD-ROM)

Note: Both VGA BIOS versions as well as the ROM BIOS are part of Bochs. No separate download is necessary.

Note: If you want to use the Cirrus SVGA adapter instead of VGA + Bochs VBE, you should +have a look at Section 8.17.

In that case you have to pass the configuration options on the command +line or to use the configuration interface to set up Bochs for the simulation. +Running Bochs is easier if you use a configuration file (we call it +bochsrc). See Section 4.2 for all supported options.

The easiest way to setup Bochs for the first time is to use the example configuration +file called bochsrc-sample.txt. Locate that file (location depends +on the (host) OS and on the installation facility used) and copy it to a location where +Bochs looks for that file, see Section 5.2.

The next step is to change the configuration so that it fits your needs: You most +likely want to setup a hard disk (see Section 8.19 and +Section 4.2.9), and install some OS on it using either +a set of floppy disks (see Section 4.2.7) or a CD-ROM +(see Section 4.2.9 again) as installation media. +Make sure you boot the emulation from the media you want, using the right setting +as boot option.

If your keyboard output inside of Bochs is wrong, you may also need a keymap file +to remap your keyboard layout to the U.S. layout. A set of keymap files for the +X window system and SDL (Linux port) is distributed with Bochs. If your +keyboard layout is not supported yet, you can create your own one by following the +instructions given in Section 4.4.

A collection of disk images of different operating systems can be found at +http://bochs.sourceforge.net/diskimages.html. Some disk +images are the size of a floppy disk (1 meg compressed) and others are gigantic +(160 meg compressed). If you want to create a disk image yourself, please see +Section 8.1.

This should be completed

  - (DONE )bochsrc, BIOS, VGABIOS, disk images.
+  - BIOS/VGABIOS, what do they do?
+  - disk images
+    - (DONE) where to find one pre-made
+    - grab one from a real hard disk


PrevHomeNext
Compiling Bochs bochsrc
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/smp.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/smp.html new file mode 100644 index 0000000..e930e85 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/smp.html @@ -0,0 +1,231 @@ + +Simulating a Symmetric Multiprocessor (SMP) Machine
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.8. Simulating a Symmetric Multiprocessor (SMP) Machine

Bochs can now simulate an SMP machine when you use "--enable-smp" in the +configure command. SMP support was added by Bryce Denney, who +was very interested in watching a multiprocessor operating system work +at a low level. It should also be helpful to operating system developers +who are writing SMP drivers, or just for users who want to test drive +an SMP machine to see what it looks like.

Starting with Bochs 2.2.6 you can set up the number of processors in the +bochsrc. See Section 4.2.2 how to +set up the number of processors.

It is important to understand that configuring bochs for 4 processors will NOT +make your single-threaded applications run faster in general! On the contrary, +it has to spend time simulating idle processors as well as the ones doing your +task. The point is to simulate an SMP system, not to speed up a uniprocessor +application.

What was required to make SMP work in Bochs? + +

  • local APIC on each processor with timer

  • one I/O APIC model

  • implement RDTSC (read time stamp counter)

  • a data structure called the Intel Multiprocessor Configuration +must be present in BIOS memory space. An SMP-aware operating system probes BIOS +memory to find the structure, which contains information about how many +processors, their IDs, interrupt sources, etc. Starting with Bochs 2.2.5 these +structures are dynamicly created by Bochs.

  • ACPI support is required to boot SMP system in most of modern +operating systems. For example WinXP 64 bit require ACPI support even for +single processor configuration. Still not supported by Bochs. (FIXME)

What needs to be done to improve SMP support? + +

  • debugger support is still limited. For example, you can set breakpoints, +but you can't specify which processor you want to set the breakpoint for.

  • test on any possible SMP operating systems. Currently success reported for +Knoppix 4.0.2 and WinNT 4.0 SMP.

  • several parts of the APIC model which weren't needed before are not +implemented yet and cause a panic. If you boot linux 2.4.3 for +example, it says "panic: cluster model addressing not implemented".

  • A number of people have suggested using threads to simulate each CPU in +a different thread. Then on a real SMP machine, the threads can execute +in parallel. This is a great idea, but it's not done at present.


PrevHomeNext
Mounting a disk image using the loop deviceUpSetting Up Networking in DLX Linux
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/supported-platforms.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/supported-platforms.html new file mode 100644 index 0000000..8618786 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/supported-platforms.html @@ -0,0 +1,295 @@ + +Supported Platforms
Bochs User Manual
PrevChapter 1. Introduction to BochsNext

1.8. Supported Platforms

The following table shows the supported platforms with a small description and +the available display libraries on these platforms. The display library is the +code that displays the Bochs VGA screen and handles keyboard and mouse events.

Table 1-2. Supported platforms

PlatformDescriptionDisplay Libraries
Unix/X11 X windows has always been well supported because it was + Kevin Lawton's main development platform. Bryce Denney maintains + the Unix/X11 platform now. Most features and fixes (not all) are + tried first in Unix and then ported to the others; see + Section 3.4 for compile instructions. + x, sdl, wx, term, rfb
Win32 This port was done by David Ross and is now maintained by + Don Becker. You can compile with Microsoft Visual C++ 5.0 or 6.0, + see Section 3.4.4 for compile instructions, + or Cygwin, see Section 3.4.5. + win32, sdl, wx, rfb
BeOS Kevin Lawton wrote this port, originally to R3/PPC using + CodeWarrior. It now works on R4/x86 with egcs. Simon Huet picked up + maintaining/reworking the BeOS GUI port. In September 2001, Bernd Korz + of Yellow Tab, Inc. + (www.yellowtab.com), took + over the BeOS/Zeta port, and is working on raw CD-ROM and raw floppy + support. For compiling, see Section 3.4.8. + beos, sdl
MacOS X Emmanuel Mailliard ported the Macintosh code to MacOS X with Carbon API. + Jeremy Parsons (Br'fin) has been maintaining the MacOS X port since + March 2002; see Section 3.4.7 for compile instructions. + carbon, x, rfb, sdl
Macintosh David Batterham + ported Bochs to the Mac. He compiled with CodeWarrior Pro R1 (CW12) + but has not had time to maintain the Mac port since early 2000. + If you have Mac development tools and want to contribute, contact + the bochs-developers mailing list; see Section 3.4.6 for + compile instructions. + macos
Amiga/MorphOS This port is written and maintained by Nicholai Benalal, see + Section 3.4.9 for compile instructions. + amigaos
OS/2 Nick Behnken used PE2LX to translate David Ross' Win32 + port to an OS/2 program. This hasn't been updated for a long time, + and Nick Behnken's page seems to be inactive. + Also, Craig Ballantyne ported Bochs to OS/2, but his web page has + disappeared and his port has not been updated since March 2000. + If you want to bring the OS/2 port up to date, contact the bochs-developers mailing list. + ???

PrevHomeNext
FeaturesUpFAQ
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/textconfig.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/textconfig.html new file mode 100644 index 0000000..792f9d5 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/textconfig.html @@ -0,0 +1,384 @@ + +The configuration interface 'textconfig'
Bochs User Manual
PrevChapter 5. Using BochsNext

5.3. The configuration interface 'textconfig'

The configuration interface 'textconfig' is the text mode version of the Bochs +configuration system. It is a series of menus (using stdin/stdout) that allows +you to edit all the settings that control Bochs' behavior. If you do not write +a config_interface line, Bochs will choose it as the default for you (unless Bochs +is compiled for wxWidgets only).

It consists of these three parts: +

  • the start menu

  • the headerbar buttons

  • the runtime configuration

5.3.1. The start menu

If you start Bochs without the quickstart argument (-q), the Bochs configuration +main menu appears: +
------------------------------
+Bochs Configuration: Main Menu
+------------------------------
+
+This is the Bochs Configuration Interface, where you can describe the
+machine that you want to simulate.  Bochs has already searched for a
+configuration file (typically called bochsrc.txt) and loaded it if it
+could be found.  When you are satisfied with the configuration, go
+ahead and start the simulation.
+
+You can also start bochs with the -q option to skip these menus.
+
+1. Restore factory default configuration
+2. Read options from...
+3. Edit options
+4. Save options to...
+5. Begin simulation
+6. Quit now
+
+Please choose one: [5]

Here you can load, edit and save the configuration and finally start the simulation. +It is possible to start Bochs without a config file and to edit all the settings using +the item "Edit options". Don't forget to save the configuration if you want to use this +setup for another Bochs session.

5.3.2. The Bochs headerbar

The headerbar appears on top of the Bochs simulation window. Here you can control the +behavoiur of Bochs at runtime if you click on one of these buttons: +

  • floppy buttons

    Here you can toggle the status of the floppy media (inserted/ejected). Bochs for + win32 presents you a small dialog box for changing the floppy image. You can + setup floppy drives using floppya/floppyb option.

  • cdrom button

    Here you can toggle the status of the cdrom media (inserted/ejected). CD-ROM drives + can be set up using ata(0-3)-master/-slave option.

  • mouse button

    Here you can enable the creation of mouse events by the host. Once mouse + events are captured, you cannot reach the button anymore, in order to disable + capturing again. In this case, use "Ctrl+3rd mouse button" to disable it.

    Support for 2 button mouse to toggle the capture mode not yet complete. + Some display libraries still don't support the new feature, but + it is already supported on X11, SDL, wxWidgets and Win32.

  • user button

    Press this button if you want to send the keyboard shortcut defined with the + user_shortcut option to the guest. + Depending on the used display_library option, + it may even be possible to edit the shortcut before sending it.

  • copy button

    The text mode screen text can be exported to the clipboard after pressing this +button. The button has no effect in graphics mode.

  • paste button

    Text in the clipboard can also be pasted, through Bochs, to the +guest OS, as simulated keystrokes. Keyboard mapping must be enabled to make this +feature work.

  • snapshot button

    Press this button if you want to save a snapshot of the text mode screen. +Bochs for win32 presents you a "Save as..." dialog box. All other platforms are +using the fixed filename "snapshot.txt".

  • config button

    This button stops the Bochs simulation and starts the runtime configuration. +(see below).

  • reset button

    Press this button to trigger a hardware reset.

  • power button

    This button stops the simulation and quits bochs.

Some of this features may not be implemented or work different on your host platform.

5.3.3. The runtime configuration

If you want to change certain settings at runtime, you have to press the "config" button in +the headerbar. The simulation stops and the runtime menu appears on the console window / xterm. +
---------------------
+Bochs Runtime Options
+---------------------
+1. Floppy disk 0: /dev/fd0, size=1.44M, inserted
+2. Floppy disk 1: floppyb.img, size=1.44M, inserted
+3. 1st CDROM: (master on ata1) /dev/cdrom, ejected
+4. 2nd CDROM: (slave on ata1) /dev/cdrecorder, ejected
+5. 3rd CDROM: (not present)
+6. 4th CDROM: (not present)
+7. (not implemented)
+8. Log options for all devices
+9. Log options for individual devices
+10. VGA Update Interval: 100000
+11. Mouse: disabled
+12. Keyboard paste delay: 100000
+13. Userbutton shortcut: ctrlaltdel
+14. Instruction tracing: off (doesn't exist yet)
+15. Continue simulation
+16. Quit now
+
+Please choose one:  [15] 

In the runtime configuration you can change the floppy/cdrom image or device, +change the log options or adjust some other settings. If you have trouble with +a specific device, you can change the log options for this device only to get +more information (e.g. report debug messages). This cannot be done in the configuration +file yet.


PrevHomeNext
Search order for the configuration fileUpSave and restore simulation
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/textmode-problems.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/textmode-problems.html new file mode 100644 index 0000000..2451867 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/textmode-problems.html @@ -0,0 +1,163 @@ + +Text-mode is broken in some ancient DOS program
Bochs User Manual
PrevChapter 6. Common problems and what to do about them (Troubleshooting)Next

6.3. Text-mode is broken in some ancient DOS program

If you are using a program written for DOS which seems to use the text-mode but + doesn't display the text properly, you can try the other VGA BIOS, either + VGABIOS-lgpl-latest or VGABIOS-elpin-2.40, + see the vgaromimage option. +

Maybe it is a bug in the LGPL VGA BIOS, but for now, it seems to work. +


PrevHomeNext
Mouse behavior, enabling and disablingUpMailing Lists
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/thirdparty.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/thirdparty.html new file mode 100644 index 0000000..d6eb46d --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/thirdparty.html @@ -0,0 +1,157 @@ + +Third Party Software Licensing and Temporary Files
Bochs User Manual
PrevChapter 1. Introduction to BochsNext

1.6. Third Party Software Licensing and Temporary Files

Before you install or use any Operating System, BIOS, or other software package +within the Bochs PC emulation environment, make sure you are and will be in +compliance with all the software licenses pertaining to the software you wish +to install. It is completely your responsibility to provide licenses and records +on all software that you install and/or use. It is also completely your responsibility to +maintain total compliance with all Software Licenses involved.

In the process of installing Software within the Bochs PC emulation environment, +it may be helpful or necessary to copy or convert files from the original distribution +format to a second format to facilitate the installation. You should delete +the intermediate files after installation, making certain that only the +original distribution files remain.


PrevHomeNext
Bochs LicenseUpFeatures
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/user.dbk b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/user.dbk new file mode 100644 index 0000000..ab91d4d --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/user.dbk @@ -0,0 +1,10367 @@ + + + + +%bochsdefs; + +]> + + + + Bochs User Manual + + KevinLawton + BryceDenney + N. DavidGuarneri + VolkerRuppert + ChristopheBothamy + MichaelCalabrese + StanislavShwartsman + + + + +Introduction to Bochs +
What is Bochs? + +Bochs is a program that simulates a complete Intel x86 computer. +It includes emulation of the Intel x86 CPU, common I/O devices, +and a custom BIOS. Bochs can be compiled to emulate many different +x86 CPUs, from early 386 to the most recent x86-64 Intel and AMD +processors which may even not reached the market yet. + +Bochs interprets every instruction from power-up to reboot, and has +device models for all of the standard PC peripherals: keyboard, mouse, +VGA card/monitor, disks, timer chips, network card, etc. Because Bochs +simulates the whole PC environment, the software running in the simulation +"believes" it is running on a real machine. This approach allows Bochs +to run a wide variety of software with no modification, include most popular +x86 operating systems: Windows 95/98/NT/2000/XP and Vista, all Linux flavors, +all BSD flavors, and more. + + + +Bochs is written in the C++ programming language, and is designed to run +on many different host platforms + +Since Bochs can run on one kind of machine and simulate another machine, we +have to be clear in our terminology to avoid confusion. The host platform is +the machine that runs the Bochs software. The guest platform is the operating +system and applications that Bochs is simulating. + +, including x86, PPC, Alpha, Sun, and MIPS. No matter what the +host platform is, Bochs still simulates x86 hardware. In other words, it +does not depend on the native instructions of the host machine at all. +This is both a strength and a weakness, and it's the major difference between +Bochs and many other x86 emulation software such as VirtualBox, VMware, etc. +Because Bochs uses software simulation for every single x86 instruction, it +can simulate a Windows application on an Alpha or Sun workstation. However, +the downside of Bochs' approach is simulation performance. To model the +processor accurately, Bochs must run many instructions for every simulated x86 +instruction, and this makes the simulated machine many times slower than +the physical machine. Commercial PC emulators (VMware, Connectix, etc.) can +achieve much high emulation speed using a technique called +virtualization + +Virtualization takes advantage of simulating x86 instructions on an +x86 machine, allowing large portions of the simulation to take place +at native hardware speed. Whenever the simulated machine talks to the +hardware or enters certain privileged modes (such as in kernel code), +the simulator typically takes control and simulates that code in +software at much slower speed, just like Bochs does. + +, but they are neither portable to non-x86 platforms nor open +source. + + + +To do anything interesting in the simulated machine, Bochs needs to interact +with the operating system on the host platform (the host OS). When you press a +key in the Bochs display window, a key event goes into the device model for the +keyboard. When the simulated machine needs to read from the simulated hard +disk, Bochs reads from a disk image file on the host machine. When the +simulated machine sends a network packet to the local network, Bochs uses the +host platform's network card to send the packet out into the real world. These +interactions between Bochs and the host operating system can be complicated, +and in some cases they are host platform specific. Sending a network packet in +FreeBSD requires different code than sending the packet in Windows XP, for +example. For this reason, certain features are supported on some host +platforms and not others. On GNU/Linux, Bochs can simulate a network card that +communicates with the world, but on MacOSX the simulated network card may not +work because the communication code between the device model and the MacOSX +operating system has not been written. + + + + + +Bochs was written by Kevin Lawton starting in 1994. It started as a program with a +commercial license, at the price of 25 USD, for use as-is. If a user needed to link +it to other software, that user would have to negotiate a special license. +&NEEDHELP; + +We need a Bochs historian to help out here. For background, it would be +interesting to know how much Bochs sources used to cost and what it was used for. +I thought I saw an interview out there somewhere where Kevin says why he started +it and some more background information. + + Finally, in March 2000, MandrakeSoft (now called +Mandriva) bought Bochs +and made it open source under the GNU LGPL. + + +In March 2001, Kevin helped a few developers to move all Bochs activities from +bochs.com to a new site at . Since then the Bochs project +has settled into its new home, and around release times has even hit #1 most +active project of the week at SourceForge. + +
+ +
Who uses Bochs? + It is hard to estimate how many people have tried Bochs or use it on a +regular basis, but a few statistics give an indication. The &devlist;, +which is the primary source of news on bugs and releases, has over 400 +subscribers. The latest version has been downloaded over 150,000 times +from SourceForge, not counting any mirror website or SVN users. + + + +Bochs has many possible uses, and different people use it for different +things. Many people use it to run applications in a second operating system +without needing two different computers or dual-booting. Running +Windows software on a non-x86 workstation or on an x86 Unix box are common +uses. Also, because every hardware instruction and every line of simulator +code is accessible, Bochs is used extensively for debugging new operating +systems. If you were writing boot code for your home-brewed +x86 operating system and it didn't work right, booting it in Bochs could +give you great visibility into what is really going on. The Bochs +debugger lets you simulate quickly or slowly, pausing whenever you want +to look at the contents of memory or the CPU registers. Or, if you +wanted to study which parts of a program take the most time, you could use +Bochs to measure how often certain pieces of the code were executed. + + + +Bochs has been used as a teaching tool in Operating Systems classes, in which +students used and modified it to learn how the PC hardware works. As a final +project the students had to add a new peripheral device, so they had to learn +all about I/O ports, interrupts, and device drivers. In industry, it is used +to support legacy applications on modern hardware, and as a reference model +when testing new x86-compatible hardware. + + + +There may be as many uses of Bochs as there are users. Do you want to run +your old DOS games? Or learn how to program under GNU/Linux, without leaving your +Windows desktop? Or reverse engineer your printer driver? You decide. + + +
+ + +
Is Bochs right for me? + +Bochs is very useful for some applications, and not well suited to others. +This section tries to answer the question, "Is Bochs right for me?" + + +Bochs may or may not be right for you, depending on what it is you want to do. +Perhaps all you want to do is run one or two applications native to Microsoft Windows +on GNU/Linux, or vice-versa. Perhaps your biggest concern is speed and performance. +Maybe you don't mind tweaking a few files here and there when you want another application +to work in that setting. +In cases where the objective is to simulate x86 hardware on an x86, VirtualBox, Wine, and +VMware might be your best options. + + +On the other hand, perhaps you have a vital application running on an older operating +system that only runs well on old hardware. You are concerned that the life cycle of +this hardware is coming to an end, and your backup and restoration hardware and tools +no longer suffice for the amount of data that you have. You need to transfer backup +disk images over a network, and want to use modern procedures for hardware maintenance. +Perhaps the application is important enough to run on a larger computer, such as a +64-bit machine, or even a mainframe. Bochs would be an excellent option in such a scenario. + + + +Perhaps your objective is to debug software or hardware drivers. Bochs offers a controlled +environment that can better assist you in determining cause and effect relationships. +You can take snapshots that show you what is going on behind the scenes. +You can isolate the line that caused that crash. You can have multiple +images and compare them under a microscope. +In these situation, Bochs could save you time and resources. + + + +Information Technology changes faster than any other field. +It is very easy to forget transitional software that came and went. +But history is important to all fields, and to build on the future, +it is important to understand the past. Computer programmers, however, +do not have the same advantage as an architect, who can, for example, +take a trip to Greece and touch a pillar. Much of the history of Computer +Science is left on corroding floppies and malfunctioning hardware. +Bochs gives you the benefit of having one or more complete environments +where you can understand firsthand the behavior of operating systems and +programs. This cannot be achieved with an "emulator" such as Wine. + + +
+ +
Will it work for me? + + +Whether Bochs works for you depends on your host hardware, host operating +system, guest operating system, guest software, and your ability to work in +a command-line environment using documentation. There is no wizard to help +you through the setup process. You do not get a recovery or installation +disk to assist you in the process of installing a guest operating system. +Bochs only provides you with the "virtual hardware", and it is up to you to do the rest. + + +Bochs will run on Windows, GNU/Linux, FreeBSD, OpenBSD, or MacOSX. +If you are running on x86 hardware, you have a range of choices. +Check the installation section for your host platform to see what options +Bochs supports on your platform. If the most important factor is speed, +you may want to try a virtualization product instead of Bochs (VMware, VirtualBox, QEMU). + + + +If you are using a non-x86 machine, then Bochs is one of the few choices for +running x86 software. Bochs has been known to work on Solaris (Sparc), +GNU/Linux (PowerPC/Alpha), MacOS (PowerPC), IRIX (MIPS), Digital Unix (Alpha), +and AIX (PowerPC). + + + +You can also find more detailed testing information on the testing +status page on the &bochswebsite;. + + + +
+ +
Bochs License + +Bochs is copyrighted by MandrakeSoft S.A. + +Mandriva has a web site at +http://mandriva.com + + +and distributed under the +GNU Lesser General Public License + +Complete text of the GNU LGPL is included with the source code in a file +called COPYING, and is also here. + +. The following text appears at the +top of every source code file released under the LGPL in the Bochs distribution: + +Parts of Bochs have specific licenses which are compatible with the +GNU Lesser General Public License. Hence each source file contains its +own licensing information. + + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + + + +
+ +
Third Party Software Licensing and Temporary Files + + +Before you install or use any Operating System, BIOS, or other software package +within the Bochs PC emulation environment, make sure you are and will be in +compliance with all the software licenses pertaining to the software you wish +to install. It is completely your responsibility to provide licenses and records +on all software that you install and/or use. It is also completely your responsibility to +maintain total compliance with all Software Licenses involved. + + + +In the process of installing Software within the Bochs PC emulation environment, +it may be helpful or necessary to copy or convert files from the original distribution +format to a second format to facilitate the installation. You should delete +the intermediate files after installation, making certain that only the +original distribution files remain. + + + +
+ +
Features + +The following table shows the features of Bochs and which platforms they +currently work with. + +Bochs Features + + + + Feature + Supported? + Description + + + + + configure script + Yes + Bochs uses GNU autoconf to configure Makefiles and headers. + Autoconf helps Bochs to compile on a wide variety of platforms. + + + + 386,486,Pentium Emulation + Yes + Bochs can be configured to emulate one of several families of Intel hardware. Some Pentium features are incomplete, such as SMM (System Management Mode). + + + P6 and later CPU Emulation + Yes + Bochs can be configured to emulate any P6 family processor including optional MMX and SSEx instructions. + + + + x86-64 Extensions Emulation + Yes + Bochs can be configured to emulate x86-64 with many recent Intel and AMD extensions. + + + Command Line Debugger + Yes + Powerful command line debugger (optional) that lets you stop + execution and examine registers and memory, set breakpoints, etc. + + + + GUI Debugger + Yes + Chourdakis Michael and Bruce Ewing contributed very powerful GUI frontend for Bochs internal debugger. + GUI debugger frontend is supported for Win32 and GTK2 hosts. + + + + Floating Point + Yes + Uses software floating point engine based on SoftFloat floating point emulation library. + + + + Enhanced BIOS + Yes + Implements ElTorito, EDD v3.0, basic APM feature, PCIBIOS features + and the PCI interrupt routing table. The latest version of the Bochs BIOS + has a 32-bit init for ACPI, SMM and SMP. Bochs also known to work with recent + SeaBIOS images. + + + + VGA + Yes + VGA color graphics emulation in a window. + + + + VBE (VESA) Support + Yes + Currently resolutions up to 2560x1600x32bpp are supported. + You must enable VBE with the VGA extension option and use the LGPL'd VGABIOS. + For more information see . + + + + Cirrus Logic video card + Yes + Cirrus Logic CL-GD5430 ISA or CL-GD5446 PCI video card support. + For more information see . + + + 3D video card + Yes + Some of the 3dfx Voodoo graphics adapter models are supported now. + The code is still experimental, but at least the Voodoo1 is known to work. + For more information see . + + + Plug&play monitor + Yes + VESA DDC is now supported by all VGA compatible display adapters. + The LGPL'd VGABIOS has been updated use this feature for both the VBE and + Cirrus version. The interface reports a plug&play monitor called + "Bochs Screen". + + + + Floppy disk + Yes + Supports floppy disk images on all platforms: 2.88M 3.5", 1.44M 3.5", 1.2M 5.25", + 720K 3.5" and 360K 5.25". On Unix and Windows NT/2000/XP, Bochs can access the + physical floppy drive. It is also possible to use a local directory as VFAT media + (1.44M only). + + + + Multiple ATA channels + Yes + Emulates up to 4 ATA channels. Up to 8 ATA/ATAPI emulated devices can be attached, + two per ATA channel. + So you can have eight hard disks or seven hard disks and a CD-ROM or four hard + disks and four CD-ROMs, or one hard disk and seven CD-ROMs, etc... + + + + Hard disk + Yes + Emulates ATA-6/IDE hard drives via image files. Physical + hard disk access is supported on some architecture, but NOT recommended, primarily for safety reasons. + With LBA48 support, hard disks up to 255TB are supported, on any platform that support large files access. + It is also possible to use a local directory as VFAT drive. + + + + CD-ROM + Yes + Emulates ATAPI-4/IDE CD-ROM. The CD-ROMs can read from an ISO disk image + on any platform. On Windows (NT/2000/XP/Vista), Linux, SunOS, FreeBSD, + NetBSD, OpenBSD, Amiga/MorphOS and MacOSX, Bochs can read from the + physical CD-ROM drive. The Bochs BIOS supports booting from the first CD-ROM drive. + + + + Keyboard + Yes + Emulates a PS/2 keyboard with North American key mappings. Optional keyboard layout + remapping files are provided to support localized keyboard in X11 (Belgian, Danish, French, + German, Italian, Russian, Slovenian, Spanish, Swedish, U.K.) and SDL/SDL2 + (German). + + + + Mouse + Yes + Emulates a serial, PS/2, bus or USB mouse with 3 buttons + optional mouse + wheel support. There is also a USB tablet emulation available. + + + + Sound card + Yes + Emulates a Sound Blaster 16 card (ISA, no plug&play) or an + ES1370 PCI card. The SB16 emulation provides wave input / output, the OPL3 + chip, the external MIDI port and volume control for wave and FM. The ES1370 + provides wave input / output, the MIDI UART port and volume control for + wave output. On Windows, Linux, FreeBSD, MacOS 9, MacOSX and all platforms + supported by SDL, the output can be sent to the host computer's sound + system. For the SB16, see the developer documentation + for details. + + + + Network card + Yes + Emulates an NE2000 compatible network card (ISA / PCI) or an Intel(R) + 82540EM Gigabit Ethernet adapter (PCI). On Windows NT/2000, Linux, FreeBSD, + and NetBSD, Bochs will forward packets to and from the + operating system so that the guest OS can talk on the physical network. + Unfortunately, on some platforms the guest OS can talk to any machine on + the network BUT NOT the host machine. On Windows and on systems that + allow the TAP or TUN/TAP interface, there is no such limitation. Often + the host machine may be configured so the guest OS has access to the + internet. On MacOSX, you may download the TUN driver from: + + + + + Parallel Port + Yes + Parallel port emulation was added by Volker Ruppert for Bochs 1.3. + Data that is sent to the parallel port by the guest OS can be saved into a + file or sent directly into the parallel port device (Unix only). + + + + Serial Port + Yes + The serial port (16550A UART emulation) is usable, on GNU/Linux, + NetBSD, OpenBSD, FreeBSD and MacOSX as host and guest. On other OSes the + emulation is present, but the connection to hard- or software of the host is + not implemented yet. Up to 4 ports are available. + + + + Gameport + Yes + Emulates a standard PC gameport. The connection to a real joystick is + currently supported on Linux and win32 only. + + + + PCI + Yes + Emulates most of the i430FX, i440FX or i440BX PCI chipset. + The Host-to-PCI bridge, the PCI-to-ISA bridge and the PCI IDE controller + (PIIX3/PIIX4) are available. For PCI cards there are 5 PCI slots supported. + ACPI and HPET features are also available. The i440BX chipset has basic + support for AGP. + + + + USB + Yes + Four types of host controllers (UHCI, OHCI, EHCI and xHCI) and the + devices 'mouse', 'tablet', 'keypad', 'disk', 'cdrom', 'floppy, ''hub' and + 'printer' are available. Plugging in and removing devices at runtime is + possible. Access to real hardware is not implemented yet. + + + + Plugins + Yes + Compiling gui and devices as plugins is supported on Linux, MacOS X, + Solaris, Cygwin, MinGW/MSYS, MSVC nmake and the VS2013 IDE (workspace provided). + + + + PIC + Yes + Master and slave programmable interrupt controller. + + + + CMOS functions + Yes + Real time clock (RTC) and CMOS RAM are available + + + Dynamic Translation/Virtualization + No + Because Bochs is designed to be portable, it does not attempt + to do any dynamic code translation or virtualization. See + for details. + + + + Simulate a Multiprocessor + Yes + Bochs can be configured to simulate up to 254 processor threads. This + feature is still experimental, but it can boot several Linux or Windows guests + with SMP support. Please note that this does NOT mean that Bochs can run + faster on a physical SMP machine. + + + + Take advantage of your SMP box + Minimal + At present, Bochs only uses threads in the lowlevel sound output + code. The simulation itself uses only one thread, so it will not run any + faster on multiprocessor hardware. + + + + Copy and Paste + Yes + Depending on the host platform, the text-mode screen text can be + exported to the clipboard. Text in the clipboard can also be pasted, through + Bochs, to the guest OS, as simulated keystrokes. + + + + +
+
+ +
Supported Platforms + +The following table shows the supported platforms with a small description and +the available display libraries on these platforms. The display library is the +code that displays the Bochs VGA screen and handles keyboard and mouse events. + +Supported platforms + + + + Platform + Description + Display Libraries + + + + + + Unix/X11 + + X windows has always been well supported because it was + Kevin Lawton's main development platform. Bryce Denney maintains + the Unix/X11 platform now. Most features and fixes (not all) are + tried first in Unix and then ported to the others; see + for compile instructions. + + x, sdl, sdl2, wx, term, rfb, vncsrv + + + + Win32 + + This port was done by David Ross and is now maintained by + Don Becker. You can compile with Microsoft Visual C++, + see for compile instructions, + or Cygwin, see . + + win32, sdl, sdl2, wx, rfb + + + + MacOS X + + Emmanuel Mailliard ported the Macintosh code to MacOS X with Carbon API. + Jeremy Parsons (Br'fin) has been maintaining the MacOS X port since + March 2002; see for compile instructions. + + carbon, x, rfb, sdl, sdl2 + + + + PowerPC-Macintosh + + David Batterham + ported Bochs to the Mac. He compiled with CodeWarrior Pro R1 (CW12) + but has not had time to maintain the Mac port since early 2000. + If you have Mac development tools and want to contribute, contact + the &devlist;; see for + compile instructions. + + macos + + + + Amiga/MorphOS + + This port is written and maintained by Nicholai Benalal, see + for compile instructions. + + amigaos + + + + +
+
+ +
FAQ + + + + Is Bochs Open Source? + + + + Yes! Bochs is released under the GNU LGPL, + much thanks to MandrakeSoft (now called Mandriva). + + + + + + + How do you pronounce "Bochs"? + + + + Phonetically the same as the English word "box". It's just a play on the word "box", since techies like to call their machines a "Linux box", "Windows box", ... Bochs emulates a box inside a box. + + + + + + + Who is the author of Bochs? + + + + Kevin Lawton is the primary author of Bochs. There have been bug fixes, + enhancements, and code contributions from some few hundred people, so + it is not possible to list them all. Later, Kevin had been working on a + PC virtualization project called plex86. In Fall 2002, he + made contributed some major CPU speedups and helped with integration + and debugging of the x86-64 emulation code. + + + + + + + Who maintains Bochs now? + + + With Kevin's help, in April 2001, the members of the &devlist; + set up a new official Bochs site hosted by Source Forge. + The admins on this project are Greg Alexander, Don Becker, Christophe Bothamy, + Bryce Denney, Volker Ruppert and Stanislav Shwartsman. + + + + + + Tell me about performance when running Bochs. + + + Because Bochs emulates every x86 instruction and all the devices in a PC + system, it does not reach high emulation speeds. Users who have an x86 + processor and want the highest emulation speeds may want to consider PC + virtualization software such as Vmware or VirtualBox (free software). + Another related project is QEMU. + + + + + + Does Bochs use a disk partition to install the OS? + + + No. It uses a disk image file, which is simply a large file, like any other file, on your platform's disk. + + + + + + Why can't I use Bochs with my current WinXP installation? + + + Think about this. If you had two different PC's, they would require different + hardware drivers. So you may not be able to safely move a disk drive with WinXP + on it, from one to the other. Bochs is no different. It emulates a certain set + of hardware devices, and requires each OS be configured for those devices. + + + + + + Is there a developer's email list for Bochs? + + + Yes. For instructions on joining, refer to + . + + + + + + Is there an IRC channel for Bochs? + + + Yes. You will usually find Bochs developers and users on IRC at irc.freenode.net:6667, channel #bochs. + + + + + + Do you know of any snapshots of Bochs running Windows? + + + Yes! Look for "Screen Shots" on &bochs-sf-net; or on other Bochs sites. + + + + + + Does Bochs support a CD-ROM? + + + Yes, the CD-ROM emulation and accessing ISO files is always available. + Reading from host CD-ROM media is supported in Linux, Windows, and most + BSDs. The CD-ROM drivers for Bochs allow the guest operating system to + access the host operating system's CD-ROM data directly. + + + + + + Does Bochs support a sound device? + + + Yes, Bochs emulates a Sound Blaster 16 card (ISA, no plug&play) or + an ES1370 PCI. Output to the host sound system is implemented for some + platforms. See for details. + + + + + + Does Bochs support a network card? + + + Yes. Bochs emulates an NE2000 compatible network card (ISA / PCI) or an + Intel(R) 82540EM Gigabit Ethernet adapter (PCI). Using the host's network + capabilities is not supported on all platforms. See + for details. + + + + + + What applications are known to run inside of Bochs? + + + Well, lot's of different OS's run inside of Bochs, so + thousands. I'm assuming you are asking about Windows programs. + To give you a few, the following ones from the Winstone'98 tests + worked: Access 97, CorelDRAW! 7, Excel 97, Lotus 1-2-3 97, Word 97, + PowerPoint 97, Quattro Pro 7, WordPerfect 7. + + Also, I've compiled an entire OS kernel inside Bochs before. + Not to mention, running DOOM, though at then-pathetic speeds. + + + + + + I am new to Bochs, how do I start? + + + You should read first. Next, you can check + if there specific instructions on how to install your (guest) OS inside of Bochs. + + + + + + Does Bochs run on my mobile device? + + + Bochs has now minimal support for the Android platform using a special + version of the SDL library. There are some external projects that use + the offical sources with some modifications. They also offer a gui + for easy Bochs configuration. Other mobile platforms are not officially + supported yet. + + + + + + +
+ +
+ + +Release Notes + + +The change log is stored in the Bochs source code in a file called +CHANGES. Click here +to see the latest version of the CHANGES file. + + +The link above is provided by Source Forge and might change one day. If it +stops working, you can download the current source code with SVN and read +the CHANGES file there. + + + + + + + + +Installation + +
Downloading Bochs + + +You can download Bochs from our web site at &bochs-sf-net;. First, you +need to choose what version to get: a recent release or a development +version. If you trying to get things working for the first time, a release +version is recommended since it has been tested the most. The development +versions (sometimes called SVN snapshots) may have some newer bug fixes and +new features, but have not been tested as much as the releases. + + + +Second, you can choose to compile Bochs from source code or install a binary +(if one is available for your platform). Binary packages will be quicker to +install, and most include a small demo of a guest operating system called DLX +Linux to get you started. However, some features can only be enabled if you +compile Bochs yourself, for example the Bochs debugger. For multiuser systems, +you will probably need system administrator privileges (root) to install a +binary package. If you decide to get a binary, download it to your hard disk, +uncompress it, then go to the section called Installing a Binary for more information. + + + +If you are going to compile Bochs yourself, you need the gzipped tarball +containing the source code, called +bochs-version.tar.gz. For +Windows and Mac, the prebuilt Makefiles are separate, so also get +the Makefiles for your platform. To unpack a compressed TAR file + +A TAR file is a single file that contains many files packed inside. Bochs +TAR files are compressed with a program called gzip, and another program +called gunzip is used to uncompress them. + + on a Unix machine + +On Windows, look for software called WinZip to unpack the TAR. + + +, type + + gunzip -c bochs-version.tar.gz | tar -xvf - + +This creates a directory called +bochs-version full of +files. This directory will be referred to as &bochsdir;. Go into +&bochsdir; and you are ready to compile. Instructions for compiling +Bochs are in the section, Compiling Bochs. + + + +Alternatively, you can also obtain the sources for any Bochs version using SVN. +See the SVN instructions for details. + +
+ +
Tracking the source code with SVN + +SVN (Subversion) is a tool used by many software developers to manage changes +within their source code tree. SVN provides the means to store not only the +current version of a piece of source code, but a record of all changes (and who +made those changes) that have occurred to that source code. Use of SVN is +particularly common on projects with multiple developers, since SVN ensures +changes made by one developer are not accidentally removed when another +developer posts their changes to the source tree. The Bochs source code and +documentation are available using SVN + +You can download SVN software and documentation from +subversion.apache.org. + +. + + +
Checking out Bochs + +When you have SVN installed, the first step is to do a checkout. The initial +checkout command is long and ugly, but usually you only have to do it +once. The example below shows the SVN checkout process of the Bochs trunk in Unix. +On the Windows platform, you can download a SVN client from +subversion.apache.org, +or use SVN within Cygwin + +Cygwin is an open source Unix-like environment for Windows platforms, +available at www.cygwin.com. + +. + +
Checking out Bochs in SVN + + user$ svn co http://svn.code.sf.net/p/bochs/code/trunk/bochs bochs + A bochs/ltdl.c + A bochs/Makefile.in + A bochs/bochs.h + . + . (This might take a few minutes, depending on your network connection.) + . + A bochs/install.sh + U bochs + Checkout, Revision 10754. + user$ cd bochs + user$ ls + aclocal.m4 cpu logio.cc pc_system.cc + bios cpudb.h ltdl.c pc_system.h + bochs.h crc.cc ltdlconf.h.in plugin.cc + build disasm ltdl.h plugin.h + bx_debug doc ltmain.sh README + bxversion.h.in docs-html main.cc README-plugins + bxversion.rc.in extplugin.h Makefile.in README.rfb + CHANGES fpu memory README-wxWindows + config.cc gdbstub.cc misc TESTFORM.txt + config.guess gui msrs.def TODO + config.h.in host osdep.cc win32_enh_dbg.rc + config.sub install-sh osdep.h win32res.rc + configure instrument param_names.h wxbochs.rc + configure.in iodev PARAM_TREE.txt + COPYING load32bitOShack.cc patches + user$ _ + +
+
+ + + This is just an example output of a checkout of specific version of the Bochs + trunk and folder. Depending on the checkout command and revision, you most + likely will see more/other files. + + + + +If you have write access to the Bochs SVN tree, see the Developers Guide + + +See the Developers Guide +and/or look at +SourceForge's Subversion documentation, +for instructions. + + for details. + + + + +The SVN checkout process (above) gives you a directory called bochs +that contains the very latest source code. I will refer to this directory +as &bochsdir;. In this directory there's also a subdirectory called ".svn" +which tells the SVN software where the code was checked out, what version +you have, and where to go for future updates. + +
+ +
Getting the Latest Version + +Most developers use SVN to always give them the latest source code. The minute +that any developer checks in a change, they are available to everyone else +through SVN. You just have to type svn update in the +&bochsdir; directory, and SVN will retrieve any files and directories that have +been changed since you did a checkout. If you update regularly, each update +takes a short time because it downloads only the files that changed. +See also Getting a release version. + + + +The svn update command tells you if any new files have +been downloaded from the server, and it also tells you if you have modified any +of the SVN-controlled files. As it checks through the source directories, it +will list files that have changed, with a single letter before the name that +tells the status of that file. The most common status letters are listed +below. + + +Status letters in a SVN update + + + + Letter + Meaning + Description + + + + + ? + unknown + + This file is in your bochs directory, but SVN does not know anything + about it. For example, when you compile Bochs, any files created + during the build process appear as ?. + + + + U + update + + SVN downloaded a new version of this file because it changed on the + server, usually because someone else did a checkin. + + + + A + added + + SVN downloaded a newly added file from the server. + + + + D + deleted + + This file has been deleted on the server and SVN removed it from your + local copy. + + + + C + conflict + + You have changed this file on your disk, but this change conflicts with + a change that was checked in. Conflicts occur when two people change + the same line of code in different ways. You need to edit the + conflicting file(s) and clean it up by hand. Or, sometimes it's + easiest to discard your own edits and download a fresh copy, by + deleting the conflicting file and running svn update again. + + + + +
+
+ +
+ +
Getting a Release Version + +You can also use the SVN checkout command to get the Bochs source code for +any release since March 2000. The command is + + user$ svn co http://svn.code.sf.net/p/bochs/code/tags/tagname/bochs bochs + +The tagname tells which release you want, and it can be one of the following: + + +Bochs Release Tags + + + + Bochs version + Release tag for SVN + SVN revision + + + + + 2.6.10 (intermediate) + REL_2_6_10_FINAL + 13629 + + + 2.6.9 (intermediate) + REL_2_6_9_FINAL + 13181 + + + 2.6.8 (intermediate) + REL_2_6_8_FINAL + 12740 + + + 2.6.7 (intermediate) + REL_2_6_7_FINAL + 12531 + + + 2.6.6 (bugfix) + REL_2_6_6_FINAL + 12375 + + + 2.6.5 (intermediate) + REL_2_6_5_FINAL + 12349 + + + 2.6.2 (bugfix) + REL_2_6_2_FINAL + 11694 + + + 2.6.1 (intermediate) + REL_2_6_1_FINAL + 11667 + + + 2.6 + REL_2_6_FINAL + 11395 + + + 2.5.1 (bugfix) + REL_2_5_1_FINAL + 10946 + + + 2.5 + REL_2_5_FINAL + 10801 + + + 2.4.6 + REL_2_4_6_FINAL + 10202 + + + 2.4.5 + REL_2_4_5_FINAL + 9914 + + + 2.4.2 + REL_2_4_2_FINAL + 9568 + + + 2.4.1 + REL_2_4_1_FINAL + 9368 + + + 2.4 + REL_2_4_FINAL + 9289 + + + 2.3.7 + REL_2_3_7_FINAL + 8537 + + + 2.3.6 + REL_2_3_6_FINAL + 8111 + + + 2.3.5 + REL_2_3_5_FINAL + 7840 + + + 2.3 + REL_2_3_FINAL + 7538 + + + 2.2.6 (intermediate2) + REL_2_2_6_FINAL + 7060 + + + 2.2.5 (intermediate1) + REL_2_2_5_FINAL + 6942 + + + 2.2.1 (bugfix1) + REL_2_2_1_FINAL + 6624 + + + 2.2 + REL_2_2_FINAL + 6476 + + + 2.1.1 (bugfix1) + REL_2_1_1_FINAL + 5560 + + + 2.1 + REL_2_1_FINAL + 5441 + + + 2.0.2 (bugfix2) + REL_2_0_2_FINAL + 4592 + + + 2.0.1 (bugfix1) + REL_2_0_1_FINAL + 4491 + + + 2.0 + REL_2_0_FINAL + 4409 + + + 1.4.1 (bugfix1) + REL_1_4_1_FINAL + 2513 + + + 1.4 + REL_1_4_FINAL + 2235 + + + 1.3 + REL_1_3_FINAL + 1705 + + + 1.2.1 (bugfix1) + REL_1_2_1_FINAL + 912 + + + 1.2 + REL_1_2_FINAL + 797 + + + 1.1.2 (bugfix3) + REL_1_1_2_BASE + 510 + + + 1.1.1 (bugfix2) + REL_1_1_1_BASE + 57 + + + 1.1 (bugfix1) + REL_1_1_BASE + 51 + + + 1.0 (bochs-2000_0325a) + REL-bochs-2000-03-25 + 7 + + + +
+ +
+ +
+ +
More about SVN + +Entire books have been written on SVN, so there's no sense in duplicating +it all here in the Bochs documentation. Some sources of additional +information are listed below. + + +The subversion.apache.org +site has tons of SVN FAQs and documentation. + +A German SVN FAQ +is available at University of Muenster. + + + +
+ + +
+ + +
Installing a Binary + + +This section is divided up by platform, since installing a binary package +is different on different platforms. + + +
Windows + +The Bochs binaries for Windows are distributed in an EXE installer package. +The Bochs installer can be started like any other Windows program and it brings +up the installation wizard. Here you can select the destination folder and the +installation options. The wizard installs the files and creates the registry +keys, start menu and desktop links. + + +Previous releases of Bochs were distributed as ZIP packages, too. These packages +contained the same set of files as the installer package from the same version. + + +If you are new to Bochs you should try out the DLX Linux demo distributed with +Bochs. The installation wizard has created a link on the desktop if you decided +to install the demo. If you doubleclick the icon two windows will appear: +one is the Bochs Display window, and the other is text window that is used for +the runtime configuration and for log messages if no logfile is specified. + + +You can find more information on the DLX Linux demo in the next section below the +DLX Linux screenshot. + + +Files in Bochs directory (Windows version) + + File Description + + + +bios.bin-1.13.0 SeaBIOS ROM image +BIOS-bochs-latest default ROM BIOS image for Bochs +BIOS-bochs-legacy ROM BIOS image without 32-bit init code +bochsdbg.exe the main Bochs executable with debugger enabled +bochs.exe the main Bochs executable +bochs.ico the Bochs icon (used for links in start menu and on the desktop) +bochsrc-sample.txt sample Bochs configuration file +bxhub.exe utility required for the 'socket' networking module +bximage.exe tool for manipulating disk images +CHANGES.txt what has changed between versions +COPYING.txt copy of the LGPL license +lgban.ico a set of Bochs icons in different sizes +LICENSE.txt Bochs license information +logo.ico another set of Bochs icons +niclist.exe tool to find out the network interface name +penguin.ico icons for the DLX Linux link +README.txt the read-me file from the source distribution. +sb16ctrl.exe tool to control sb16 in Bochs +sb16ctrl.txt examples of sb16ctrl commands +SeaBIOS-README.txt README for SeaBIOS ROM image +SeaVGABIOS-README.txt README for SeaVGABIOS ROM image +slirp.conf sample config file for the advanced 'slirp' network configuration +TODO.txt the TODO file from the source distribution. +unbochs.ico icon for the uninstaller link +uninstall.exe uninstall program for Bochs (created by the installation wizard) +vgabios-cirrus.bin-1.13.0 SeaVGABIOS ROM image (for Cirrus adapter) +VGABIOS-elpin-2.40 VGA BIOS image for Bochs +VGABIOS-elpin-LICENSE.txt license for VGA BIOS +VGABIOS-lgpl-latest LGPL'd VGA BIOS image for Bochs +VGABIOS-lgpl-latest-debug LGPL'd VGA BIOS image for Bochs with debug output to the logfile +VGABIOS-lgpl-latest-cirrus LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled +VGABIOS-lgpl-latest-cirrus-debug LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled and debug output to the logfile +VGABIOS-lgpl-README.txt readme for the LGPL'd VGA BIOS +dlxlinux\ directory containing DLX linux sample disk image and configuration files +dlxlinux\bochsrc.bxrc Bochs configuration file for DLX +dlxlinux/hd10meg.img disk image file (10 meg) +dlxlinux\readme.txt description of DLX linux +dlxlinux\run.bat Run this BAT file to try out DLX Linux inside Bochs! +dlxlinux\testform.txt Form for reporting success or failure + + doc\index.html + a local copy of all Bochs documentation (online copy) + +keymaps\*.map keymap tables (on Windows used for the paste feature only) + + +
+ +
+ +
+Linux RPM + +RPM stands for "RedHat Package Manager." An RPM is a compressed file +containing files to be installed on your system. Many Linux distributions, +not just RedHat ones, can install files from an RPM. First, download the +Bochs RPM for your architecture to your computer. For example, if you have an +Intel-compatible computer, be sure to get the RPM that says "for Linux x86 +distributions" or "i386". Once you have the package on your local disk, you +should become the root user and install it as follows + +Many distributions have their own RPM installer program, often graphical, and +they should work ok. It is helpful to be able to see the text output from +RPM, so if you use a fancy RPM installer, be sure to find the text output and +check that it looks correct. + +: + +
Installing an RPM in Linux + + user$ su + Password: + root# ls -l bochs-2.5.x86_64.rpm + -rw-r--r-- 1 user users 2628643 Nov 27 17:20 bochs-2.5.x86_64.rpm + root# rpm -i bochs-2.5.x86_64.rpm + root# exit + user$ _ + +
+
+ + +All RPM installations are done as the root user because they require +permission to update system files and directories. If you do not have root +access you need to compile Bochs in your home directory. + + + +RPM installation can fail for a few reasons. It will fail if you already +have a Bochs package installed. In this case, try upgrading the old package +to the new package with rpm --upgrade NAME.i386.rpm. +Another potential problem is missing RPM dependencies. If you are getting +errors about missing files or RPMs, then first you should try to +install the RPMs that provide the missing pieces. If that cannot be done, +download the source RPM and build a new binary RPM that is appropriate +for your platform. The command is rpmbuild --rebuild +NAME.src.rpm. As a last resort, you can run rpm with the +--nodeps option to ignore dependencies and install it +anyway, but if it is missing important pieces it may not run properly. + + + +The Bochs RPM installs five new commands and associated manual pages: bochs, +bochs-dlx and bximage. First, let's try out the +DLX Linux demo by typing bochs-dlx. + + + user$ bochs-dlx + --------------------------------------------------------------- + DLX Linux Demo, for Bochs x86 Emulator + --------------------------------------------------------------- + Checking for bochs binary...ok + Checking for DLX linux directory...ok + Checking for /bin/gzip...ok + Checking for /usr/users/bryce/.bochsdlx directory... + --------------------------------------------------------------- + To run the DLX Linux demo, I need to create a directory called + /usr/users/bryce/.bochsdlx, and copy some configuration files + and a 10 megabyte disk image into the directory. + --------------------------------------------------------------- + Is that okay? [y/n] + y + Copying /usr/share/bochs/dlxlinux/bochsrc.txt -> /usr/users/bryce/.bochsdlx/. + Copying /usr/share/bochs/dlxlinux/README -> /usr/users/bryce/.bochsdlx/. + Copying /usr/share/bochs/dlxlinux/testform.txt -> /usr/users/bryce/.bochsdlx/. + Uncompressing /usr/share/bochs/dlxlinux/hd10meg.img.gz -> /usr/users/bryce/.bochsdlx/hd10meg.img + Entering /usr/users/bryce/.bochsdlx + Running bochs + ======================================================================== + Bochs x86 Emulator 2.4.6.svn + Build from SVN snapshot, after release 2.4.6 + Compiled on Oct 20 2011 at 19:40:05 + ======================================================================== + + +Then you get a new X11 window containing the VGA display of the simulated +machine. First you see the VGA BIOS screen, then Linux uncompresses and +boots, and you get a login prompt. Type "root" and ENTER to log in to +DLX linux. +
+Screenshot of Bochs running DLX Linux + +
+
+ + +Booting is complete when you see "dlx login:" and a cursor. At this login +prompt, type "root". On UNIX systems, root is the system admin user. +There is no password for root on this sample disk image, so it lets you log +in without typing any password. Now you should see a UNIX prompt, and you +can begin to type UNIX commands. + + + + Welcome to DLX V1.0 (C) 1995-96 Erich Boehm + (C) 1995 Hannes Boehm + + dlx login: root + Linux 1.3.89. + dlx:~# pwd + /root + dlx:~# cd / + dlx:~# ls + bin/ etc/ lost+found/ root/ usr/ + boot/ fd/ mnt/ sbin/ var/ + dev/ lib/ proc/ tmp/ zip/ + dlx:/# df + Filesystem 1024-blocks Used Available Capacity Mounted on + /dev/hda1 10060 2736 6005 29% / + dlx:/# _ + + + +When you get tired of playing with DLX Linux, just type "reboot" in the Bochs +window to shut down the DLX Linux operating system, and when it starts +to reboot again press the "Power" button at the top of the Bochs display +to end the application. + + + + +Here is a list of the files that are installed by the RPM, and a brief +description of each one. + + +Files in RPM package + + File Description + + + +/usr/bin/bochs the main Bochs executable +/usr/bin/bochs-dlx run this script to try out DLX Linux inside Bochs! +/usr/bin/bxhub utility required for the 'socket' networking module +/usr/bin/bximage tool for manipulating disk images +/usr/lib/bochs/plugins/* device and gui plugins for Bochs (plugin version only) +/usr/share/doc/bochs/bochsrc-sample.txt sample Bochs configuration file +/usr/share/man/man1/* man pages for bochs, bochs-dlx and bximage +/usr/share/man/man5/* man page for bochsrc +/usr/share/doc/bochs/CHANGES what has changed between versions +/usr/share/doc/bochs/COPYING copy of the LGPL license +/usr/share/doc/bochs/LICENSE Bochs license information +/usr/share/doc/bochs/README the read-me file from the source distribution. +/usr/share/doc/bochs/TODO the TODO file from the source distribution. +/usr/share/doc/bochs/index.html a local copy of all Bochs documentation ( Online copy ) +/usr/share/doc/bochs/slirp.conf sample config file for the advanced 'slirp' network configuration +/usr/share/bochs/BIOS-bochs-latest default ROM BIOS image for Bochs +/usr/share/bochs/BIOS-bochs-legacy ROM BIOS image without 32-bit init code +/usr/share/bochs/SeaBIOS-README README for SeaBIOS ROM image +/usr/share/bochs/SeaVGABIOS-README README for SeaVGABIOS ROM image +/usr/share/bochs/VGABIOS-elpin-2.40 VGA BIOS image for Bochs +/usr/share/bochs/VGABIOS-elpin-LICENSE license for VGA BIOS +/usr/share/bochs/VGABIOS-lgpl-latest LGPL'd VGA BIOS image for Bochs +/usr/share/bochs/VGABIOS-lgpl-latest-debug LGPL'd VGA BIOS image for Bochs with debug output to the logfile +/usr/share/bochs/VGABIOS-lgpl-latest-cirrus LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled +/usr/share/bochs/VGABIOS-lgpl-latest-cirrus-debug LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled and debug output to the logfile +/usr/share/bochs/VGABIOS-lgpl-README readme for the LGPL'd VGA BIOS +/usr/share/bochs/bios.bin-1.13.0 SeaBIOS ROM image +/usr/share/bochs/dlxlinux/ directory containing DLX linux sample disk image and configuration files +/usr/share/bochs/dlxlinux/readme.txt description of DLX linux +/usr/share/bochs/keymaps/*.map keymap tables for X11, SDL and SDL2 +/usr/share/bochs/vgabios-cirrus.bin-1.13.0 SeaVGABIOS ROM image (for Cirrus adapter) + + +
+ + +
+ +
+MacOS X DMG + +This was contributed by Aard Vark in January 2003 + + +The MacOS X binary distribution is a mountable disk +image (.dmg file). Once you've downloaded the binary +distribution file, just double click +on it to automatically unpack the archive and mount +the volume on the desktop. An icon will appear +exactly as if you'd inserted a CD-ROM +or removable storage device, and a finder window +containing the volume should automatically open. +It is likely to have an odd name +such as _dmg_top, but don't worry about that. + + +Copy the Bochs-2.0 (or whatever version) folder from +the disk image onto your hard disk. Either Home or +Applications would be sensible places to put it. +Because the disk image is mounted read only, you +can't run the included dlxlinux guest OS until +you've copied it to the hard disk. + + +Once you've installed the binaries, it's probably a +good idea to drag the _dmg_top volume to trash to +unmount it, so you don't get confused and try to +run bochs from there. Then open +the bochs folder from wherever you installed it. + + +The MacOS X version of bochs requires a terminal +window to run. If you just double click on the Bochs +icon, you'll get an error message telling you to +double click on "bochs.scpt" to start +Bochs in a new terminal window. You'll need to +configure Bochs before you will get very far with +the bochs.scpt in the top folder, +so to try out bochs open the dlxlinux folder and +double click on the bochs.scpt icon inside. + + +This will open a new terminal window which will +contain the Bochs startup messages, and a +configuration menu. The default option is +[5], which starts the simulation, so press enter to +do so. You will then get a new window containing +the VGA display of the simulated +machine. The new window will probably appear behind +the current terminal window, so either click on the +bochs icon in the dock or the simulation window to +bring it to the front. If you're quick +enough you'll then see the VGA BIOS screen, then +Linux uncompresses and boots, and you get a login +prompt. Type "root" and ENTER to log in to DLX Linux. + + +Once you've finished playing with DLX Linux, just +type "reboot" in the Bochs window to shut down the +DLX Linux operating system, and +when it starts to reboot again press the "Power" +button in the "MacBochs Hardware Controls" window +(it's the circle containing a vertical bar at the +far right - have a look at the Linux screenshots, +since the Mac version doesn't seem to have +descriptions or tool-tips). + + +
+ +
+ +
Compiling Bochs + +
Standard Compile + +Bochs is written in C++, so you need a C++ compiler on your system. Most +platforms have been tested with GNU gcc/g++, but other compilers are known +to work too. By now, you should have unpacked your source TAR file or checked +out Bochs from SVN. If not, you can return to Downloading Bochs for details. The top level +directory of the source code will be referred to as &bochsdir;. (&bochsdir; +contains the files bochs.h and +main.cc and subdirectories cpu and +bios.) + + + +The standard compile process has three basic steps: +configure, make, and make +install. Each step is described in a separate section below. The +standard compile process is used on all Unix machines, MacOS X, and +Cygwin (win32). There are separate instructions for compiling for Win32 with Microsoft VC++. + + +
Configure + + +There is a script called configure which tests your +machine, C/C++ compiler and libraries to discover what settings should work on +your system. If you run configure with no arguments after +it, defaults will be used for all settings. To change the settings, you can +run configure with options that override the +defaults. You can get a list of valid configure options by typing +configure --help. One useful configure option is +--prefix=directory, which sets the directory in +which Bochs will be installed. All the possible configure options are +documented in a later section. + + + + + +Among other things, the configure script tries to detect your platform +and which compile options to use. If you want to control this, set these +environment variables before running configure: CC, +CXX, CFLAGS, +CXXFLAGS. Here is an example that sets the environment +variables, using bash/ksh + +The syntax for bash and ksh is given. In csh and variants, use the syntax +setenv VARIABLE +value to change environment variables. +Do not use an equal sign for csh! + + +syntax: + + export CC=egcs + export CXX="$CC" + export CFLAGS="-Wall -O2 -m486 -fomit-frame-pointer -pipe" + export CXXFLAGS="$CFLAGS" + + + + +Once the configure script knows what options are selected, +it creates a Makefile in every source code directory, and creates +$BOCHS/config.h with all the option values written +as preprocessor #defines. Now the sources are ready to compile. + + +
Configure Shortcut Scripts + +In the Bochs source directory, you will see a series of scripts called +.conf.platform. +These scripts run the configure script for you, with a set of +options that are appropriate for that platform. It is not necessary to +use the shortcut scripts; they are simply there to show you an example that +the developers have used. Some of these scripts have been used to build official +binary packages. + + + +If a shortcut script is "almost right" for you, just edit it and then run it! +If you run a shortcut script, you don't need to run configure manually. + + + +Run a shortcut script using Bourne shell, like this: + + sh .conf.win32-vcpp + + +These .conf.platform have +been tested in recent Bochs versions: + + .conf.linux + .conf.sparc + .conf.macos + .conf.macosx + .conf.win32-vcpp + .conf.win32-cygwin + + + +
+ +
+ + +
Make + +The make command compiles Bochs. Make is a program +used by many software projects that reads the &Makefile; in each source +directory and follows the instructions that it finds there. A &Makefile; tells +which files depend on which other files, what commands to use to compile and +link the code, and more. After you have finished the configure step, just type +make to build the source code. + + + +The reason that make is so popular is that it is smart about when to compile +and when not to compile. If you run make once, it compiles every file. But +when you run it again, it checks to see if any source files have been modified; +if not, there's nothing to do! For example, the &Makefile; says that +main.o depends on main.cc. Knowing +this, it will only compile main.cc if it is newer than +main.o. + + + +Of course, make can only do the right thing if the &Makefile; lists all the +dependencies correctly, so human error can sometimes lead make astray. +If make refuses to build something that you think it should, or you +are getting strange compile errors, try doing make all-clean +and then make again. All-clean means to clean up +the compiled files in every subdirectory, while make clean +means to clean up just the current directory + + +This is different from the terminology of some other projects, and it may cause +confusion. Sometimes "clean" implies that all subdirectories are affected. + +. However, it's important to note that make +all-clean leaves the configuration intact. You do not have +to run configure again. + + + +If you're really in the mood for cleaning, make dist-clean +erases all the configuration information too. In theory, after a dist-clean +your directory should look much like when you first untarred it or checked it +out. There's usually some extra stuff lying around, but the &Makefile; tries +at least to erase any files that it created. + + +
+ +
Make Install + +Once the program has been built, the next step is typically to run +make install to copy the executables, documentation, and +other required files into a public place so that all users can use it. +By default the files are copied to some directories in /usr/local. The following +tables shows the directories and their contents. + +Installed files + + + + bin + binary executables (bochs, bximage) + + + lib/bochs/plugins + plugins (if present) + + + man/man1 + manpages for installed binaries + + + man/man5 + manpage for the config file (bochsrc) + + + share/bochs + BIOS images, VGABIOS images, keymaps + + + share/doc/bochs + HTML docs, license, readme, changes, bochsrc sample + + + +
+
+ +
Installing the DLX Linux demo + +To download and install the DLX Linux demo distributed with Bochs binary release +packages, use these two make commands: + + make unpack_dlx + make install_dlx + +The package will be downloaded from the Bochs website and installed at same +location as the files of the Bochs base system. + +
+ +
+ +
Configure Options + +This section describes the configure options for Bochs. Perhaps the most +important option is , since it gives you a list of all +the other options. The configure script will detect your platform and choose +the default GUI for your platform. If the default choice is not what you +want, use the options to override the default. The +options in the first table tell which GUI library is the default for each +platform. Starting in version 2.0, you can use multiple + options at once to compile with multiple +display libraries, and then choose between them at runtime with the +display_library option +in the configuration file. Or, you can +let the configure script detect which libraries are on your system +and use them all, by configuring with . + + + +The concept of platform detection and default GUIs was added in Bochs 1.4. +In Bochs 1.3 and before, the X11 GUI was always the default. + + + + +Defaults by Platform + + + + Platform + Default GUI + Extra compile flags + + + + + win32, Cygwin or MinGW/MSYS + --with-win32 + If using nmake method, compile using cl /nologo /MT /W3 /EHs-c- /DNDEBUG /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS. + If using Visual C++ workspace, see the workspace file for compile settings. + See Compiling on Win32 with Microsoft VC++ for instructions. + + + + MacOS X or Darwin + --with-carbon + -fpascal-strings -fno-common -arch ppc -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh + + + + MacOS 9 or before + --with-macos + none + + + + AmigaOS + --with-amigaos + none + + + + any other platform + --with-x11 + none + + + + +
+ +Configure Options to Select the Display Library (optional) + + + + Option + Comments + + + + + --with-x11 + Use X windows user interface. On many operating systems, + Bochs will use X windows by default. + + + + --with-win32 + Use the native Win32 GUI. This is the default on win32 platforms. + + + + --with-carbon + Compile for MacOS X with the Carbon GUI. See the + .conf.macosx file for the correct MacOS X compile options. + WARNING: This Bochs feature is not maintained yet and may fail. + + + + --with-amigaos + Compile for Amiga MorphOS. This code is written by Nicholai + Benalal. + + + + --with-rfb + + Enable support for the RFB protocol to talk to AT&T's + VNC Viewer. + Refer to for details. + + + + --with-vncsrv + + Enable support for an extended RFB(VNC) GUI using the LibVNCServer library. + Refer to for details. + + + + --with-sdl + Enable support for the SDL 1.2.x GUI interface; see . + + + --with-sdl2 + Enable support for the SDL 2.x GUI interface; see . + + + --with-term + Use text-only gui with curses library. Almost certainly + won't work right with the debugger or the textconfig interface. + + + + --with-macos + Use Macintosh/CodeWarrior environment. This is for running + configure on a platform which supports running configure, so that + you may then transfer the configured code over to the + real compile environment. + WARNING: This Bochs feature is not maintained yet and may fail. + + + + --with-wx + + Enable support for wxWidgets configuration and display interface; + see . + + + + --with-svga + Use SVGALIB library for Linux. This allows a full-screen + text and graphics display without X windows. The SVGALIB port + was written by Igor Popik. + WARNING: This Bochs feature is not maintained yet and may fail. + + + + --with-nogui + No native GUI; just use blank stubs. This is if you don't + care about having video output, but are just running tests. + + + + --with-all-libs + + Automatically detect which libraries are installed on your system + and enable them. This option is still experimental; it might + enable libraries that are not usable and cause the compile to fail. + If you have trouble, just list the options + for the specific display libraries that you want. + + + + +
+ + +The remaining options can generally be used with any GUI. For each option +such as , you can also write +to explicitly turn it off. The following 3 tables show the general options +(.e.g debugger and plugins support), the CPU-related stuff (e.g. cpu level, +SMP, x86_64 support) and the devices options (e.g. PCI, USB, Cirrus graphics). + + +Configure Options (General) + + + + Option + Default + Comments + + + + + --enable-plugins + no + + Plugins are shared libraries that can be loaded on demand. Example: the + serial device is implemented as a plugin. In Unix, the serial plugin is + called libbx_serial.so. When Bochs reads its configuration file, if the + serial device is enabled it loads libbx_serial.so. See the Features + section for supported platforms. + + + + --enable-debugger + no + + Compile in support for Bochs internal command-line debugger. This has + nothing to do with x86 hardware debug support. It is a more powerful + and non-intrusive native debugger. Enabling this will of course slow + down the emulation. You only need this option if you know you need it. + After you have run ./configure, you may want to edit + config.h to customize the debugger further; + see for more information. + + + + --enable-debugger-gui + yes if debugger is on + + Enable support for the gui frontend of the Bochs debugger. This feature + is supported on Windows hosts and on hosts with GTK2 installed. + + + + --enable-readline + detected by configure + + Compile the debugger with the GNU readline library, which gives + command line editing and history. + + + + --enable-gdb-stub + no + + Enable support for the remote GDB stub. See Using Bochs and the remote GDB stub. + NOTE: This feature cannot be used if the Bochs debugger is also enabled. + WARNING: This Bochs feature is not maintained yet and may fail. + + + + --enable-disasm + yes + Compile in support for built-in disassembler. Bochs has + a built-in disassembler, which is useful if you either + run the built-in debugger (), or want + disassembly of the current instruction when there is a + panic in bochs. + + + --enable-docbook + detected + + Build the docbook documentation in doc/docbook. The configure + script will enable this option automatically if you have a program + called docbook2html installed. + + + + --enable-instrumentation= + no + + Compile in support for instrumentation. This allows you to collect + instrumentation data from bochs as it executes code. You have to create + your own instrumentation library and define the instrumentation macros + (hooks in bochs) to either call your library functions or not, depending + upon whether you want to collect each piece of data. + + + + --enable-xpm + yes + + Enables the check for the XPM library. This option is only valid if the + x display library is enabled (). + + + + --enable-show-ips + yes + + Enables logging of measured IPS, see the ips parameter + of the cpu option. + + + + --enable-logging + yes + + By default, Bochs generates logfile output that can be configured with + bochsrc options and at runtime. Use + to turn off this feature completely. + + + + --enable-assert-checks + yes if debugger is on + + BX_ASSERT event causes a panic on assertion failure if enabled (logging + feature must be enabled, too). + + + + --enable-cpp + no + + Use .cpp as C++ suffix. Renames all the .cc files to .cpp for use with + compilers which want that, like older MS C++ compilers. Don't use this + option unless you know you need it. + + + + --enable-idle-hack + no + + Enables Roland Mainz's experimental idle code, which is intended to + keep Bochs from always using 100% of CPU time. When Bochs is waiting + around for an interrupt, the idle code uses a select() loop and some + X11 tricks to wait until user input arrives. This is designed to + keep Bochs responsive while still yielding to other processes when + Bochs is idle. It only works with X11 or term GUI. + + + + +
+ +Configure Options (CPU & Memory) + + + + Option + Default + Comments + + + + + --enable-cpu-level={} + 6 + + Select which CPU level to emulate. Choices are 3,4,5,6 which mean to + target 386, 486, Pentium, or Pentium Pro and later emulation. + + + + --enable-smp + no + + Compile in support for SMP simulation. This allows you to boot Linux and + maybe other OSes in SMP mode, and bochs will simulate all the different + CPUs and communication between them. Do not expect this option to speed + up your simulation! On the contrary, it has to spend extra time simulating + the different CPUs (even if they're mostly idle) and the communication + between them. Use it to try out an SMP OS if you don't have an SMP machine, + or to debug SMP OS drivers. Refer to for more details + on SMP in Bochs. + + + + --enable-fpu + yes + If you want to compile Bochs to make use of the FPU emulator + written by Stanislav Shwartsman, use this option. + + + + --enable-3dnow + no + 3DNow! instruction set support (incomplete) + + + --enable-x86-64 + no + + Add support for x86-64 instruction set, written by Peter Tattam and Stanislav Shwartsman. + + + + --enable-vmx + no + Intel Virtualization Extensions (VMX) support + + + --enable-svm + no + AMD SVM (Secure Virtual Machine) extensions emulation support + + + --enable-avx + no + AVX instructions support + + + --enable-x86-debugger + no + X86 debugger support. If the software you run in bochs + needs to use the x86 hardware debugging facilities such as + DR0..DR7, instruction and data breakpoints etc., then you + should use this option. Otherwise don't use it, as it + will slow down the emulation. + + + + --enable-monitor-mwait + no + MONITOR/MWAIT instructions support (still experimental) + + + --enable-alignment-check + yes if cpu level >= 4 + support for alignment check in the CPU and #AC exception + + + --enable-configurable-msrs + no + support for user configurations of emulated MSR registers + (see example in msrs.def) + + + --enable-long-phy-address + no + support for guest physical address larger than 32 bit + + + --enable-a20-pin + yes + support for the A20 pin + + + --enable-large-ramfile + yes + support for guest memory larger than the host supports + + + --enable-repeat-speedups + no + enable support repeated I/O and memory copy speedups + + + --enable-fast-function-calls + no + enable support for fast function calls (gcc on x86 only) + + + --enable-handlers-chaining + no + enable support for handlers chaining optimization + + + --enable-all-optimizations + no + + Turn on the enables for all speed optimizations that the + developers believe are safe to use: + --enable-repeat-speedups, + --enable-fast-function-calls, + --enable-handlers-chaining. + + + + +
+ +Configure Options (Devices) + + + + Option + Default + Comments + + + + + --enable-cdrom + yes + + Enable use of a real CDROM/DVD drive. The cdrom emulation and the portable + ISO image file support are always present. You can use this option to + compile in support for accessing the media in your workstation's cdrom + drive. The supported platforms are Linux, Solaris, FreeBSD, OpenBSD, + MacOS X and Windows. For other platforms, a small amount of code specific + to your platform must be written. + + + + --enable-sb16 + no + + Enable Sound Blaster emulation. The available lowlevel sound interfaces + are autodetected. See section Using Sound + for supported platforms and more info. This option also enables the standard + PC gameport which is a part of the SB16. If you don't want to use it, you + might use . + + + + --enable-es1370 + no + + Enable ES1370 sound emulation. Just like the SB16 option, the available + lowlevel sound interfaces are autodetected and the gameport is turned on. + + + + --enable-gameport + no + + Enables the standard PC gameport. This option is only necessary if you want + to have a gameport, but no SB16 or ES1370 (see above). The connection to a + real joystick is currently supported on Linux and win32 only. + + + + --enable-ne2000 + no + Enable NE2000 network card support. This requires a + low-level component to be written for each OS (supported on FreeBSD, + OpenBSD, Linux, and Windows 9x/NT/2K/XP). When enabled and configured, + the NE2000 device model can talk to any computer on the network + EXCEPT FOR the local host. Exception: Under most circumstances, Bochs can + talk to the local host on Windows, and in the ethertap interface for Linux. + + + + --enable-pnic + no + Enable PCI pseudo NIC (network card) support. + + + --enable-e1000 + no + Enable Intel(R) 82540EM Gigabit Ethernet adapter support. + + + --enable-clgd54xx + no + Enable Cirrus Logic GD54xx (CL-GD5430 ISA or CL-GD5446 PCI) video + card support. For more information see . + + + + --enable-voodoo + no + Enable experimental 3dfx Voodoo Graphics emulation. The Voodoo1 is + known to work, the Voodoo2 support is not yet complete, but almost usable. + The Banshee / Voodoo3 support is under construction, but basically usable. + For more information see . + + + + --enable-iodebug + yes if debugger is on + + Dave Poirier has written an experimental interface to the debugger + using I/O ports, so that software running in the guest OS can access + features of the debugger. You only want this option if you are + developing guest OS code for use in Bochs. In other words, most people + don't. Also, it should only be used with . + See the + developer documentation for details. + + + + --enable-pci + yes + Enable limited i440FX / i430FX / i440BX PCI support. This is still + incomplete, but usable. + + + + --enable-pcidev + no + + Enable PCI host device mapping support. This requires + to be set as well as Linux 2.4, 2.6 or 3.x as host. + WARNING: This Bochs feature is not maintained yet and may fail. + + + + --enable-usb + no + + Enable i440FX / i440BX PCI USB support (UHCI). The host controller with + 2-port root hub and 8 USB device types are available. + + + + --enable-usb-ohci + no + + Enable USB OHCI support. The host controller with 2-port + root hub is available (USB device types: same as UHCI). + + + + --enable-usb-ehci + no + + Enable USB EHCI support. The host controller with 6-port + root hub is available (USB device types: same as UHCI). + + + + --enable-usb-xhci + no + + Enable USB xHCI support. The host controller with 4-port + root hub is available (USB device types: same as UHCI). + + + + --enable-raw-serial + no + + Enable support for the serial port emulation to access to the host's + serial port. This feature is partly implemented for Windows hosts only. + + + + +
+ +
+ + + + +
Transcript of Successful Compilation + +This example shows the output of a compilation and installation on Linux. + + user$ ls -l bochs-2.5.tar.gz + -rw-r--r-- 1 user users 4117999 27. Nov 17:14 bochs-2.5.tar.gz + user$ gunzip -c bochs-2.5.tar.gz | tar -xvf - + bochs-2.5/ + bochs-2.5/.conf.sparc + bochs-2.5/build/ + bochs-2.5/build/macosx/ + bochs-2.5/build/macosx/pbdevelopment.plist + bochs-2.5/build/macosx/make-dmg.sh + . + . + . + bochs-2.5/memory/memory.cc + bochs-2.5/memory/misc_mem.cc + bochs-2.5/memory/Makefile.in + user$ cd bochs-2.5 + user$ ./configure --enable-cpu-level=6 + checking build system type... x86_64-unknown-linux-gnu + checking host system type... x86_64-unknown-linux-gnu + checking target system type... x86_64-unknown-linux-gnu + checking if you are configuring for another platform... no + checking for standard CFLAGS on this platform... + checking for gcc... gcc + . + . + . + config.status: creating build/win32/nsis/bochs.nsi + config.status: creating host/linux/pcidev/Makefile + config.status: creating config.h + config.status: creating ltdlconf.h + user$ make + cd iodev && \ + make libiodev.a + make[1]: Entering directory `/home/volker/Archiv/test/bochs-2.5/iodev' + g++ -c -I.. -I./.. -I../instrument/stubs -I./../instrument/stubs -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES devices.cc -o devices.o + g++ -c -I.. -I./.. -I../instrument/stubs -I./../instrument/stubs -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES virt_timer.cc -o virt_timer.o + g++ -c -I.. -I./.. -I../instrument/stubs -I./../instrument/stubs -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES slowdown_timer.cc -o slowdown_timer.o + g++ -c -I.. -I./.. -I../instrument/stubs -I./../instrument/stubs -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES pic.cc -o pic.o + . + . + . + echo done + done + /bin/sh ./libtool --mode=link g++ -o bochs -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DBX_SHARE_PATH='"/usr/local/share/bochs"' -export-dynamic logio.o main.o config.o load32bitOShack.o pc_system.o osdep.o plugin.o crc.o \ + iodev/libiodev.a cpu/libcpu.a cpu/cpudb/libcpudb.a \ + memory/libmemory.a gui/libgui.a \ + disasm/libdisasm.a \ + fpu/libfpu.a \ + -lSM -lICE -lX11 -lXpm -lXrandr \ + \ + \ + \ + \ + -lm + mkdir .libs + g++ -o bochs -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DBX_SHARE_PATH=\"/usr/local/share/bochs\" logio.o main.o config.o load32bitOShack.o pc_system.o osdep.o plugin.o crc.o -Wl,--export-dynamic iodev/libiodev.a cpu/libcpu.a cpu/cpudb/libcpudb.a memory/libmemory.a gui/libgui.a disasm/libdisasm.a fpu/libfpu.a -lSM -lICE -lX11 -lXpm -lXrandr -lm + gcc -c -I. -I./. -Iinstrument/stubs -I./instrument/stubs -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES ./misc/bximage.c -o misc/bximage.o + /bin/sh ./libtool --mode=link g++ -o bximage -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES misc/bximage.o + g++ -o bximage -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES misc/bximage.o + gcc -c -I. -I./. -Iinstrument/stubs -I./instrument/stubs -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES ./misc/bxcommit.c -o misc/bxcommit.o + /bin/sh ./libtool --mode=link g++ -o bxcommit -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES misc/bxcommit.o + g++ -o bxcommit -g -O2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES misc/bxcommit.o + user$ su + root# make install + cd iodev && \ + make libiodev.a + make[1]: Entering directory `/home/volker/Archiv/test/bochs-2.5/iodev' + . + . + . + for i in CHANGES COPYING README TODO; do if test -f $i; then install -m 644 $i /usr/local/share/doc/bochs; else install -m 644 ./$i /usr/local/share/doc/bochs; fi; done + rm -f /usr/local/share/doc/bochs/README + cat ./build/linux/README.linux-binary ./README > /usr/local/share/doc/bochs/README + install -m 644 ./.bochsrc /usr/local/share/doc/bochs/bochsrc-sample.txt + root# exit + user$ _ + + +
+ + +
Compiling on Win32 with Microsoft VC++ + +The standard compile uses the configure script, but the Windows platform +cannot run the configure script natively. +The current solution to this problem is that the Bochs +configure script must be run on a different platform that does support +shell scripts, with options that cause it to configure for a Win32 +platform instead of the native one. Many people have access to a UNIX +machine that could run the configure script, or you can use Cygwin or +MinGW/MSYS to run the configure script. + + +Because Bochs depends so much on the configure script, if you are doing +much win32 Bochs development, you should consider downloading Cygwin or +MinGW/MSYS so that you can run the configure step natively. + +. + + + +Download the Bochs sources on a machine that can run shell scripts. +Edit the configure shortcut script .conf.win32-vcpp +if you want to adjust the configure options. Then type these commands +in the Bochs source directory: + + sh .conf.win32-vcpp + make win32_snap + +These commands will run the configure step, produce VC++ makefiles and +workspace files, and pack it all into a .zip file in the directory above the +source directory + +If the source directory is /home/joe/bochs-win32, the +resulting .zip file is in /home/joe/bochs-win32-msvc-src.zip. + +. The .zip file is all ready to transfer to the target Windows +machine to be unzipped and compiled. Or, if you run the sh/make steps in +Cygwin, you are already on the target machine so you don't need the .zip +file. + + + +When you have the Win32 sources transferred to a Windows machine with VC++, +find the workspace file called bochs.sln in the folder +"vs2013" and load it in VC++. Choose Project:Set Active Project +and be sure that "bochs" is selected. Then choose Build:Build bochs.exe. +This will build all the required libraries (iodev, cpu, etc.) and the auxiliary +programs bximage.exe, bxhub.exe and +niclist.exe. + + + +Using workspaces is easy and intuitive, but there is one caveat. The workspaces +come directly out of a ZIP file in build/win32/vs2013ex-workspace.zip, +and they are not controlled by the configure script. When you compile with certain +configure options (e.g. ) you need to link with additional +libraries. For now you must add them to the VC++ workspace by hand. In version 2.0, +we have improved the situation considerably by adding #if...#endif around every optional +file and including nearly every Bochs source file in the workspace. This solves the +problem of having to manually add source files to the workspace when you turn +on configure options such as . The problem of adding +link libraries remains unresolved. + + + + +To compile with the Bochs debugger enabled, add +to the configure line in .conf.win32-vcpp before running it. +No modifications to the workspace are necessary. + + + +An alternative way to compile is to run nmake.exe in an +MS-DOS window. Instead of using the workspace files, nmake uses the Bochs +makefiles that are generated by configure. The nmake method is currently used +to build the release binaries. + + + +The make install doesn't work with nmake yet. Currently +it must be run inside of Cygwin or MinGW/MSYS and requires the environment +variable INSTDIR to be set. + + +
+ +
Compiling on Win32 with Cygwin or MinGW/MSYS +Cygwin is a free Unix-like environment for Windows written by +Steve Chamberlain and now maintained by RedHat, Inc. You can download +it from www.cygwin.com. Because +Cygwin supports the configure script and uses GNU gcc/g++, you can use the +standard compile process. The configure script should automatically detect +Cygwin and add "-mno-cygwin -DWIN32" to the compiler options. You should +get a working Bochs if you just type: + + configure + make + + +Optionally, you can use the configure shortcut script for Cygwin, +.conf.win32-cygwin, instead of running configure +directly. If this script is close to what you need, just edit the script and +then run it. To use the configure shortcut script and compile in Cygwin, the +commands are + + sh .conf.win32-cygwin + make + +To find out the options which are known to work in Cygwin, open the file +.conf.win32-cygwin in any text editor/viewer and have +a look at the end of that file. + + +When using gcc 4.7 or newer you need to add the switch -mno-ms-bitfields +to the CFLAGS, to make sure that hdimage and network structures are packed as +expected. + + +The command make install installs the Bochs files in the directory +structure of your build environment. To install Bochs into any desired folder you +need to use the install_win32 target. It requires the environment +variable INSTDIR to be set. + +
+ +
Compiling on MacOS 9 with CodeWarrior + + It is possible that this hasn't been tried since 1999. In theory, you + run sh .conf.macos on a Unix box to build the + makefiles and headers, copy the whole thing over to a Mac, and then + use CodeWarrior to compile. Since it hasn't been tested in so long, + it is quite likely that some work is needed to bring the Mac port up + to date. + + + If you are interested and have the required MacOS development tools, please + let us know by contacting the &devlist;. Someone requests a MacOS port + almost once a month, but none of the developers know how to help them. + +
+ +
Compiling on MacOS X + +The port to MacOS X with Carbon API by Emmanuel Mailliard is quite new, and the +configure and makefile support was added by Bryce Denney. You will need +the compiler and libraries from the development tools CD. Bochs should +configure and compile with the Carbon GUI if you simply type: + + configure + make + +Optionally, you can use the configure shortcut script for MacOS X, +.conf.macosx, instead of running configure directly. +If this script is close to what you need, just edit the script and then +run it. To use the configure shortcut script and compile, the commands +are + + sh .conf.macosx + make + + +MacOS X has a special format for an application bundle, which looks like a +directory that contains the required resource files and binaries. The Makefile +currently creates this application bundle "by hand" using mkdir and copy, which +is surely the wrong way to do it. Bryce doesn't know the official way to +create an application from a Makefile, so this hack will remain until a real +Mac developer helps to clean it up. + + + +On MacOS X the default GUI is the Carbon interface, but you can also try other +Bochs GUIs. Use for X windows, + for VNC/RFB, for SDL +or for SDL2. + +
+ +
Compiling on Amiga/MorphOS + + Nicholai Benalal created this port to MorphOS running on Amiga. It should + compile with: + + configure + make + + If the platform is not detected properly, you might need to use + as a configure option. Optionally, you + can use the configure shortcut script, .conf.amigaos. + +
+ +
Compiling with the RFB interface + + The RFB code was written by Don Becker x-odus@iname.com, + who has a Bochs-RFB web page on his site, + http://www.psyon.org/bochs-rfb/. + + + This interface allows you to view the Bochs display with + AT&T's VNC Viewer. + The protocol used between a VNC server and a VNC viewer is called RFB. + Because the RFB code in Bochs is written with portable network socket + and POSIX thread code, it can be compiled on many platforms and has + been tested in Linux and Win32. No additional libraries are required. + To try it, type: + + configure --with-rfb + make + + RFB currently uses this setup: + + port range 5900 to 5949 (using the first one available) + no authentification + by default 30 seconds waiting for client + 8 bpp (BGR233) supported only + if client doesn't support resize: desktop size 720x480 (for text mode and standard VGA) + if resize supported: maximum resolution 1280x1024 + + + +With the display library option "timeout" the default value of 30 seconds can +be changed. With a value of 0 it is possible to start the simulation without a +client connected. + +
+ +
Compiling with the VNCSRV interface + + The LibVNCServer is + a cross-platform library that allows to implement VNC server functionality easily. + On platforms supported by LibVNCServer Bochs can be compiled with support for + it this way: + + configure --with-vncsrv + make + + + +Unlike the RFB GUI this new implementation is not limited to 8 bpp and it is +possible to connect a Bochs session with a web browser. + +
+ +
Compiling with the SDL interface + + Dave Poirier has written an SDL interface for Bochs. Simple DirectMedia + Layer, or SDL, is a cross-platform multimedia library distributed from + libsdl.org. SDL is available + for many platforms including Win32, Linux, BSD, IRIX, MacOS, MacOS X, + and AmigaOS. + + + To compile Bochs with SDL, you must first install the SDL library + from libsdl.org. You + can either get the source code and compile it yourself, or install + the development libraries for your platform (already compiled). + Then, go into the Bochs directory and type: + + configure --with-sdl + make + + + + If you are on FreeBSD and have SDL installed using the ports collection, Bochs + won't be able to find the library automatically, as the SDL config script is + called sdl11-config in that case (even for version 1.2). + The easiest way to make Bochs find it, is to create a symlink to that script + called sdl-config inside a directory which is in the path. + For example: + + ln -s /usr/local/bin/sdl11-config ~/bin/sdl-config + + + +To compile in Microsoft VS2013Ex, you have to configure on a different system +(see Compiling on Win32 with Microsoft VC++). +Before running the configure script, you have to add +to the shortcut script. If you have already configured, you can set BX_WITH_SDL + to 1 in config.h. + + +Then you have to set up the project for SDL this way: + +- add source file sdl.cc to the module gui +- add path to the SDL include files to the modules bochs and gui +- add lbraries SDL.lib and SDLmain.lib to the module bochs +- change the runtime library for all modules to Multithreaded-DLL (/MD) + +Compiling with MSVC nmake is not supported yet. + +
+ +
Compiling with the SDL version 2 interface + +The SDL library version 2 is now also supported by Bochs. For some basic information +about SDL, see . The configure option to enable SDL2 +support is and the configuration script is called +sdl2-config. Note that the Bochs guis for SDL version 1.2.x +and 2.x are mutually exclusive. The legacy SDL gui support will be removed someday. +When using the gui library autodetection () the +configure script probes for SDL version 2 first. + +
+ +
+Compiling with the wxWidgets interface + + wxWidgets is a cross-platform C++ user interface library which + you can download for free at wxwidgets.org. + The wxWidgets port of Bochs provides both a graphical configuration interface for + editing bochsrc options (see + config_interface option) and a + display (see display_library option). + It was written by Bryce Denney, Don Becker, Dave Poirier, and Volker Ruppert. + + configure --with-wx + make + + + + If you want Bochs to use a wxWidgets installation not in your path (but installed + somewhere else), you need to set the WX_CONFIG environment variable to the + proper wx-config script, before running configure (example for csh): + + setenv WX_CONFIG '/home/compile/wx/bin/wx-config' + + +
+ +
Building an RPM on Linux + +RPM stands for "RedHat Package Manager." An RPM is a compressed file +containing files to be installed on your system. Bochs +has a special shell script called make-rpm that helps +to build an RPM of Bochs. Start with a clean source directory. Edit +.conf.linux first if you want to adjust the configure options. +Then, type: + + + ./build/redhat/make-rpm | tee /tmp/build.txt + + +When this command completes, you should have a source RPM and a binary RPM of +Bochs in the current directory. The tee part of the +command (optional) saves a transcript of the build process into /tmp/build.txt, +which is very useful if anything goes wrong. Instructions for installing an +RPM are here. + + + +In the past, you had to build rpms as root, but as of version 2.0 you can build +them as a normal user. + + +
+ + + +
Compile Problems + +
The configure script failed + +The configure script can fail for various reasons. If the error +message on the shell doesn't give enough information, it is recommended to review +the output file config.log to find out what exactly +happened. The following issues can be fixed by modifying the configure options used: + + deprecated option (option from previous Bochs version not needed / + supported anymore) + mutually exclusive option (e.g. and ) + dependent option (e.g. USB support requires PCI support) + incomplete option (e.g. requires an argument) + development package for library not installed (e.g. for ) + +If the configure issue cannot be fixed by option changes and / or installing +development packages / tools it should be reported in the &devlist; or the SF bug +tracker for the Bochs project. + +
+ +
Make / compilation failure + +The make utility itself can only fail if the specified target +is not supported by the environment or simply doesn't exist. In most cases the programs +called from make are causing the failure (e.g. compiler / linker). + + +In some cases it might be useful to rebuild Bochs completely by calling +make dist-clean and running the configure +script once again. These steps are recommended if the development sources from +SVN are used and one of the build system files (e.g. Makefile +or config.h.in) has been changed. + + +Sometimes it is possible to isolate the failing piece of code by disabling one or +more configure options. For example, if the compilation fails somewhere in the cpu/avx* +files, it might help to configure without . The same +could be done with other Bochs facilities controlled by configure options. + +
+ +
Runtime issues with self-compiled Bochs + +After a successful compilation the self-compiled Bochs can fail if at least one +library is not installed properly. This can happen if the library consists of a +development and a runtime package and the second one is missing. Another problem +can appear on build environments like Cygwin and MinGW/MSYS. Applications built +there are usually designed to be run inside of the environment. When starting +them from the Windows shell, it may cause errors like "missing cygwin1.dll" +or similar. In that case, the missing DLL must be copied from e.g. the Cygwin folder +to the location of the compiled EXE file. + +
+ +
+
+
+ + + +Setup +
What does Bochs need? + +These are the minimum requirements for running an OS inside of Bochs: + + + +the Bochs executable + + + + +the BIOS image (usually called BIOS-bochs-latest) + + + + +the VGA BIOS image (e.g. VGABIOS-lgpl-latest or VGABIOS-elpin-2.40) + + + + +at least one bootable media, either as disk image (floppy, hard disk or CD-ROM) or physical disk (floppy or CD-ROM) + + + + + + +Both VGA BIOS versions as well as the ROM BIOS are part of the Bochs package. No separate download is necessary. +See for more information. + + +If you want to use the Cirrus SVGA adapter instead of VGA + Bochs VBE, you should +have a look at . + + + +In that case you have to pass the configuration options on the command +line or to use the configuration interface to set up Bochs for the simulation. +Running Bochs is easier if you use a configuration file (we call it +bochsrc). See for all supported options. + + + +The easiest way to setup Bochs for the first time is to use the example configuration +file called bochsrc-sample.txt. Locate that file (location depends +on the (host) OS and on the installation facility used) and copy it to a location where +Bochs looks for that file, see . + + + +The next step is to change the configuration so that it fits your needs: You most +likely want to setup a hard disk (see and +), and install some OS on it using either +a set of floppy disks (see ) or a CD-ROM +(see again) as installation media. +Make sure you boot the emulation from the media you want, using the right setting +as boot option. + + + +If your keyboard output inside of Bochs is wrong, you may also need a keymap file +to remap your keyboard layout to the U.S. layout. A set of keymap files for the +X window system and SDL (Linux port) is distributed with Bochs. If your +keyboard layout is not supported yet, you can create your own one by following the +instructions given in . + + + +A collection of disk images of different operating systems can be found at +. Some disk +images are the size of a floppy disk (1 meg compressed) and others are gigantic +(160 meg compressed). If you want to create a disk image yourself, please see +. + + +
+ +
+ROM images + +Just like a real PC, Bochs needs a system BIOS and VGA BIOS to initialize the +machine when it powers on or after a hardware reset. Bochs needs to load them +from image file into the emulated memory. The Bochs package contains a set of +system BIOS and VGA BIOS images. +System and VGA BIOS images + + File Description + + +BIOS-bochs-latest default ROM BIOS image for Bochs +BIOS-bochs-legacy ROM BIOS image without 32-bit init code (for i386 and ISA graphics card emulation) +bios.bin-1.13.0 SeaBIOS ROM image +VGABIOS-elpin-2.40 legacy VGA BIOS image for Bochs +VGABIOS-lgpl-latest LGPL'd VGA BIOS image for Bochs +VGABIOS-lgpl-latest-debug LGPL'd VGA BIOS image for Bochs with debug output to the logfile +VGABIOS-lgpl-latest-cirrus LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled +VGABIOS-lgpl-latest-cirrus-debug LGPL'd VGA BIOS image for Bochs with the Cirrus extension enabled and debug output to the logfile +vgabios-cirrus.bin-1.13.0 SeaVGABIOS ROM image (for Cirrus adapter) + + +
+
+ + +Bochs must be set up to use system and VGA BIOS like this: + + romimage: file=BIOS-bochs-latest, address=0xfffe0000 + vgaromimage: file=VGABIOS-lgpl-latest + +We recommend to use the ROM images distributed with Bochs or one of the latest +SeaBIOS images. BIOS images designed +for real hardware mostly do not work properly. Please see the +for more information. + + + +Bochs supports optional ROM images to be loaded into the ISA ROM space, +typically between C8000 and EFFFF (see ). The PCI +versions of the Bochs network adapter emulations support loading a boot ROM into +the PCI ROM space (see ). + + +
+ +
+The configuration file <filename>bochsrc</filename> + +Bochs uses a configuration file called bochsrc to know +where to look for disk images, how the Bochs emulation layer should work, etc. +When you first start up Bochs, it looks around for its configuration file +(see ), and parses it. +Here are a few lines from a sample file: + + ata0-master: type=disk, path="30M.sample", cylinders=615, heads=6, spt=17 + boot: disk + +The format is very strict, so be sure to put the right number of spaces and +use lowercase letters. As you can see, most lines have a keyword telling what +is being configured, followed by a colon, followed by a few +property=value pairs, separated by +commas. For very simple options, sometimes just a single value is needed. +The source and binary distributions come with a sample +bochsrc, so you can just copy the sample file and edit the +settings you need to change. + + + +The syntax used for bochsrc can also be used as command line arguments for Bochs. +If you have any spaces in your command line arguments, they should be enclosed +in single quotes, for example: + + bochs 'boot:floppy' 'floppya: 1_44=a.img, status=inserted' + +For other arguments, see section Command line arguments. + + + +You can use environment variables with the dollar sign prefix in the +bochsrc file, for example: + + floppya: 1_44="$IMAGES/bootdisk.img", status=inserted + boot: floppy + +There are two environment variables with a built-in default value which is set +at compile or installation time. $BXSHARE points to the +"share" directory which is typically /usr/local/share/bochs on UNIX +machines. See the $(sharedir) variable in the Makefile for the exact +value. $BXSHARE is used in the config files of the Bochs disk images to +locate the directory where the BIOS images and keymaps can be found. +If $BXSHARE is not defined, Bochs will supply the default value. +Also, $LTDL_LIBRARY_PATH points to a list of directories to search in for Bochs +plugins. The paths are separated by colons (on Windows: semicolons). +A compile-time default is provided if this variable is not defined by the user. +On Win32 and MacOSX, the default for the share directory is determined by a +platform-specific specific algorithm. On Win32, we use the registry to see what +directory Bochs and its support files were installed in. On MacOSX, the share +directory is the directory where the application is located. + + + +You can use the #include statement in the bochsrc to read the +configuration from other files. Now it is possible to put platform or +installation defaults in a global config file (e.g. location of rom images). +Put this on top of your config file if the global configuration is stored in /etc: + + #include /etc/bochsrc + + + + +Bochs now treats unknown options as device plugin names. It tries to load this +plugin and if successful it tries to call the parser function for this configuration +line which is located in the plugin. This mechanism is implemented for the Bochs +network, sound and USB devices. If there is a typo in an option name or an obsolete +option is used, Bochs will panic and exit with a plugin load failure error +message. In that case the failing line in your bochsrc file must be reviewed +and fixed. + + + +The section below lists all the supported bochsrc options. + + +
plugin_ctrl + +Example: + + plugin_ctrl: unmapped=0, e1000=1 # unload 'unmapped' and load 'e1000' + +Controls the presence of optional device plugins. These plugins are loaded +directly with this option and some of them install a config option that is +only available when the plugin device is loaded. The value "1" means to load +the plugin and "0" will unload it (if loaded before). + + +These plugins will be loaded by default (if present): 'biosdev', 'extfpuirq', +'gameport', 'iodebug','parallel', 'serial', 'speaker' and 'unmapped'. + + +These plugins are also supported, but they are usually loaded directly with +their bochsrc option: 'e1000', 'es1370', 'ne2k', 'pcidev', 'pcipnic', 'sb16', +'usb_ehci', 'usb_ohci', 'usb_uhci', 'usb_xhci' and 'voodoo'. + +
+ +
config_interface + +The configuration interface is a series of menus or dialog boxes that +allows you to edit all the settings that control Bochs' behavior. +Depending on the platform there are up to 3 choices of configuration +interface: a text mode version called "textconfig" and two graphical versions +called "win32config" and "wx". The text mode version uses stdin/stdout and +is always compiled in, unless Bochs is compiled for wx only. The choice +"win32config" is only available on win32 and it is the default there. +The choice "wx" is only available when Bochs is compiled with wxWidgets support, +see . If you do not write a config_interface line, +Bochs will choose a default for you (usually textconfig). + + + +wxWidgets provides both a configuration interface and a display library. +So if you use the "wx" configuration interface, you must also use +the "wx" display library, see +display_library option. + + + +Examples: + + config_interface: textconfig + config_interface: win32config + config_interface: wx + + +
+ +
display_library + +The display library is the code that displays the Bochs VGA screen. Bochs +has a selection of about 10 different display library implementations for +different platforms. If you run configure with multiple +options, the display_library option lets you choose which one you want to run with. +If you do not use a display_library line, Bochs will choose a default for +you. + + + +wxWidgets provides both a configuration interface and a display library. +So if you use the "wx" display library, you must also use +the "wx" configuration interface, see +config_interface option. + + + +Examples: + + display_library: x + display_library: sdl + +Some display libraries now support specific options to control their +behaviour. These options are supported by more than one display library: + + "gui_debug" - use GTK debugger gui (sdl, x) / Win32 debugger gui (sdl, sdl2, win32) + "hideIPS" - disable IPS output in status bar (rfb, sdl, sdl2, vncsrv, win32, wx, x) + "nokeyrepeat" - turn off host keyboard repeat (sdl, sdl2, win32, x) + "timeout" - time (in seconds) to wait for client (rfb, vncsrv) + +See the examples below for other currently supported options. + + display_library: sdl, options="fullscreen" # startup in fullscreen mode + display_library: sdl2, options="fullscreen" # startup in fullscreen mode + + + + +display_library values + + + + Option + Description + + + + + x + use X windows interface, cross platform + + + win32 + use native win32 libraries + + + carbon + use Carbon library (for MacOS X) + + + macintosh + use MacOS pre-10 + + + amigaos + use native AmigaOS libraries + + + sdl + use SDL 1.2.x library, cross platform, + details in + + + sdl2 + use SDL 2.x library, cross platform, + details in + + + svga + use SVGALIB library for Linux, allows graphics without X windows + + + term + text only, uses curses/ncurses library, cross platform + + + rfb + provides an interface to AT&T's VNC viewer, cross platform, + details in + + + vncsrv + use LibVNCServer for extended RFB(VNC) support, + details in + + + wx + use wxWidgets library, cross platform, + details in + + + nogui + no display at all + + + +
+
+ +
cpu + +Example: + + cpu: count=2, ips=10000000 + +This defines the parameters of the cpu inside Bochs: + +model + +Selects CPU configuration to emulate from pre-defined list of all +supported configurations. When this option is used and the value +is different from 'bx_generic', the parameters of the CPUID +option have no effect anymore. See the for supported values. + +count + +Set the number of processors:cores per processor:threads per core when Bochs +is compiled for SMP emulation. Bochs currently supports up to 14 threads +(legacy APIC) or 254 threads (xAPIC or higher) running simultaniosly. +If Bochs is compiled without SMP support, it won't accept values +different from 1. For more information on SMP see . + +quantum + +Maximum amount of instructions allowed to execute by processor before +returning control to another cpu. This option exists only in Bochs +binary compiled with SMP support. + +reset_on_triple_fault + +Reset the CPU when triple fault occur (highly recommended) rather than PANIC. +Remember that if you are trying to continue after triple fault the simulation +will be completely bogus ! + +cpuid_limit_winnt + +Determine whether to limit maximum CPUID function to 2. This mode is required +to workaround WinNT installation and boot issues. + +mwait_is_nop + +When this option is enabled MWAIT will not put the CPU into a sleep state. +This option exists only if Bochs compiled with . + +msrs + +Define path to user CPU Model Specific Registers (MSRs) specification. +See example in msrs.def. + +ignore_bad_msrs + +Ignore MSR references that Bochs does not understand; print a warning message +instead of generating #GP exception. This option is enabled by default but +will not be available if configurable MSRs are enabled. + +ips + +Emulated Instructions Per Second. This is the number of IPS that Bochs is +capable of running on your machine. You can recompile Bochs with + option enabled, to find your workstation's capability. +Measured IPS value will then be logged into your log file +or in the status bar (if supported by the gui). + + + +IPS is used to calibrate many time-dependent events within the Bochs +simulation. For example, changing IPS affects the frequency of VGA updates, +the duration of time before a key starts to autorepeat, and the measurement +of BogoMips and other benchmarks. The table below lists some typical +IPS settings for different machinesIPS measurements depend on +OS and compiler configuration in addition to host processor clock +speed.. + + +Example IPS Settings + + + + Bochs + Speed + Machine/Compiler + Typical IPS + + + +2.4.63.4GhzIntel Core i7 2600 with Win7x64/g++ 4.5.2 85 to 95 MIPS +2.3.73.2GhzIntel Core 2 Q9770 with WinXP/g++ 3.4 50 to 55 MIPS +2.3.72.6GhzIntel Core 2 Duo with WinXP/g++ 3.4 38 to 43 MIPS +2.2.62.6GhzIntel Core 2 Duo with WinXP/g++ 3.4 21 to 25 MIPS +2.2.62.1GhzAthlon XP with Linux 2.6/g++ 3.4 12 to 15 MIPS + + +
+
+ +
cpuid + +Example: + + cpuid: level=6, mmx=1, sep=1, sse=sse4_2, apic=xapic, aes=1, movbe=1, xsave=1 + +This defines features and functionality supported by Bochs emulated CPU. These settings +are only valid and configurable if the cpu model is +set to the default value 'bx_generic'. + +level + +Set emulated CPU level information returned by CPUID. Default value is +determined by configure option --enable-cpu-level. +Currently supported values are 5 (for Pentium and similar processors) and 6 (for P6 and +later processors). + +family + +Set family information returned by CPUID. Default family value determined +by configure option --enable-cpu-level. + +model + +Set model information returned by CPUID. Default model value is 3. + +stepping + +Set stepping information returned by CPUID. Default stepping value is 3. + +vendor_string + +Set the CPUID vendor string returned by CPUID(0x0). This should be a +twelve-character ASCII string. + +brand_string + +Set the CPUID brand string returned by CPUID(0x80000002 .. 0x80000004]). This should be +at most a forty-eight-character ASCII string. + +mmx + +Select MMX instruction set support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 5. + +apic + +Select APIC configuration (LEGACY/XAPIC/XAPIC_EXT/X2APIC). +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 5. + +sep + +Select SYSENTER/SYSEXIT instruction set support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +simd + +Select SIMD instructions support. +Any of NONE/SSE/SSE2/SSE3/SSSE3/SSE4_1/SSE4_2/AVX/AVX2/AVX512 could be selected. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. +The AVX choises exists only if Bochs compiled with --enable-avx option. + +sse4a + +Select AMD SSE4A instructions support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +misaligned_sse + +Select AMD Misaligned SSE mode support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +aes + +Select AES instruction set support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +sha + +Select SHA instruction set support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +movbe + +Select MOVBE Intel(R) Atom instruction support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +adx + +Select ADCX/ADOX instructions support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +xsave + +Select XSAVE extensions support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +xsaveopt + +Select XSAVEOPT instruction support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +avx_f16c + +Select AVX float16 convert instructions support. +This option exists only if Bochs compiled with option. + +avx_fma + +Select AVX fused multiply add (FMA) instructions support. +This option exists only if Bochs compiled with option. + +bmi + +Select BMI1/BMI2 instructions support. +This option exists only if Bochs compiled with option. + +fma4 + +Select AMD four operand FMA instructions support. +This option exists only if Bochs compiled with option. + +xop + +Select AMD XOP instructions support. +This option exists only if Bochs compiled with option. + +tbm + +Select AMD TBM instructions support. +This option exists only if Bochs compiled with option. + +x86_64 + +Enable x86-64 and long mode support. +This option exists only if Bochs compiled with x86-64 support. + +1g_pages + +Enable 1G page size support in long mode. +This option exists only if Bochs compiled with x86-64 support. + +pcid + +Enable Process-Context Identifiers (PCID) support in long mode. +This option exists only if Bochs compiled with x86-64 support. + +smep + +Enable Supervisor Mode Execution Protection (SMEP) support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +smap + +Enable Supervisor Mode Access Prevention (SMAP) support. +This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. + +mwait + +Select MONITOR/MWAIT instructions support. +This option exists only if Bochs compiled with . + +vmx + +Select VMX extensions emulation support. +This option exists only if Bochs compiled with option. + +svm + +Select AMD SVM (Secure Virtual Machine) extensions emulation support. +This option exists only if Bochs compiled with option. + +
+ +
memory + +Examples: + + memory: guest=512, host=256 + +Set the amount of physical memory you want to emulate. + +guest + +Set amount of guest physical memory to emulate. The default is 32MB, +the maximum amount limited only by physical address space limitations. + +host + +Set amount of host memory you want to allocate for guest RAM emulation. +It is possible to allocate less memory than you want to emulate in guest +system. This will fake guest to see the non-existing memory. Once guest +system touches new memory block it will be dynamically taken from the +memory pool. You will be warned (by FATAL PANIC) in case guest already +used all allocated host memory and wants more. + + +Due to limitations in the host OS, Bochs fails to allocate more than 1024MB on most 32-bit systems. +In order to overcome this problem configure and build Bochs with +option. + +
+ +
megs + +Examples: + + megs: 32 + megs: 128 + +This option sets the 'guest' and 'host' memory parameters to the same +value. In all other cases the 'memory' option should be used instead. + +
+ +
romimage + +Examples: + + romimage: file=bios/BIOS-bochs-latest, options=fastboot + romimage: file=$BXSHARE/BIOS-bochs-legacy + romimage: file=mybios.bin, address=0xfff80000 + +The ROM BIOS controls what the PC does when it first powers on. Normally, you +can use a precompiled BIOS in the source or binary distribution called +BIOS-bochs-latest. The default ROM BIOS is usually loaded +starting at address 0xfffe0000, and it is exactly 128k long. The legacy version +of the Bochs BIOS is usually loaded starting at address 0xffff0000, and it is +exactly 64k long. +You can use the environment variable $BXSHARE to specify the location of the BIOS. +The usage of external large BIOS images (up to 512k) at memory top is +now supported, but we still recommend to use the BIOS distributed with Bochs. +The start address is optional, since it can be calculated from image size. +The Bochs BIOS currently supports only the option "fastboot" to skip the +boot menu delay. + +
+ +
vgaromimage + +Examples: + + vgaromimage: file=bios/VGABIOS-elpin-2.40 + vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest + vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest-cirrus + +This tells Bochs what VGA ROM BIOS to load (at 0xC0000). + +A VGA BIOS from Elpin Systems, Inc. as well as a free LGPL'd VGA BIOS +are provided in the source and binary distributions. + + Please check with the vga option to decide + what VGA BIOS to use. + +
+ +
+optromimage1, optromimage2, optromimage3 or optromimage4 + +Example: + + optromimage1: file=optionalrom.bin, address=0xd0000 + + +This enables Bochs to load up to 4 optional ROM images. + + +Be sure to use a +read-only area, typically between C8000 and EFFFF. These optional +ROM images should not overwrite the rombios (located at +F0000-FFFFF) and the videobios (located at C0000-C7FFF). + + +Those ROM images will be initialized by the BIOS if they contain +the right signature (0x55AA). + + +It can also be a convenient way to upload some arbitrary code/data +in the simulation, that can be retrieved by the boot loader + +
+ +
+vga + +Examples: + + vga: extension=cirrus, update_freq=10, realtime=1 + vga: extension=vbe + +This defines parameters related to the VGA display + + +The 'extension' option can be used to specify the VGA display extension. +With the value 'none' you can use standard VGA with no extension. Other supported +values are 'vbe' for Bochs VBE (needs VGABIOS-lgpl-latest as +VGA BIOS, see vgaromimage option), +'cirrus' for Cirrus SVGA support (needs +VGABIOS-lgpl-latest-cirrus as VGA BIOS) and +'voodoo' for Voodoo Graphics support (needs external VGA BIOS / see + for more information). + + +The VGA update frequency specifies the number of display updates per second. +This parameter can be changed at runtime. The default value is 5. + + +The 'realtime' option specifies the operation mode of the VGA update timer. +If set to 1, the VGA timer is based on realtime, otherwise it is based on the +ips setting. If the host is slow (low ips, update_freq) and the guest uses HLT +appropriately, setting this to 0 and "clock: sync=none" may improve the +responsiveness of the guest GUI when the guest is otherwise idle. The default +value is 1. + +
+ +
+voodoo + +Example: + + voodoo: enabled=1, model=voodoo1 + +This defines the Voodoo Graphics emulation (experimental). Currently +supported models are 'voodoo1', 'voodoo2', 'banshee' and 'voodoo3'. +The Voodoo2 support is not yet complete, but almost usable. The Banshee / +Voodoo3 support is under construction, but basically usable. The 2D/3D cards +require an external VGA BIOS the vga extension option to be set to 'voodoo'. +If the i440BX PCI chipset is selected, they can be assigned to AGP (slot #5). +The gui screen update timing for all models is controlled by the related +'vga' options. See for more information. + +
+ +
keyboard + +Examples: + + keyboard: type=mf, serial_delay=200, paste_delay=100000 + keyboard: keymap=gui/keymaps/x11-pc-de.map + keyboard: user_shortcut=ctrl-alt-del + +This defines parameters related to the emulated keyboard. + +type + +Type of keyboard return by a "identify keyboard" command to the +keyboard controller. It must be one of "xt", "at" or "mf". +Defaults to "mf". It should be ok for almost everybody. A known +exception is french macs, that do have a "at"-like keyboard. + +serial_delay + +Approximate time in microseconds that it takes one character to +be transferred from the keyboard to controller over the serial path. + +paste_delay + +Approximate time in microseconds between attempts to paste +characters to the keyboard controller. This leaves time for the +guest os to deal with the flow of characters. The ideal setting +depends on how your operating system processes characters. The +default of 100000 usec (.1 seconds) was chosen because it works +consistently in Windows. + + +If your OS is losing characters during a paste, increase the paste +delay until it stops losing characters. + +keymap + +This enables a remap of a physical localized keyboard to a +virtualized us keyboard, as the PC architecture expects. + + +Keyboard mapping is available for the display libraries x, sdl (Linux port) and +wx (GTK port). For SDL you have to use keymaps designed for SDL, the wxWidgets GUI +uses the keymaps for X11. + +user_shortcut + +This defines the keyboard shortcut to be sent when you press the "user" button +in the headerbar. The shortcut string is a +combination of maximum 3 key names (listed below) separated with a '-' character. + + +Valid key names: + + +"alt", "bksl", "bksp", "ctrl", "del", "down", "end", "enter", "esc", +"f1", ... "f12", "home", "ins", "left", "menu", "minus", "pgdwn", "pgup", +"plus", "power", "print", "right", "scrlck", "shift", "space", "tab", "up" +and "win". + +
+ +
+mouse + +Examples: + + mouse: enabled=1 + mouse: type=imps2, enabled=1 + mouse: type=serial, enabled=1 + mouse: enabled=0, toggle=ctrl+f10 + +This defines parameters for the emulated mouse type, the initial status +of the mouse capture and the runtime method to toggle it. + +type + +With the mouse type option you can select the type of mouse to emulate. +The default value is 'ps2'. The other choices are 'imps2' (wheel mouse +on PS/2), 'serial', 'serial_wheel', 'serial_msys' (one com port requires +setting 'mode=mouse', see com option) +'inport' and 'bus' (if present). To connect a mouse to a USB port, see the +usb_uhci, 'usb_ohci', 'usb_ehci' +or 'usb_xhci' options (requires PCI and USB support). + +enabled + +The Bochs gui creates mouse "events" unless the 'enabled' option is +set to 0. The hardware emulation itself is not disabled by this. +Unless you have a particular reason for enabling the mouse by default, +it is recommended that you leave it off. You can also toggle the +mouse usage at runtime (see headerbar +and the 'toggle' option below). + +toggle + +The default method to toggle the mouse capture at runtime is to press the +CTRL key and the middle mouse button ('ctrl+mbutton'). This option allows +to change the method to 'ctrl+f10' (like DOSBox) or 'ctrl+alt' (like QEMU) +or 'f12'. + +
+ +
pci + +Examples: + + pci: enabled=1, chipset=i440fx # default if compiled with PCI support + pci: enabled=1, chipset=i440fx, slot1=pcivga, slot2=ne2k + pci: enabled=1, chipset=i440bx, slot5=voodoo, slot1=e1000 + +This option controls the presence of a PCI chipset in Bochs. Currently it +supports the i430FX, i440FX and i440BX chipsets. You can also specify the +devices connected to PCI slots. Up to 5 slots are available. For these +combined PCI/ISA devices assigning to slot is mandatory if you want to emulate +the PCI model: cirrus, ne2k and pcivga. These PCI-only devices are also +supported, but they are auto-assigned if you don't use the slot configuration: +e1000, es1370, pcidev, pcipnic, usb_ehci, usb_ohci, usb_xhci and voodoo. +In case of the i440BX chipset, slot #5 is the AGP slot. Currently only the +'voodoo' device can be assigned to AGP. + +
+ +
clock + +This defines the parameters of the clock inside Bochs: + +sync + +This defines the method how to synchronize the Bochs internal time +with realtime. With the value 'none' the Bochs time relies on the IPS +value and no host time synchronization is used. The 'slowdown' method +sacrifices performance to preserve reproducibility while allowing host +time correlation. The 'realtime' method sacrifices reproducibility to +preserve performance and host-time correlation. +It is possible to enable both synchronization methods. + +rtc_sync + +If this option is enabled together with the realtime synchronization, +the RTC runs at realtime speed. This feature is disabled by default. + +time0 + +Specifies the start (boot) time of the virtual machine. Use a time +value as returned by the time(2) system call or a string as returned +by the ctime(3) system call. If no time0 value is set or if time0 +equal to 1 (special case) or if time0 equal 'local', the simulation +will be started at the current local host time. If time0 equal to 2 +(special case) or if time0 equal 'utc', the simulation will be started +at the current utc time. + + + +Syntax: + clock: sync=[none|slowdown|realtime|both], time0=[timeValue|local|utc] + +Examples: + clock: sync=none, time0=local # Now (localtime) + clock: sync=slowdown, time0=315529200 # Tue Jan 1 00:00:00 1980 + clock: sync=none, time0="Mon Jan 1 00:00:00 1990" # 631148400 + clock: sync=realtime, time0=938581955 # Wed Sep 29 07:12:35 1999 + clock: sync=realtime, time0="Sat Jan 1 00:00:00 2000" # 946681200 + clock: sync=none, time0=1 # Now (localtime) + clock: sync=none, time0=utc # Now (utc/gmt) + +Default value are sync=none, rtc_sync=0, time0=local + + + +
+ +
cmosimage + +Example: + + cmosimage: file=cmos.img, rtc_init=time0 + +This defines a binary image file with size 128 bytes that can be loaded into +the CMOS RAM at startup. The rtc_init parameter controls whether initialize +the RTC with values stored in the image. By default the time0 argument given +to the clock option is used. With +'rtc_init=image' the image is the source for the initial time. + +
+ +
private_colormap + +Example: + + private_colormap: enabled=1 + +Requests that the GUI creates and uses its own non-shared colormap. This +colormap will be used when in the Bochs window. If not enabled, a shared +colormap scheme may be used. Once again, enabled=1 +turns on this feature and 0 turns it off. + +
+ +
floppya/floppyb + +Examples: + +2.88M 3.5" media: + floppya: 2_88=a:, status=inserted +1.44M 3.5" media (write protected): + floppya: 1_44=floppya.img, status=inserted, write_protected=1 +1.2M 5.25" media: + floppyb: 1_2=/dev/fd0, status=inserted +720K 3.5" media: + floppya: 720k=/usr/local/bochs/images/win95.img, status=inserted +auto-detect floppy media type: + floppya: image=floppy.img, status=inserted +use directory as VFAT media: + floppya: 1_44=vvfat:path, status=inserted +1.44M 3.5" floppy drive, no media: + floppya: type=1_44 + +Floppya is the first drive, and floppyb is the second drive. If you're booting +from a floppy, floppya should point to a bootable disk. To read from a disk +image, write the name of the image file. In many operating systems Bochs can +read directly from a raw floppy drive. For raw disk access, use the device +name (Unix systems) or the drive letter and a colon (Windows systems). + + +Following floppy media types are supported: 2_88, 1_44, 1_2, 720k, 360k, 320k, 180k, +160k, as well as "image" to let Bochs auto-detect the type of floppy media (does only +work with images, not with raw floppy drives). In that case the size must match +one of the supported types. + + +You can set the initial status of the media to ejected +or inserted. Usually you will want to use +inserted. + + +The parameter 'type' can be used to enable the floppy drive without media +and status specified. Usually the drive type is set up based on the media type. + + +The optional parameter 'write_protected' can be used to control the media +write protect switch. By default it is turned off. + +
+ +
ata0, ata1, ata2, ata3 + +Examples: + +ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 +ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15 +ata2: enabled=1, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11 +ata3: enabled=1, ioaddr1=0x168, ioaddr2=0x360, irq=9 + + +These options enables up to 4 ata channels. For each channel +the two base io addresses and the irq must be specified. +ata0 and ata1 are enabled by default, with the values shown above. + + +
+ +
ata0-master, ata0-slave, ata1-*, ata2-*, ata3-* + +Examples: + +ata0-master: type=disk, path=10M.img, mode=flat, cylinders=306, heads=4, spt=17, translation=none +ata1-master: type=disk, path=2GB.cow, mode=vmware3, cylinders=5242, heads=16, spt=50, translation=echs +ata1-slave: type=disk, path=3GB.img, mode=sparse, cylinders=6541, heads=16, spt=63, translation=auto +ata2-master: type=disk, path=7GB.img, mode=undoable, cylinders=14563, heads=16, spt=63, translation=lba +ata2-slave: type=cdrom, path=iso.sample, status=inserted + + + + + +This defines the type and characteristics of all attached ata devices: + +ata devices configuration options + + + +Option +Comments +Possible values + + + + type type of attached device [disk | cdrom] + path path of the image + + mode + image type, only valid for disks + [flat | concat | external | dll | sparse | vmware3 | vmware4 | undoable | growing | volatile | vpc | vbox | vvfat ] + + cylinders only valid for disks + heads only valid for disks + spt only valid for disks + status only valid for cdroms [inserted | ejected] + biosdetect type of biosdetection [auto | cmos | none] + translation type of translation done by the BIOS (legacy int13), only for disks [none | lba | large | rechs | auto] + model string returned by identify device ATA command + journal optional filename of the redolog for undoable, volatile and vvfat disks + + +
+
+ + + You have to tell the type of the attached device. For Bochs 2.0 or later, it can be + disk or cdrom. + + + +You have to point the "path" at a hard disk image file, cdrom iso file, +or physical cdrom device. +To create a hard disk image, try running bximage (see +). It will help you choose the size and +then suggest a line that works with it. + + + +In Unix it is possible to use a raw device as a Bochs hard disk, +but we don't recommend it for safety reasons. In Windows, there is no easy way. + + + +Disk geometry autodetection works with images created by bximage if CHS is set +to 0/0/0 (cylinders are calculated using heads=16 and spt=63). For other hard +disk images and modes the cylinders, heads, and spt are mandatory. In all cases +the disk size reported from the image must be exactly C*H*S*512. Flat hard disk +images from other projects might store additional information at the end of the +file that makes this check fail. Only in this case it is safe to select "continue" +when Bochs panics. + + + +The disk translation scheme +(implemented in legacy int13 BIOS functions, and used by +older operating systems like MS-DOS), can be defined as: + + +none : no translation, for disks up to 528MB (1032192 sectors) + + +large : a standard bitshift algorithm, for disks up to 4.2GB (8257536 sectors) + + +rechs : a revised bitshift algorithm, using a 15 heads fake physical geometry, for disks up to 7.9GB (15482880 sectors). (don't use this unless you understand what you're doing) + + +lba : a standard lba-assisted algorithm, for disks up to 8.4GB (16450560 sectors) + + +auto : autoselection of best translation scheme. (it should be changed if system does not boot) + + +Please see for a discussion on translation scheme. + + + +The mode option defines how the disk image is handled. Disks can be defined as: + + +flat : one file flat layout + + +concat : multiple files layout + + +external : developer's specific, through a C++ class + + +dll : developer's specific, through a DLL + + +sparse : stackable, commitable, rollbackable + + +vmware3 : vmware version 3 disk support + + +vmware4 : vmware version 4 disk support (aka VMDK) + + +undoable : read-only base file with commitable redolog + + +growing : growing file + + +volatile : read-only base file with volatile redolog + + +vpc: fixed / dynamic size VirtualPC image + + +vbox: fixed / dynamic size Oracle(tm) VM VirtualBox image (VDI version 1.1) + + +vvfat: local directory appears as VFAT disk (with volatile redolog / optional commit) + + +Please see for a discussion on disk modes. + + + +Default values are: + + mode=flat, biosdetect=auto, translation=auto, model="Generic 1234" + + + + + The biosdetect option has currently no effect on the BIOS. + + + + Make sure the proper ata option is enabled when + using a device on that ata channel. + +
+ +
boot + +Examples: + + boot: floppy + boot: cdrom, disk + boot: network, disk + boot: cdrom, floppy, disk + +This defines the boot sequence. You can specify up to 3 boot drives, +which can be 'floppy', 'disk', 'cdrom' or 'network' (boot ROM). +Legacy 'a' and 'c' are also supported. + +
+ +
floppy_bootsig_check + +Example: + + floppy_bootsig_check: disabled=1 + +This disables the 0xaa55 signature check on boot floppies +The check is enabled by default. + +
+ +
log + +Examples: + + log: bochsout.txt + log: - + log: /dev/tty (Unix only) + log: /dev/null (Unix only) + log: nul (win32 only) + +Give the path of the log file you'd like Bochs debug and misc. verbiage to be +to be written to. If you don't use this option or set the filename to '-' +the output is written to the console. If you really don't want it, +make it "/dev/null" (Unix) or "nul" (win32). :^( + +
+ +
logprefix + +Examples: + + logprefix: %t-%e-@%i-%d + logprefix: %i%e%d + +This handles the format of the string prepended to each log line. +You may use those special tokens : + + %t : 11 decimal digits timer tick + %i : 8 hexadecimal digits of current cpu eip (ignored in SMP configuration) + %e : 1 character event type ('i'nfo, 'd'ebug, 'p'anic, 'e'rror) + %d : 5 characters string of the device, between brackets + + + +Default is %t%e%d + +
+ +
debug/info/error/panic + +Examples: + + debug: action=ignore, pci=report + info: action=report + error: action=report + panic: action=ask + + +During simulation, Bochs encounters certain events that the user might want to +know about. These events are divided into four levels of importance: debug, +info, error, and panic. Debug messages are usually only useful when writing +Bochs code or when trying to locate a problem. There may be thousands of debug +messages per second, so be careful before turning them on. Info messages tell +about interesting events that don't happen that frequently. Bochs produces an +"error" message when it finds a condition that really shouldn't happen, but +doesn't endanger the simulation. An example of an error might be if the +emulated software produces an illegal disk command. Panic messages mean that +Bochs cannot simulate correctly and should probably shut down. +A panic can be a configuration problem (like a misspelled bochsrc line) or an +emulation problem (like an unsupported video mode). + + + +The debug, info, error, and panic lines in the bochsrc control what Bochs will +do when it encounters each type of event. The allowed actions are: fatal +(terminate bochs), ask (ask the user what to do), warn (show dialog with message +and continue), report (print information to the console or log file), or ignore +(do nothing). The recommended settings are listed in the sample above. + + + +It is also possible to specify the 'action' to do for each Bochs facility +separately (e.g. crash on panics from everything except the cdrom, and only +report those). See the log function module table +for valid module names. + + + + +The safest action for panics is "fatal" or "ask". If you are getting lots of +panics and get tired of telling it to continue each time, you can try +action=report instead. If you allow Bochs to continue after a panic, don't +be surprised if you get strange behavior or crashes after a panic occurs. +Please report panic messages to the &devlist; unless it is just a configuration +problem like "could not find hard drive image." + + +
+ +
debugger_log + +Examples: + + debugger_log: debugger.out + debugger_log: /dev/null (Unix only) + debugger_log: - + +Give the path of the log file you'd like Bochs to log debugger output. +If you really don't want it, make it '/dev/null', or '-'. + +
+ +
+com[1-4] + +Examples: + + com1: enabled=1, mode=null + com1: enabled=1, mode=mouse + com1: enabled=1, mode=term, dev=/dev/ttyp9 + com2: enabled=1, mode=file, dev=serial.out + com3: enabled=1, mode=raw, dev=com1 + com3: enabled=1, mode=socket-client, dev=localhost:8888 + com3: enabled=1, mode=socket-server, dev=localhost:8888 + com4: enabled=1, mode=pipe-client, dev=\\.\pipe\mypipe + com4: enabled=1, mode=pipe-server, dev=\\.\pipe\mypipe + + This defines a serial port (UART type 16550A). + + + When using the mode 'term', you can specify a device to use as com1. + This can be a real serial line, or a pty. To use a pty (under X/Unix), + create two windows (xterms, usually). One of them will run Bochs, and + the other will act as com1. Find out the tty of the com1 window using + the `tty' command, and use that as the `dev' parameter. Then do + `sleep 1000000' in the com1 window to keep the shell from messing with + things, and run Bochs in the other window. Serial I/O to com1 (port 0x3f8) + will all go to the other window. + + + When using socket* and pipe* (win32 only) modes Bochs becomes either + socket/named pipe client or server. In client mode it connects to an already + running server (if connection fails Bochs treats com port as not connected). + In server mode it opens socket/named pipe and waits until a client application + connects to it before starting simulation. This mode is useful for remote + debugging (e.g. with gdb's "target remote host:port" command or windbg's command + line option -k com:pipe,port=\\.\pipe\pipename). Socket modes use simple TCP + communication, pipe modes use duplex byte mode pipes. + + + Other serial modes are 'null' (no input/output), 'file' (output to a file + specified as the 'dev' parameter and changeable at runtime), 'raw' (use the + real serial port - partly implemented on win32), 'mouse' (standard serial + mouse - requires mouse option setting + 'type=serial', 'type=serial_wheel' or 'type=serial_msys'). + +
+ +
+parport[1-2] + +Examples: + + parport1: enabled=1, file="parport.out" + parport2: enabled=1, file="/dev/lp0" + parport1: enabled=0 + +This defines a parallel (printer) port. When turned on and an output file is +defined, the emulated printer port sends characters printed by the guest OS +into the output file. On some platforms, a device filename can be used to +send the data to the real parallel port (e.g. "/dev/lp0" on Linux, "lpt1" on +win32 platforms). The output file can be changed at runtime. + +
+ +
+sound + +Example for one driver (uses platform-default): + + sound: driver=default, waveout=/dev/dsp + +Example for different drivers: + + sound: waveoutdrv=sdl, waveindrv=alsa, midioutdrv=dummy + +This defines the lowlevel sound driver(s) for the wave (PCM) input / output +and the MIDI output feature and (if necessary) the devices to be used. +It can have several of the following properties. All properties are in the +format sound: property=value. + + + + : This defines the driver to be used for the + waveout feature. Possible values are 'file' (all wave data sent to file), + 'dummy' (no output) and the platform-dependant drivers 'alsa', 'oss', 'osx', + 'sdl' and 'win'. + + + + : + This defines the device to be used for wave output (if necessary) or the + output file for the 'file' driver. + + + + : + This defines the driver to be used for the wavein feature. + Possible values are 'dummy' (recording silence) and platform-dependent + drivers 'alsa', 'oss', 'sdl' and 'win'. + + + + : + This defines the device to be used for wave input (if necessary). + + + + : + This defines the driver to be used for the MIDI output feature. + Possible values are 'file' (all MIDI data sent to file), 'dummy' (no + output) and platform-dependent drivers 'alsa', 'oss', 'osx' and 'win'. + + + + : + This defines the device to be used for MIDI output (if necessary). + + + + : + This defines the driver to be used for all sound features with one + property. Possible values are 'default' (platform default) and all + other choices described above. Overriding one or more settings with + the specific driver parameter is possible. + + +See for more information. + +
+ +
+speaker + +Example: + + speaker: enabled=1, mode=sound + +This defines the PC speaker output mode. In the 'sound' mode the beep +is generated by the square wave generator which is a part of the +lowlevel sound support. The 'system' mode is only available on Linux +and Windows. On Linux /dev/console is used for output and on Windows +the Beep() function. The 'gui' mode forwards the beep to the related +gui methods (currently only used by the Carbon gui). + +
+ +
sb16 + +Example: + + sb16: midimode=2, midifile=output.mid, wavemode=3, wavefile=output.wav + loglevel=2, log=sb16.log, dmatimer=600000 + + +The example is wrapped onto several lines for formatting reasons, but it +should all be on one line in the actual bochsrc file. + + +This defines the Sound Blaster 16 emulation, see the developer documentation +for more information. It can have several of the following properties. All properties +are in the usual "property=value" format. + + + + : + This optional property controls the presence of the SB16 emulation. + The emulation is turned on unless this property is used and set to 0. + + + + : + This parameter specifies what to do with the MIDI output. + + 0 = no output + 1 = output to device specified with the sound option (system dependent) + 2 = MIDI or raw data output to file (depends on file name extension) + 3 = dual output (mode 1 and 2 at the same time) + + + + + : + This is the file where the midi output is stored (midimode 2 or 3). + + + + : + This parameter specifies what to do with the PCM output. + + 0 = no output + 1 = output to device specified with the sound option (system dependent) + 2 = VOC, WAV or raw data output to file (depends on file name extension) + 3 = dual output (mode 1 and 2 at the same time) + + + + + : + This is the file where the wave output is stored (wavemode 2 or 3). + + + + : The file to write the sb16 emulator messages to. + + + + : + + 0 = No log. + 1 = Resource changes, midi program and bank changes. + 2 = Severe errors. + 3 = All errors. + 4 = All errors plus all port accesses. + 5 = All errors and port accesses plus a lot of extra information. + + It is possible to change the loglevel at runtime. + + + + : + Microseconds per second for a DMA cycle. Make it smaller to fix + non-continuous sound. 750000 is usually a good value. This needs a reasonably + correct setting for the ips parameter of the + cpu option. It is possible to adjust the + dmatimer value at runtime. + + + +
+ +
es1370 + +Examples: + + es1370: enabled=1, wavemode=1 # use 'sound' parameters + es1370: enabled=1, wavemode=2, wavefile=output.voc # send output to file + +This defines the ES1370 sound emulation (recording and playback - except +DAC1+DAC2 output at the same time). The parameter 'enabled' controls the +presence of the device. The wave and MIDI output can be sent to device, file +or both using the parameters 'wavemode', 'wavefile', 'midimode' and +'midifile'. See the description of these parameters at the SB16 directive. + +
+ +
+ne2k + +The ne2k line configures an emulated NE2000-compatible Ethernet adapter, +which allows the guest machine to communicate on the network. To disable +the NE2000 just comment out the ne2k line. + + +Examples: + +ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xl0 +ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=en0 #macosx +ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0 +ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=win32, ethdev=MYCARD +ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vde, ethdev="/tmp/vde.ctl" +ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:01, ethmod=vnet, ethdev="c:/temp" +ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tap, ethdev=tap0 +ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun0, script=./tunconfig +ne2k: mac=b0:c4:20:00:00:01, ethmod=socket, ethdev=40000 # use localhost +ne2k: mac=b0:c4:20:00:00:01, ethmod=socket, ethdev=mymachine:40000 +ne2k: mac=b0:c4:20:00:00:01, ethmod=slirp, script=slirp.conf, bootrom=ne2k_pci.rom + +IOADDR, IRQ: You probably won't need to change ioaddr and irq, unless there +are IRQ conflicts. These parameters are ignored if the NE2000 is assigned to +a PCI slot. + +MAC: The MAC address MUST NOT match the address of any machine on the net. +Also, the first byte must be an even number (bit 0 set means a multicast +address), and you cannot use ff:ff:ff:ff:ff:ff because that's the broadcast +address. For the ethertap module, you must use fe:fd:00:00:00:01. There may +be other restrictions too. To be safe, just use the b0:c4... address. + +ETHMOD: The ethmod value defines which low level OS specific module to be +used to access physical ethernet interface. You can also specify a network +simulator or a module with no input/output ("null"). See the table below for +currently supported values. + +ETHDEV: The ethdev value is the name of the network interface on your host +platform. On UNIX machines, you can get the name by running ifconfig. On +Windows machines, you must run niclist to get the name of the ethdev. +Niclist source code is in misc/niclist.c and it is included in Windows +binary releases. + +SCRIPT: The script value is optional, and is the name of a script that +is executed after bochs initialize the network interface. You can use +this script to configure this network interface, or enable masquerading. +This is mainly useful for the tun/tap devices that only exist during +Bochs execution. The network interface name is supplied to the script +as first parameter. + +BOOTROM: The bootrom value is optional, and is the name of the ROM image +to load. Note that this feature is only implemented for the PCI version of +the NE2000. + + + + +The following table shows the available ethernet modules with description, +whether the "ethdev" and "script" parameters are used or not and the Bochs +version where this module was added. + +Ethernet modules + + + + Module + Description + ethdev + script + Bochs version + + + + + fbsd + FreeBSD / OpenBSD packetmover. + + Yes + No + 1.0 + + + linux + Linux packetmover - 'root' privileges required, + no connection to the host machine. + + Yes + No + 1.3 + + + null + Null packetmover. All packets are discarded, but logged to a + few files. + + No + No + 1.0 + + + tap + TAP packetmover. + + Yes + Yes + 1.4 + + + tuntap + TUN/TAP packetmover - see + Configuring and using a tuntap network interface. + + Yes + Yes + 2.0 + + + vde + Virtual Distributed Ethernet packetmover. + + Yes + Yes + 2.2 + + + vnet + ARP, ping (ICMP-echo), DHCP and read/write TFTP simulation. The virtual + host uses 192.168.10.1. DHCP assigns 192.168.10.2 to the guest. The TFTP server + uses the 'ethdev' value for the root directory and doesn't overwrite files. + + Yes, for TFTP + Yes, for log file name + 2.2 + + + slirp + Built-in Slirp support with DHCP / TFTP servers. Adds user mode + networking to Bochs - see Using the 'slirp' + networking module. The 'script' parameter can be used to set up + an alternative IP configuration or additional features. The TFTP server + uses the 'ethdev' value for the root directory and doesn't overwrite files. + + Yes, for TFTP + Yes, for Slirp config + 2.6.5 + + + socket + Connect up to 6 Bochs instances on the same or other machine + with external program 'bxhub' (simulating an ethernet hub). It provides + the same services as the 'vnet' module and assigns IP addresses like + 'slirp' (10.0.2.x) (see Using the 'socket' + networking module). + + Yes, for base UDP port and (optional) the host to connect + No + 2.6.9 + + + win32 + Win32 packetmover - WinPCap driver required. + + Yes + No + 1.3 + + + +
+
+ +
pcipnic + +Example: + + pcipnic: enabled=1, mac=b0:c4:20:00:00:00, ethmod=vnet + +To support the Bochs/Etherboot pseudo-NIC, Bochs must be compiled with the + configure option. It accepts the same syntax (for mac, +ethmod, ethdev, script, bootrom) and supports the same networking modules as the +NE2000 adapter. + +
+ +
e1000 + +Example: + + e1000: enabled=1, mac=52:54:00:12:34:56, ethmod=slirp, script=slirp.conf + +To support the Intel(R) 82540EM Gigabit Ethernet adapter, Bochs must be compiled +with the configure option. It accepts the same syntax +(for mac, ethmod, ethdev, script, bootrom) and supports the same networking modules +as the NE2000 adapter. + +
+ +
usb_uhci + +Examples: + + usb_uhci: enabled=1, port1=mouse, port2=disk:usbstick.img + usb_uhci: enabled=1, port1=hub:7, port2=disk:growing:usbdisk.img + usb_uhci: enabled=1, port2=disk:undoable:usbdisk.img, options2=journal:redo.log + usb_uhci: enabled=1, port2=disk:usbdisk2.img, options2=sect_size:1024 + usb_uhci: enabled=1, port2=disk:vvfat:vvfat, options2="debug,speed:full" + usb_uhci: enabled=1, port1=printer:printdata.bin, port2=cdrom:image.iso + usb_uhci: enabled=1, port2=floppy:vvfat:diskette, options2="model:teac" + +This option controls the presence of the USB root hub which is a part of the +i440FX PCI chipset. + + +With the portX option you can connect devices +to the hub (currently supported: 'mouse', 'tablet', 'keypad', 'disk', 'cdrom', +'floppy, ''hub' and 'printer'). + + +If you connect the mouse or tablet to one of the ports, Bochs forwards the +mouse movement data to the USB device instead of the selected mouse type. +When connecting the keypad to one of the ports, Bochs forwards the input of +the numeric keypad to the USB device instead of the PS/2 keyboard. + + +To connect a 'flat' mode image as a USB hardisk you can use the 'disk' device +with the path to the image separated with a colon. To use other disk image modes +similar to ATA disks the syntax 'disk:mode:filename' must be used (see above). + + +To emulate a USB cdrom you can use the 'cdrom' device name and the path to +an ISO image or raw device name also separated with a colon. An option to +insert/eject media is available in the runtime configuration. + + +To emulate a USB floppy you can use the 'floppy' device with the path to the +image separated with a colon. To use the VVFAT image mode similar to the +legacy floppy the syntax 'floppy:vvfat:directory' must be used (see above). +An option to insert/eject media is available in the runtime configuration. + + +The device name 'hub' connects an external hub with max. 8 ports (default: 4) +to the root hub. To specify the number of ports you have to add the value +separated with a colon. Connecting devices to the external hub ports is only +available in the runtime configuration. + + +The device 'printer' emulates the HP Deskjet 920C printer. The PCL data is +sent to a file specified in bochsrc.txt. The current code appends the PCL +code to the file if the file already existed. The output file can be changed +at runtime. + + +The optionsX parameter can be used to assign specific +options to the device connected to the corresponding USB port. Currently this +feature is used to set the speed reported by device ('low', 'full', 'high' or +'super'). The available speed choices depend on both HC and device. The option +'debug' turns on debug output for the device at connection time. For the USB +'disk' device the optionsX parameter can be used to specify an alternative +redolog file (journal) of some image modes. For 'vvfat' mode USB disks the optionsX +parameter can be used to specify the disk size (range 128M ... 128G). If the +size is not specified, it defaults to 504M. +For the USB 'floppy' device the optionsX parameter can be used to specify an +alternative device ID to be reported. Currently only the model "teac" is +supported (can fix hw detection in some guest OS). The USB floppy also +accepts the parameter "write_protected" with valid values 0 and 1 to select +the access mode (default is 0). + + +PCI support must be enabled to use USB UHCI. + +
+ +
usb_ohci + +Example: + + usb_ohci: enabled=1, port1=printer:printdata.bin + +This option controls the presence of the USB OHCI host controller with a +2-port hub. The portX parameter accepts the same device types with the same +syntax as the UHCI controller (see the usb_uhci option). +The optionsX parameter is also available on OHCI. +
+ +
usb_ehci + +Example: + + usb_ehci: enabled=1, port1=tablet, options1="speed:high" + +This option controls the presence of the USB EHCI host controller with a +6-port hub. The portX parameter accepts the same device types with the same +syntax as the UHCI controller (see the usb_uhci option). +The optionsX parameter is also available on EHCI. +
+ +
usb_xhci + +Example: + + usb_xhci: enabled=1, port1="disk:usbdisk.img" + +This option controls the presence of the USB xHCI host controller with a 4-port +hub. The portX parameter accepts the same device types with the same syntax as +the UHCI controller (see the usb_uhci option). +The optionsX parameter is also available on xHCI. NOTE: port 1 and 2 are USB3 and +only support super-speed devices, but port 3 and 4 are USB2 and support speed +settings low, full and high. +
+ +
pcidev + +Example: + + pcidev: vendor=0xbabe, device=0x2bad + +Enables the mapping of a host PCI hardware device within the virtual PCI +subsystem of the Bochs x86 emulator. The arguments +vendor and device +should contain the PCI vendor ID respectively the PCI +device ID of the host PCI device you want to map within Bochs. + + + +The PCI device mapping is still in a very early stage of development and thus it is very experimental. +This feature requires Linux as a host operating system. + + + +Besides the pcidev config line you will need to load +a pcidev kernel module within your Linux host OS. This kernel module is +located in the bochs/host/linux/pcidev/ directory. + +
+ +
+gdbstub + +Example: + + gdbstub: enabled=1, port=1234, text_base=0, data_base=0, bss_base=0 + +Default: + + gdbstub: enabled=0 + +This enables the GDB stub. See . + +
+ +
magic_break + +Example: + + magic_break: enabled=1 + +This enables the "magic breakpoint" feature when using the debugger. +The useless cpu instruction XCHG BX, BX causes Bochs to enter the +debugger mode. This might be useful for software development. + +
+ +
debug_symbols + +Example: + + debug_symbols: file=mysymbols.sym + debug_symbols: file=mysymbols.sym, offset=0x1000 + +This loads symbols from the specified file for use in Bochs' internal debugger. +Symbols are loaded into global context. This is equivalent to issuing ldsym +debugger command at start up. + +
+ +
port_e9_hack + +Example: + + port_e9_hack: enabled=1 + +The 0xE9 port doesn't exists in normal ISA architecture. However, we +define a convention here, to display on the console of the system running +Bochs anything that is written to it. The idea is to provide debug output +very early when writing BIOS or OS code for example, without having to +bother with setting up a serial port or etc. Reading from port 0xE9 will +will return 0xe9 to let you know if the feature is available. Leave +this 0 unless you have a reason to use it. + +
+ +
user_plugin + +Example: + + user_plugin: name=testdev + +Load user-defined plugin. This option is available only if Bochs is +compiled with plugin support. Maximum 8 different plugins are supported. +See the example in the Bochs sources how to write a plugin device. + +
+ +
+ +
How to write your own keymap table + +Christophe Bothamy wrote the keymapping code for Bochs, and provided this +documentation for how to create new keymaps. Keymapping was first +implemented for X windows only, so there are many references to X-specific +values in this section. In Bochs 2.0 keymapping is also available for SDL +(Linux port) and wxWidgets (wxGTK port). + + + The standard US Keyboard looks like this: + + ------------------------------------------- + Top row Esc F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 + ------------------------------------------- + 2nd row ` 1 2 3 4 5 6 7 8 9 0 - = \ Back + ------------------------------------------- + 3rd row Tab Q W E R T Y U I O P [ ] Enter + ------------------------------------------- + 4rd row Caps A S D F G H J K L ; ' + ------------------------------------------- + 5rd row lShift l\ Z X C V B N M , . / rShift + ------------------------------------------- + 6rd row lCtrl lAlt Space rAlt rCtrl + ------------------------------------------- + + + +Each key of the US keyboard maps to a Bochs constant named +BX_KEY_symbol. You can find the current list of +BX_KEY_symbol in +the BX_KEY table, below. Please note that +there is only one BX_KEY_symbol for each physical +key. + + + +Now, for each key of the US keyboard, look at which symbols you can type on your +real keyboard. Each symbol maps to a X-windows +XK_symbol constant. In +X11/keysymdef.h, you will find the list of all possible +XK_symbol on your system. Alternatively, you can +use a small utility called "xev" that prints out the symbol names of a pressed +key. Note that the symbol name given by xev does not contain the XK_ prefix. +Don't forget to add a line for every symbol you can type on each key. For the +key BX_KEY_A, you can type both lowercase 'a' and uppercase 'A', so you would +need two different entries. + + + +You can then create your own map file. Keymap files are found in the +"gui/keymaps" directory in the source code, or in the "keymaps" directory in +binary releases. Look at the existing keymap file as an example, and create a +file containing one line for each symbol. The first column tells what key or +combination of keys can be used to produce a given symbol. The second column +is the ASCII equivalent for that symbol, or a special keyword (none, space, +return, tab, backslash, or apostrophe). The third column is the X windows +keysym for that symbol. + + + + +For example : + +BX_KEY_0 '0' XK_0 +BX_KEY_1 '1' XK_1 +BX_KEY_2 '2' XK_2 +BX_KEY_0+BX_KEY_SHIFT_L ')' XK_parenright +BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam +BX_KEY_2+BX_KEY_SHIFT_L '@' XK_at +BX_KEY_A 'a' XK_a +BX_KEY_B 'b' XK_b +BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A +BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B +BX_KEY_TAB tab XK_Tab +BX_KEY_ENTER return XK_Return +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 + + + + +Now that there are several keymap files in the Bochs distribution, it is +easiest to copy an existing keymap and follow the examples you see. When it +works, be sure to send it to the mailing list or post it on Source Forge so +that we can include it in the next release. You may need to look up some of +your country specific X11 symbols in X11/keysymdef.h. + + +BX_KEY constants + + + + BX_KEY constant + Keyboard Symbol + + + + +BX_KEY_CTRL_L left Ctrl +BX_KEY_SHIFT_L left Shift +BX_KEY_F1 F1 +BX_KEY_F2 F2 +BX_KEY_F3 F3 +BX_KEY_F4 F4 +BX_KEY_F5 F5 +BX_KEY_F6 F6 +BX_KEY_F7 F7 +BX_KEY_F8 F8 +BX_KEY_F9 F9 +BX_KEY_F10 F10 +BX_KEY_F11 F11 +BX_KEY_F12 F12 +BX_KEY_CTRL_R right Ctrl +BX_KEY_SHIFT_R right Shift +BX_KEY_CAPS_LOCK CapsLock +BX_KEY_NUM_LOCK NumLock +BX_KEY_ALT_L left Alt +BX_KEY_ALT_R right Alt +BX_KEY_A A +BX_KEY_B B +BX_KEY_C C +BX_KEY_D D +BX_KEY_E E +BX_KEY_F F +BX_KEY_G G +BX_KEY_H H +BX_KEY_I I +BX_KEY_J J +BX_KEY_K K +BX_KEY_L L +BX_KEY_M M +BX_KEY_N N +BX_KEY_O O +BX_KEY_P P +BX_KEY_Q Q +BX_KEY_R R +BX_KEY_S S +BX_KEY_T T +BX_KEY_U U +BX_KEY_V V +BX_KEY_W W +BX_KEY_X X +BX_KEY_Y Y +BX_KEY_Z Z +BX_KEY_0 0 +BX_KEY_1 1 +BX_KEY_2 2 +BX_KEY_3 3 +BX_KEY_4 4 +BX_KEY_5 5 +BX_KEY_6 6 +BX_KEY_7 7 +BX_KEY_8 8 +BX_KEY_9 9 +BX_KEY_ESC Esc +BX_KEY_SPACE SpaceBar +BX_KEY_SINGLE_QUOTE ' +BX_KEY_COMMA , +BX_KEY_PERIOD . +BX_KEY_SLASH / +BX_KEY_SEMICOLON ; +BX_KEY_EQUALS = +BX_KEY_LEFT_BRACKET [ +BX_KEY_BACKSLASH \ +BX_KEY_RIGHT_BRACKET ] +BX_KEY_MINUS - +BX_KEY_GRAVE ` +BX_KEY_BACKSPACE BackSpace +BX_KEY_ENTER Enter +BX_KEY_TAB Tab +BX_KEY_LEFT_BACKSLASH left \ +BX_KEY_PRINT PrintScreen +BX_KEY_SCRL_LOCK ScrollLock +BX_KEY_PAUSE Pause +BX_KEY_INSERT Ins +BX_KEY_DELETE Del +BX_KEY_HOME Home +BX_KEY_END End +BX_KEY_PAGE_UP PageUo +BX_KEY_PAGE_DOWN PageDown +BX_KEY_KP_ADD Numeric Keypad + +BX_KEY_KP_SUBTRACT Numeric Keypad - +BX_KEY_KP_END Numeric Keypad 1 +BX_KEY_KP_DOWN Numeric Keypad 2 +BX_KEY_KP_PAGE_DOWN Numeric Keypad 3 +BX_KEY_KP_LEFT Numeric Keypad 4 +BX_KEY_KP_5 Numeric Keypad 5 +BX_KEY_KP_RIGHT Numeric Keypad 6 +BX_KEY_KP_HOME Numeric Keypad 7 +BX_KEY_KP_UP Numeric Keypad 8 +BX_KEY_KP_PAGE_UP Numeric Keypad 9 +BX_KEY_KP_INSERT Numeric Keypad 0 +BX_KEY_KP_DELETE Numeric Keypad . +BX_KEY_KP_ENTER Numeric Keypad Enter +BX_KEY_KP_MULTIPLY Numeric Keypad * +BX_KEY_KP_DIVIDE Numeric Keypad / +BX_KEY_UP UpArrow +BX_KEY_DOWN DownArrow +BX_KEY_LEFT LeftArrow +BX_KEY_RIGHT RightArrow +BX_KEY_WIN_L Left Windows +BX_KEY_WIN_R Right Windows +BX_KEY_MENU Menu +BX_KEY_ALT_SYSREQ Alt-Sysreq +BX_KEY_CTRL_BREAK Ctrl-Break +BX_KEY_INT_BACK Internet - back +BX_KEY_INT_FORWARD Internet - forward +BX_KEY_INT_STOP Internet - stop +BX_KEY_INT_MAIL Internet - mail +BX_KEY_INT_SEARCH Internet - search +BX_KEY_INT_FAVInternet - favorites +BX_KEY_INT_HOME Internet - home +BX_KEY_POWER_MYCOMP Powerkeys - my computer +BX_KEY_POWER_CALC Powerkeys - calculator +BX_KEY_POWER_SLEEP Powerkeys - sleep +BX_KEY_POWER_POWER Powerkeys - power +BX_KEY_POWER_WAKE Powerkeys - wake + + + +
+
+ +
+ +Using Bochs + +After starting Bochs either from the command prompt or the OS shell, the following +steps are done before the simulation is running. + +parse command line (except bochsrc options) +load selected config file (bochsrc) or search for the default one +parse remaining command line options (bochsrc syntax) +initialize configuration interface +enter start menu / dialog (unless quick start mode is enabled) +initialize all parts of the simulator +enter debugger prompt / dialog (if present) +enter the simulation loop + + + +During simulation, Bochs usually generates more or less log output. By default it +is sent to the console, otherwise to the specified log file. +The amount of output can be controlled with the log options +in bochsrc, the start menu and the runtime configuration. + + +Under certain conditions Bochs can cause a panic +and usually asks the user what to do. If such a panic happens during startup, it is +mostly a configuration or permission problem and we recommend to quit Bochs and to +review the bochsrc options used. + + +To quit the simulation, the "power" button in the Bochs headerbar +should be used, unless the guest OS has the capability to turn off the computer (APM or ACPI). + + +If a Bochs runtime issue cannot be fixed by configuration changes and it has not yet +been reported in the &devlist; or the SF trackers for Bochs, it should be reported in +the mailing list or the SF bug tracker for the Bochs project. + + +
Command line arguments + +The following table shows the arguments that can be used on the command line. +For other arguments, see section bochsrc. + +command line arguments + + + +Argument +Description + + + + + -q + quick start (skip configuration interface) + + + -f filename + specify configuration file + + + -log filename + specify Bochs log file + + + -dbglog filename + specify Bochs internal debugger log file + + + -n + don't try to load a configuration file + + + -r path + specify path for restoring state + + + -noconsole + disable console window (Windows only) + + + --help + display help message and exit + + + --help features + display available features / devices and exit + + + --help cpu + display supported CPU models and exit (CPU level > 4 only) + + + +
+
+ +These arguments are handled directly after starting Bochs. The next step is to load +a default or specified configuration file (unless disabled with -n). Then the rest +of the command line (bochsrc options) is parsed. This is done after reading the +configuration file so that the command line arguments can override the settings +from the file. + +
+ +
Search order for the configuration file + +If no configuration file is specified on the command line and config file loading +is not disabled, Bochs searches for a default configuration file. This is the search order: + + + +.bochsrc in the current directory + + + + +bochsrc in the current directory + + + + +bochsrc.txt in the current directory + + + + +(win32 only) bochsrc.bxrc in the current directory + + + + +(Unix only) .bochsrc in the user's home directory + + + + +(Unix only) bochsrc in the /etc directory + + + + +
+
The configuration interface 'textconfig' + +The configuration interface 'textconfig' is the text mode version of the Bochs +configuration system. It is a series of menus (using stdin/stdout) that allows +you to edit all the settings that control Bochs' behavior. If you do not write +a config_interface line, Bochs will choose it as the default for you (unless Bochs +is compiled for Win32 or wxWidgets only). + + +It consists of these three parts: + +the start menu +the headerbar buttons +the runtime configuration + + + +On Win32 (without wxWidgets) the default configuration interface 'win32config' is +very similar, but it presents gui dialogs instead of text menus. + +
The start menu + +If you start Bochs without the quickstart argument (-q), the Bochs configuration +main menu appears: + +------------------------------ +Bochs Configuration: Main Menu +------------------------------ + +This is the Bochs Configuration Interface, where you can describe the +machine that you want to simulate. Bochs has already searched for a +configuration file (typically called bochsrc.txt) and loaded it if it +could be found. When you are satisfied with the configuration, go +ahead and start the simulation. + +You can also start bochs with the -q option to skip these menus. + +1. Restore factory default configuration +2. Read options from... +3. Edit options +4. Save options to... +5. Restore the Bochs state from... +6. Begin simulation +7. Quit now + +Please choose one: [5] + + + +Here you can load, edit and save the configuration and finally start the simulation. +It is possible to start Bochs without a config file and to edit all the settings using +the item "Edit options". Don't forget to save the configuration if you want to use this +setup for another Bochs session. + +
+ +
The Bochs headerbar + + + + +The headerbar appears on top of the Bochs simulation window. Here you can control the +behavoiur of Bochs at runtime if you click on one of these buttons: + + +floppy buttons + + Here you can toggle the status of the floppy media (inserted/ejected). Bochs for + win32 presents you a small dialog box for changing the floppy image. You can + setup floppy drives using floppya/floppyb option. + + + +cdrom button + + Here you can toggle the media status of the first CD-ROM drive (inserted/ejected). + CD-ROM drives can be set up using ata(0-3)-master/-slave option. + On some platforms this button brings a up a small dialog box for changing the + CD-ROM image. + + + +mouse button + + Here you can enable the creation of mouse events by the host. Once mouse + events are captured, you cannot reach the button anymore, in order to disable + capturing again. By default you can enable and disable the mouse capture pressing + the CTRL key and the third (middle) mouse button. See the mouse option + parameter 'toggle' for other methods to toggle the mouse capture. + + + Changing the mouse capture at runtime is not supported by all display libraries, + but it is already present on RFB, SDL, SDL2, VNCSRV, Win32, wxWidgets and X11. + + + Support for 2 button mouse to toggle the capture mode not yet complete - using + another toggle method is recommended in that case. + + + +user button + + Press this button if you want to send the keyboard shortcut defined with the + user_shortcut parameter of the keyboard + option to the guest. Depending on the used display_library option, + it may even be possible to edit the shortcut before sending it. + + + +copy button +The text mode screen text can be exported to the clipboard after pressing this +button. The button has no effect in graphics mode. + + +paste button +Text in the clipboard can also be pasted, through Bochs, to the +guest OS, as simulated keystrokes. Keyboard mapping must be enabled to make this +feature work. + + +snapshot button +Press this button if you want to save a snapshot of the Bochs screen. All +text and graphics modes are now supported. If gui dialogs are supported (e.g. on win32) +Bochs presents you a "Save as..." dialog box to specify the filename. All other +platforms are using the fixed filenames "snapshot.txt" or "snapshot.bmp". + +config button +This button stops the Bochs simulation and starts the runtime configuration. +(see below). + + +reset button +Press this button to trigger a hardware reset. + + +suspend button +Press this button to save current simulation state to a disk. The simulation +could be restored back using bochs -r command. For more details read the +Save and restore simulation section. + + +power button +This button stops the simulation and quits bochs. + + + + +Some of this features may not be implemented or work different on your host platform. + +
+
The runtime configuration + +If you want to change certain settings at runtime, you have to press the "config" button in +the headerbar. The simulation stops and the runtime menu appears on the console window / xterm. + +--------------------- +Bochs Runtime Options +--------------------- +1. Floppy disk 0: /dev/fd0, size=1.44M, inserted +2. Floppy disk 1: floppyb.img, size=1.44M, inserted +3. 1st CDROM: (master on ata1) /dev/cdrom, ejected +4. 2nd CDROM: (slave on ata1) /dev/cdrecorder, ejected +5. 3rd CDROM: (not present) +6. 4th CDROM: (not present) +7. (not implemented) +8. Log options for all devices +9. Log options for individual devices +10. Instruction tracing: off (doesn't exist yet) +11. USB runtime options +12. Misc runtime options +13. Continue simulation +14. Quit now + +Please choose one: [15] + + + +In the runtime configuration you can change the floppy/cdrom image or device, +change the log options or adjust some other settings. If you have trouble with +a specific device, you can change the log options for this device only to get +more information (e.g. report debug messages). + +
+
+ +
Pre-defined CPU models + +If Bochs is compiled with cpu level 5 or higher the CPUID opcode is supported +and it can return some information about the cpu model and it's features. When +using a pre-defined CPU model in Bochs the features reported by CPUID are set up +according to the model's specification. The following table shows all available +CPU models with a short description. The amount of choices depends on the CPU +features enabled at compile time (3rd column). + +Bochs CPU models + + + + Value + Description + Required Features + + + + + bx_generic + Default Bochs CPU configured with CPUID option + cpu level 5 + + + pentium + Intel Pentium (P54C) + cpu level 5 + + + pentium_mmx + Intel Pentium MMX + cpu level 5 + + + amd_k6_2_chomper + AMD-K6(tm) 3D processor (Chomper) + cpu level 5 + + + p2_klamath + Intel Pentium II (Klamath) + cpu level 6 + + + p3_katmai + Intel Pentium III (Katmai) + cpu level 6 + + + p4_willamette + Intel(R) Pentium(R) 4 (Willamette) + cpu level 6 + + + core_duo_t2400_yonah + Intel(R) Core(TM) Duo CPU T2400 (Yonah) + cpu level 6 + + + atom_n270 + Intel(R) Atom(TM) CPU N270 + cpu level 6 + + + p4_prescott_celeron_336 + Intel(R) Celeron(R) 336 (Prescott) + cpu level 6, x86-64 + + + athlon64_clawhammer + AMD Athlon(tm) 64 Processor 2800+ (Clawhammer) + cpu level 6, x86-64 + + + athlon64_venice + AMD Athlon(tm) 64 Processor 3000+ (Venice) + cpu level 6, x86-64 + + + turion64_tyler + AMD Turion(tm) 64 X2 Mobile TL-60 (Tyler) + cpu level 6, x86-64 + + + phenom_8650_toliman + AMD Phenom X3 8650 (Toliman) + cpu level 6, x86-64 + + + core2_penryn_t9600 + Intel Mobile Core 2 Duo T9600 (Penryn) + cpu level 6, x86-64 + + + corei5_lynnfield_750 + Intel(R) Core(TM) i5 750 (Lynnfield) + cpu level 6, x86-64 + + + corei5_arrandale_m520 + Intel(R) Core(TM) i5 M 520 (Arrandale) + cpu level 6, x86-64 + + + corei7_sandy_bridge_2600k + Intel(R) Core(TM) i7-2600K (Sandy Bridge) + cpu level 6, x86-64, avx + + + zambezi + AMD FX(tm)-4100 Quad-Core Processor (Zambezi) + cpu level 6, x86-64, avx + + + trinity_apu + AMD A8-5600K APU (Trinity) + cpu level 6, x86-64, avx + + + ryzen + AMD Ryzen 7 1700 + cpu level 6, x86-64, avx + + + corei7_ivy_bridge_3770k + Intel(R) Core(TM) i7-3770K CPU (Ivy Bridge) + cpu level 6, x86-64, avx + + + corei7_haswell_4770 + Intel(R) Core(TM) i7-4770 CPU (Haswell) + cpu level 6, x86-64, avx + + + broadwell_ult + Intel(R) Processor 5Y70 CPU (Broadwell) + cpu level 6, x86-64, avx + + + +
+
+ +
Save and restore simulation + +Bochs has now full save/restore support. The state of cpu(s), memory, devices and +hard drive images + +The disk image mode "vvfat" does not support save/restore. All other disk image modes +copy the whole image or the file containing changes (journal). This may take some time, +so be patient when using this feature. + +can be saved. When running Bochs there will be a button in the +header bar called "Suspend". Depending on config interface and gui there will be a +prompt where you can enter a path to an existing directory or a gui folder selection +dialog box. It is possible to save the state at any time, but we recommend to do it +when the simulation is idle. After pressing OK/Enter, Bochs will save a set of files +into the selected folder. It is possible to continue after saving the state, but when +using the restore function in a new Bochs session, all changes after this checkpoint +will be lost. + + +To restore the saved simulation state you can select the restore function in the +text mode start menu or specify the restore path at the command line: + +bochs -r /path/to/save-restore-data + + + +Then Bochs will start up using the saved configuration and log options, restores +the state of the hardware and begins the simulation. In the restore mode Bochs +will ignore bochsrc options from the command line and does not load a normal +config file. + +
+ +
Using sound +
Sound basics + +Bochs supports two types of soundcards (SB16 ISA and ES1370 PCI) and the legacy +PC speaker. The lowlevel sound interface provides a set of functions for wave +(PCM) input / output and MIDI output using the host sound system. A driver must +not implement all of these functions. The following table shows the supported +drivers and their features. +Sound lowlevel modules + + + + Name + Description + Wave input + MIDI output + + + + + alsa + use the default ALSA PCM device and the default ALSA sequencer + on Linux + Yes + Yes + + + oss + use the Open Sound System on Linux and FreeBSD + Yes + Yes + + + osx + for output on Mac OS 9 and Mac OSX + No + Yes + + + sdl + for wave output on platforms supported by SDL (1.2.x or 2.x) + No + No + + + win + for output to the midi and wave mapper of Windows + Yes + Yes + + + +
+
+ +These special values are also valid for the sound driver: + + - select platform-default sound driver. + - wave and MIDI output to file(s) + - no output at all + + + +When compiling Bochs, the lowlevel sound support is activated if one of the soundcards +is enabled ( or ). +The configure script detects the available drivers and sets up a platform-default +one. + + +At runtime the lowlevel sound module will be loaded automatically if one of the +sound devices is enabled in the bochsrc. The drivers and +devices for wave input / output and MIDI output must be set up with the +sound option. + +
+
The PC speaker + +The PC speaker is connected to the PIT 8254 timer #2 and generates a square +wave beep with a frequency depending on the timer value. In Bochs the +speaker is a separate plugin that is controlled by the two events "beep on" +and "beep off". The "beep on" event is also called when the frequency +changes while turned on. + + +The destination for the speaker output can be selected with the +parameter of the speaker option. Three choices are available: + + : the beep is generated by the square wave +generator which is a part of the lowlevel sound support. + : only available on Linux and Windows. +On Linux /dev/console is used for output and on Windows the Beep() function. + : forwards the beep to the related gui methods +(currently only used by the Carbon gui). + + +
+
SB16 runtime configuration + +Most of the SB16 configuration parameters are available in the runtime +configuration menu or dialog. In addition to this, there is a small program +called SB16CTRL to change emulation settings from inside +the simulation. + +
Runtime options + +Unlike other devices, the SB16 emulation has it's own logfile and a loglevel parameter +to control what should be printed there. Both the file and + parameters can be changed at runtime. See the +sb16 bochsrc option for details. + + +The output parameters , , + and are also available at +runtime. + + +The parameter controls the DMA timing for wave (PCM) +input and output. When you get non-continuous sound this value can be ajusted +to fix this. This needs a reasonably correct setting for the +cpu: ips option. + +
+
SB16CTRL + + +The source for the SB16CTRL program that is used to modify +the runtime behavior of the SB16 emulation is included in +misc/sb16/. It is a C +program that can be run from inside the emulation. + + + +It currently supports the following commands: + + +Supported options for <command>sb16ctrl</command> + + + + Option + Description + + + + + + + Show the selected emulator info string, + e.g. sb16ctrl -i 3 to show how many patch translations are active. + + + + + + Load a translation into the translation table. The numbers are: + "OldBankMSB,OldBankLSB,OldProgram,NewBankMSB,NewBankLSB,NewProgram". + All values can be 0..127 or 255. 255 for "Old" values means match + any and for "New" values means don't change, + e.g. sb16ctrl -t 255,255,0,255,255,32 + to change patch 0 (Piano) to patch 32 (Acoustic Bass). + + + + + + Reset the patch translation table e.g. sb16ctrl -r. + + + + + + Upload the given numbers to the midi output device. Note + that it should be a complete midi message, and also that it is + subject to patch translation, + e.g. sb16ctrl -m 0x80,64,0 + to send a note-off message to channel 0. + + + + + + Read in a file and execute the commands in it. These have + the same format as the above commands, except that they don't have + the dash "-" in front of them. + Comment lines are supported and start with a hash sign "#". + + + + + + Show a brief summary of the commands. + + + + +
+ + +All numbers can be valid parameters to the strtol() function, so hex and +octal notation is fine. They have to be delimited by either commas "," or +slashes "/", spaces are not allowed. + + + +The command line can have any number of commands. However, if none are given, +"-f -" is assumed, which means commands are taken from stdin. + +
+
+
+
+ + + Common problems and what to do about them (Troubleshooting) +
+ Bochs panics! What can I do? + + Bochs does a very good job in emulating an x86 compatible computer, however, + it does not (yet) include a full (100%) emulation of every possible instruction, + (BIOS) function call or (hardware) device. Thus, in case something unusual + happens, either a not-so-common call to some (BIOS) function or device by + some software running inside of it, Bochs has two possibilities to react: + If the command doesn't look important (mainly happens only to non-implemented + functions in the BIOS), a notice is logged to the log file + and the emulation continues. If, however, the command looks important, Bochs + panics, because the software being emulated might depend on the successful + execution of the given instruction or behavior of the device. + + + A panic does not always mean that the software won't run inside of Bochs, + as the software might just be probing the computer for the presence of some + instruction/device, and in case it is not found, it simply won't be used at + all, by the software. + + + You can tell Bochs what to do in case of a panic, by re-configuring the + panic option. If + you change the action to "ask", Bochs reports what has happened and asks + you what to do. The appearance of the "ask" feature depends on the display + library used and the platform. Some display libraries don't support it at all. + + + Some of the device names reported in the panic message are abbreviations, + since the length of the 'prefix' is limited to 6 characters. The + log function module table may help + you finding out the name of the device that caused the panic. It also gives + you a short description of the module. + +
+ +
+ Mouse behavior, enabling and disabling + + Refer to for information on how to enable or + disable the mouse inside of Bochs at run-time. + + + The mouse cursor movement speed mostly doesn't match the real movement. This + is caused by the variable emulation speed (from the user's point of view) + and the relative mouse position data that standard PS/2, serial or USB mice + are generating. The alternative is the USB tablet emulation that generates + absolute mouse position data. We recommend to use it with the display + libraries 'rfb' and 'vncsrv'. + +
+ +
+ Text-mode is broken in some ancient DOS program + + + If you are using a program written for DOS which seems to use the text-mode but + doesn't display the text properly, you can try the other VGA BIOS, either + VGABIOS-lgpl-latest or VGABIOS-elpin-2.40, + see the vgaromimage option. + + + + &NEEDHELP; Maybe it is a bug in the LGPL VGA BIOS, but for now, it seems to work. + +
+
+ + +Feedback and Support +
+The Bochs project on SourceForge + +The Bochs project page +on SourceForge provides these features: + + +Project summary page with screenshots and download statistics + + +Download area for Bochs release packages and disk images + + +Mailing list archives + + +Source code browser + + +Tickets section (bug reports, patches, feature requests etc.) + + +Discussion boards (e.g. "Help" and "Open Discussion") + + +Project news page (used for release announcements) + + + +
+SourceForge tickets section (bug and patch trackers) + +There are some requirements when submitting bug reports, patches and feature +requests for Bochs to make it easier to reproduce bugs and test patches. + +
Reporting errors from Bochs compilation + +When reporting errors while building Bochs to the &devlist; or the SF bug +tracker for the Bochs project, this information is required to fix the issue: + + host platorm / build environment + Bochs release version or SVN revision + configure options used + full error message + config.log output if configure failure + source file name and line number if compile error + + + +Before reporting us the issue, make sure that a similar one hasn't been already +reported or someone created a patch to fix it. If you are familiar with C++ +and you can write some code to fix your problem, you can post it in the &devlist; +or submit the patch in SF patch tracker for Bochs. + +
+
Reporting Bochs runtime issues + +If Bochs does not work properly (e.g. panic, segfault, malfunction of emulated device) +we need some information to find out what's going on: + + Bochs version used (version number if binary release / SVN revision + if self-compiled) + host platorm / build environment (if self-compiled) + bochsrc options used + error message (if panic or program termination) + log file output (related section only if too big) + + +
+
Submitting a patch for Bochs + +Patches for Bochs should be provided in the "unified diff" format. In addition +to the patch file and a detailed description this information is required: + + patch applies to Bochs release version / SVN revision + test case (if required) + + + +When you are are interested in writing a patch to fix bugs or add new features, +you should have a look at the developer documentation. +For some parts of the Bochs code we have already written some basic information. + +
+
+
+
+Mailing Lists + +The Bochs community uses three mailing lists to communicate, called +bochs-developers, bochs-cvs and bochs-announce. + + +
bochs-developers mailing list + +Bochs-developers is the forum for all Bochs discussions and questions. On +average, subscribers get between five and ten messages per day. There are +about 350 subscribers. If this sounds like too much email, maybe the bochs-announce list is more appropriate for +you. Anyone may join the list, unless they abuse it of course. + + +To subscribe, go to the Bochs-Developers Info Page and type your email +address and a password into the web form and click +Subscribe. In a few minutes you will get a confirmation +email. Follow the directions in the email to complete the subscription +process. To unsubscribe, go to the same +page and type your email address in the blank at the bottom and click +on Edit Options. Then type your password and click +Unsubscribe. + + +Once you have subscribed, you can write to +bochs-developers@lists.sourceforge.net to send a message to +everyone on the list. While it's possible to post without being a subscriber, +it's not recommended. If you aren't a subscriber, you might miss the response +to your question. + + +Archive of bochs-developers messages + +
+ +
bochs-announce mailing list + +Bochs-announce is a moderated, low-traffic list which carries only periodic +announcements of Bochs releases and important events. If you have a very +important and truly relevant Bochs announcement, you can try posting it to +bochs-announce, but the moderator will have to approve it before it will +go out. On average, bochs-announce subscribers get one or two messages +per month. There are about 75 subscribers. Anyone may join the list. + + + +To subscribe, go to the Bochs-Announce Info Page and type your email +address and a password into the web form and click Subscribe. +In a few minutes you will get a confirmation email. Follow the directions in +the email to complete the subscription process. To unsubscribe, go to the +same +page and type your email address in the blank at the bottom and click +on Edit Options. Then type your password and click +Unsubscribe. + + + +There is no need to subscribe to both lists, because all bochs-announce +messages are forwarded to the developers list. If you subscribe to both, you +will get 2 copies of every announcement. + + + +Archive of bochs-announce messages + + +
+ +
bochs-cvs mailing list + +This is the svn commit mailinglist (a unified diff email will be sent +whenever someone does a checkin in the bochs SVN repository). + + + +Archive of bochs-cvs messages + + +
+ +
Mailing List Etiquette + + +Here are a few guidelines for use of the Bochs mailing lists: + + + + +Please check the documentation before asking questions, but on this list you +are very UNLIKELY to get flamed and insulted for being a Bochs beginner. +Sending commercial promotions to the list probably will get you some angry +responses though. + + + +If you are having difficulty finding what you are looking for, try doing a search on Google. If you are searching for Bochs options, for example, you can use this syntax in the Google search box: + +configuration options site:bochs.sourceforge.net + +For best results, be sure not to put a space between "site:" and "bochs.sourceforge.net". Be sure to look at more than the first item on the search results. + + + + +If you still cannot find what you are looking for, be sure you are prepared when you post your question, and post in the right forum. Be sure you include important details, such as the operating system and version of your host, and what it is you are trying to do. If you are getting errors or something is not working, summarize what you checked and what you changed. This will help isolate the problem. + + + + + +Bochs is for everyone. If you are an experienced Bochs user or developer and are helping someone else, be considerate of the other person's feelings. We share a common interest, and we need to encourage each other and be supportive. + + + + +Also, keep in mind that messages are limited to 40K, so if you want to share a +large screen shot or disk image, put it on a web or FTP site and tell people +how to find it. Patches are usually small enough that they aren't a problem, +especially if compressed. + + + +Distribution of copyrighted material, or even offers to distribute copyrighted +material WILL NOT be tolerated. The Bochs Project does not distribute +any software (disk images) in violation of the license agreement, and users who +do so will be warned first and then blocked from the list if it happens again. +As an open source project, we rely on donated services from Source Forge and +other groups, and we can't afford to put them or ourselves at risk of legal +action. + + + +It is possible to subscribe and unsubscribe by email. If you do this, you must +write to bochs-announce-request or bochs-developers-request. Don't forget the +"-request" part or your subscribe message will go to 300+ people. + + +
+ +
+
+ +Tips and Techniques + +
Specify log options by device + +This table shows the name used for setting up the log actions per device, the +prefix that appears in the log file or when a panic occurs and a short description +of the module. This example shows how to turn on debug messages for a specific +device in bochsrc. + +debug: action=ignore, pci=report + +The names can be used in upper case or lower case, since the check is not case +sensitive. Note that the module names cannot be checked while reading the config +file, since most of the modules do not exist at this point. Invalid names or names +of modules not present in the current configuration will cause a panic when the +simulation is starting. + +Log function module names and prefixes + + + + Name + Prefix + Description + + + + + ACPI + ACPI + PIIX4 ACPI controller + + + apic0 + APIC0 + APIC of first CPU + + + BIOS + BIOS + System BIOS + + + busmouse + BUSM + Busmouse + + + BXVGA + BXVGA + VGA adapter with VBE support + + + CD1 + CD1 + Lowlevel CD-ROM support for the first device (if configured, there can be CD2, CD3, CD4, ...) + + + cirrus + CIRRUS + Cirrus SVGA + + + CMOS + CMOS + CMOS RAM + RTC + + + cpu0 + CPU0 + First CPU (SMP emulation can have cpu1, cpu2, cpu3,...) + + + devices + DEV + Devices subsystem + + + DMA + DMA + DMA controller + + + E1000 + E1000 + Intel(R) Gigabit Ethernet + + + es1370 + ES1370 + ES1370 soundcard + + + extfpuirq + EXFIRQ + External FPU IRQ + + + floppy + FLOPPY + Floppy controller + + + gameport + GAME + Standard PC gameport + + + GDBST + GDBST + GDB stub support + + + GUI + GUI + Generic GUI code + + + harddrv + HD + IDE HD/CD emulation + + + hdimage + IMG + Disk image support + + + ioapic + IOAPIC + I/O APIC + + + iodebug + IODBG + I/O interface to debugger + + + keyboard + KBD + PS/2 keyboard and mouse + + + keymap + KEYMAP + Keyboard mapping + + + logio + IO + Bochs logging subsystem + + + memory + MEM0 + Memory management + + + MACGUI + MGUI + MacOS9 / MacOSX gui + + + NE2K + NE2K + NE2000 ethernet adapter + + + NOGUI + NOGUI + GUI without input/output interface ("nogui") + + + parallel + PAR + Parallel port support + + + PCI + PCI + i440FX PCI bridge + + + pci2isa + P2ISA + PCI-to-ISA bridge + + + pcidev + PCIDEV + Host PCI device mapping + + + pcipnic + PNIC + PCI pseudo NIC + + + pci_ide + PIDE + PCI IDE controller + + + pc_system + SYS + CPU-to-devices interface and timing control + + + PIC + PIC + Programmable interrupt controller + + + PIT + PIT + I/O interface for 82C54 timer + + + pit82c54 + PIT81 + 82C54 timer core + + + PLUGIN + PLUGIN + Plugin interface + + + RFB + RFB + RFB gui + + + SB16 + SB16 + SB16 soundcard + + + SCSICD + SCSICD + SCSI CD-ROM emulation for USB + + + SCSIHD + SCSIHD + SCSI hard drive emulation for USB + + + SDL + SDL + SDL 1.2.x gui + + + SDL2 + SDL2 + SDL 2.x gui + + + serial + SER + Serial port emulation + + + serial_raw + SERR + Lowlevel serial port support + + + siminterface + SIM + Simulator interface + + + slowdown_timer + STIMER + Slowdown timer + + + speaker + PCSPK + Lowlevel support for the PC speaker + + + VGAGUI + VGAGUI + SVGA gui + + + TERM + TERM + Term gui + + + unmappped + UNMAP + Unmapped I/O handler + + + usb_cbi + USBCBI + USB (UFI/CBI) floppy emulation + + + usb_ehci + EHCI + USB EHCI controller + + + usb_hid + USBHID + USB HID device emulation + + + usb_hub + USBHUB + External USB hub emulation + + + usb_msd + USBMSD + USB MSD (disk/cdrom) emulation + + + usb_ohci + OHCI + USB OHCI controller + + + usb_printer + USBPR + USB printer emulation + + + usb_uhci + UHCI + USB UHCI controller + + + usb_xhci + XHCI + USB xHCI controller + + + VGA + VGA + Standard VGA + + + vgabios + VBIOS + VGA BIOS + + + virt_timer + VTIMER + Virtual timer + + + WINGUI + WINGUI + WIN32 gui + + + WX + WX + wxWidgets gui + + + XGUI + XGUI + X11 gui + + + +
+
+ +
How to make a simple disk image + +This was contributed by Greg Alexander in October 2001 and updated by +Volker Ruppert in October 2013. + + +What you need: + + + +An executable version of Bochs. See Downloading Bochs and Compiling Bochs. + + +The bximage program, included with Bochs. + + +A FreeDOS boot disk, or a boot disk from another OS capable of +producing DOS partitions (e.g. a Linux install disk). + + +(Optional) mtools, a program for manipulating DOS disks/images. + + + + + +
+Create a flat image + + + +Option 1: Using the Unix dd utility: + + + +You will need to know the geometry of the disk you want to +create. You have to compute the disk sector count: + + +Sectors = Cylinders * Heads * SectorsPerTrack + + + + +Use the dd command to create your file: + + +dd if=/dev/zero of=teaching.img bs=512 count=sectors + +(replace "sectors" with the number you computed at the +previous step). + + + +When you'll update your configuration file, please +fill in the same cylinders, heads and sector per +track values. + + + + +Option 2: Run bximage to create a disk image file. +You will be greeted with the following prompt: + + +======================================================================== + bximage + Disk Image Creation / Conversion / Resize and Commit Tool for Bochs + $ID: bximage.cc 11906 2013-10-23 08:35:21Z vruppert $ +======================================================================== + +1. Create new floppy or hard disk image +2. Convert hard disk image to other format (mode) +3. Resize hard disk image +4. Commit 'undoable' redolog to base image + +0. Quit + +Please choose one [0] + + + + +Since we want to create a new image, we have to type '1' +and then Enter. + +Do you want to create a floppy disk image or a hard disk image? +Please type hd or fd. [hd] + + + + +Since we are creating a hard disk image, accept the default of hd by +pressing Enter or typing 'hd' and pressing +Enter. Next, bximage will ask for the type of +hd to create: + + +What kind of image should I create? +Please type flat, sparse, growing or vpc. [flat] + + + + + +We want to create a simple flat image, so accept the default +by pressing Enter. Then, bximage will ask +for the size of the disk image you want to create, in Megabytes: + + +Enter the hard disk size in megabytes, between 1 and 8257535 +[10] + + + + +Enter the size of the hard disk you want to create, and press +Enter. Then bximage will ask you for a filename to use +for the file it is creating. + +What should be the name of the image? +[c.img] + + + + +At this point, type in the filename you want to use for the image. The +default of "c.img" is appropriate if this will be your only hard disk +image. After you have typed in the name of the filename you want to +use, press Enter. Bximage will tell you it is writing the disk +and then it will show you a line that should be added to your +bochsrc when you want to use this disk image. I named my +10 Megabyte image "teaching.img" and the output of bximage looked like +this: + + +[c.img] teaching.img + +Creating hard disk image 'c.img' with CHS=20/16/63 + + + + +The following line should appear in your bochsrc: + + ata0-master: type=disk, path="teaching.img", mode=flat, cylinders=20, heads=16, spt=63 + + + + +At this point, a file called "teaching.img" was created in my current +directory and is ready to be used as an image file for a Bochs session. + + + + +You may want to name your image teaching_20-16-63.img +so that you always know the values to use for CHS. + + +
+ +
+ +Partition and format your image file + + + +Option 1: Using FreeDOS (Advantage: Creates a MBR on the partition.) + + + +First, you need to edit the bochsrc file that Bochs uses for +configuration information (see ). Open bochsrc +with a text editor. Remove all lines in the file which start with "ata0-master:". Add the "ata0-master:" +line that was displayed when you ran bximage to bochsrc at the +same place where you removed the old "ata0-master:" lines from. + + + +Also, you need to download or create a FreeDOS (or DOS, or Windows, or +Linux) disk image. Modify the "floppya:" line in your bochsrc to point +at the downloaded FreeDOS floppy image and change its status to "status=inserted". + + + +Save and close your bochsrc. Now run Bochs (see ). + + + +Use the standard FreeDOS commands fdisk and +format to format your hard +drive image. You must make the image bootable to be able to boot +without a floppy disk. However, creating a bootable disk image is best +done with a boot disk from the OS you intend to install on the image. + + + + +Option 2: Using mtools (Disadvantage: Cannot create bootable images +without a MBR image.) + + + +Use a text editor to add the following line to the file ~/.mtoolsrc: + + + + +drive c: file="path/filename.img" partition=1 + + + + +Save and close .mtoolsrc. Next, execute the following commands to +create a partition table for the drive image: + + + + +mpartition -I -s spt -t cyl -h heads c: +mpartition -cpv -s spt -t cyl -h heads c: + + + +For example, for my 10 meg drive, I used: + +mpartition -I -s 63 -t 20 -h 16 c: +mpartition -cpv -s 63 -t 20 -h 16 c: + + + + + +Next, format the partition you just created using the mformat command: + + +mformat c: + + + + + +And you now have a formatted disk image containing a single DOS +partition. + + +The mpartition command doesn't handle images larger than 1024 cylinders properly. +The partition size reported by fdisk is okay, but mformat reports only 504 MB +(tested with mtools 3.9.9). + +
+
+ +
Use mtools to manipulate disk images + +Mtools is a set of programs that can read, write, and format DOS disk images. +There are links to the Mtools main page and a Win32 port of Mtools on the +Bochs Links page, +under Resources. + + +The mtools web site has a detailed manual. If anyone wants to write +instructions specific to Bochs, we can add it right here. + +
+ +
Bochs GNU/Linux DiskTools + +Bochs-Tools are a collection of scripts and programs to be used together +with Bochs developed by Bernhard Bablok. Main goal was to provide a more +Unix-like interface to the emulator and to enable access to Bochs disk-images +from outside of Bochs. The latest version is available at +www.bablokb.de/bochs-tools. + +
+ +
Win32 only: Tools to manipulate disk images + +
Winimage + +Someone on the &devlist; mentioned that they use a program +called WinImage, from www.winimage.com +to read and write disk images (floppy and hard disk). Winimage is a +commercial product with a 30-day trial. + + +If anyone wants to write a tutorial, send mail to &devlist; and volunteer. + +
+ +
DiskExplorer + +This section was contributed by Luca Cassioli and Stanislav Shwartsman + + +I eventually found what all of you were looking for for a long time: a +freeware, graphical, win32 compatible HardDisk image editor! It can +handle a large variety of formats, but the one you need is VMWARE +2.0 PLAIN DISK: you can import/export to/from Bochs images COMPLETE +DIRECTORIES! + + +You can find it at + +http://hp.vector.co.jp/authors/VA013937/editdisk/index_e.html + +
+ +
Ben Lunt's MTOOLs for Bochs and Win32 and/or DOS + +Ben Lunt wrote a set of utilities for Dos/Win32 to manipulate flat disk images. + + +You can find it at + +http://www.fysnet.net/mtools.htm + + +These utilities includes : + + + BOCHSRC.EXE "Bochs Resource" + A utility to create/modify a Bochs resource file. + + + MKDOSFS.EXE "Make DOS FS" + A utility to create a FAT disk image of specified size. + + + MCOPYF.EXE "Copy From" + A utility to copy an existing file from a FAT disk image to the current + directory. + + + MDEL.EXE "Delete file" + A utility to delete an existing file from a FAT disk image. + + + MDIREX.EXE "Directory Extended" + A utility to view a FAT disk images directory and FAT contents. + + + MGETIMG.EXE "Get Disk Image" + A utility to create a disk image from a floppy (multiple formats). + + + MBOOTCD.EXE "Create a CDROM Image with boot options" + Create a CDROM image capable of booting with only a ROOT and a single file. + + + MGETCD.EXE "Get Disk Image of Physical CD" + A utility to create a disk image from a CD. + + + MCDINFO.EXE "Get CD Info" + A utility to the info from a CD. Not much yet, but a little. + + + + +
+ +
+ +
X Windows: Color allocation problems + +One common problem in X windows is that the screen colors can be abnormal +if other X programs have already allocated all the colors. If the colors +don't look right, try quitting colorful applications such as Netscape, +clearing any complex images in the background, etc. so that Bochs has a +chance to allocate the colors it needs. + + +If Bochs continues to have problems, or you want Bochs to have perfect +colors without having to quit any other application, you can try turning +on the private_colormap option +in the configuration file. Using a private +colormap causes the Bochs window to have its own set of 256 colors to work +with. When the cursor is over the Bochs display, Bochs will look correct +and other parts of the screen may change to very strange colors. When the +cursor goes to any other window, the other windows will look correct +and Bochs will have strange colors. A better solution, if your hardware +can support it, is to run your X server with 24-bit or 32-bit color. + +
+ +
Screen saver turns on too quickly + + +One thing you may notice is that the screen saver turns on (screen goes +blank) very quickly after you have stopped typing. The reason is that Bochs +simulates everything as fast as it can. If the CPU is very busy (running +instructions nonstop), simulated time goes by slowly. If the CPU is idle (just +waiting for you to type, for example), simulated time speeds up dramatically. +In any case, if the screen saver blanks out the screen, just press a key (try +shift or control) to restore the screen. + + + +There are two strategies to fix this problem. One is to increase the +ips parameter of the cpu option +in your configuration file. This will cause the simulation time +to pass more slowly. The other strategy is to enable the experimental +realtime PIT, which tries to keep Bochs in sync with real time. See the bochsrc +option clock. + + +
+ + +
Mounting a disk image using the loop device + + +This section describes how to access a floppy or hard disk image within Linux +using the loop device. Why would you want to do this? Let's say you have made +a small Linux disk image for Bochs, and you want to install some more software +on it. You have already downloaded the software onto your real system, so now +you want to transfer it to the Bochs disk image. A fast way to transfer +the files is to mount the disk image using the loop device. + + +
...on Linux + + +This section was contributed by Volker Ruppert. + +Today I have made some tests with the loop device, because I want to exchange +files with the bochs disk images. This is what I found out: + +1. Using Floppy images is easy, because there is no partition table: + + losetup /dev/loop0 /usr/local/bochs/dlxlinux/floppya.img + + Now you can use the image like a real floppy: + + - format : mkfs.minix /dev/loop0 + - filesystem check : fsck.minix /dev/loop0 + - mount : mount /dev/loop0 -o loop /mnt/floppy + + Before you want to restart bochs you must do this: + + losetup -d /dev/loop0 + + Don't forget to umount before. + +2. If you want access to a hard disk image, you have to calculate the size of + the first cylinder. This value is the offset argument for losetup. + + offset = bytes per sector * sectors per cylinder + + The command for dlxlinux image looks like this: + + losetup /dev/loop0 /usr/local/bochs/dlxlinux/hd10meg.img -o 8704 + + For images created by bximage you must use the value 32256. + +3. The hard disk image access doesn't work if the image contains more than + one partition. + +4. I have made this tests with Linux and I don't know how + this could be done with other operating systems. + + + +
+ +
...on FreeBSD + + +This section was contributed by Alexander Schuch. + + +The following example mounts a Windows 95 hard disk image called Windows 95 B (2031-16-63) +into the FreeBSD file system. It is specific to FreeBSD 5.x; for +hints on how to do the same task on FreeBSD 4.x, or for more information in +general, check the proper section of the FreeBSD handbook: +Network, Memory, and File-Backed File Systems. +You can use the same procedure for mounting floppy disk images. + + + + +# mdconfig -a -t vnode -f "Windows 95 B (2031-16-63)" +md0 + +mdconfig returns the device, your file now is accessable from. + +# mount -t msdosfs /dev/md0s1 /mnt + +If you already have other md devices configured, you need to substitute md0s1 +with, for example, md6s1. + + + +Once you are done working with the image, unmount the md device and detach it. + +# umount /mnt +# mdconfig -d -u 0 + +And again, if there are other md devices configured, use the proper device +number. In case you forgot the number, just ask mdconfig, like: + +# mdconfig -l +md7 +# mdconfig -d -u 7 + + + +
+ +
+ +
Simulating a Symmetric Multiprocessor (SMP) Machine + +Bochs can now simulate an SMP machine when you use in the +configure command. SMP support was added by Bryce Denney, who +was very interested in watching a multiprocessor operating system work +at a low level. It should also be helpful to operating system developers +who are writing SMP drivers, or just for users who want to test drive +an SMP machine to see what it looks like. + + +Starting with Bochs 2.2.6 you can set up the number of processors in the +bochsrc. See how to +set up the number of processors. + + +It is important to understand that configuring bochs for 4 processors will NOT +make your single-threaded applications run faster in general! On the contrary, +it has to spend time simulating idle processors as well as the ones doing your +task. The point is to simulate an SMP system, not to speed up a uniprocessor +application. + + + +What was required to make SMP work in Bochs? + + + local APIC on each processor with timer + + one I/O APIC model + + implement RDTSC (read time stamp counter) + + a data structure called the Intel Multiprocessor Configuration +must be present in BIOS memory space. An SMP-aware operating system probes BIOS +memory to find the structure, which contains information about how many +processors, their IDs, interrupt sources, etc. Starting with Bochs 2.2.5 these +structures are dynamically created by Bochs. + + ACPI support is required to boot SMP system in most of modern +operating systems. For example WinXP 64 bit require ACPI support even for +single processor configuration. + + + + + +What needs to be done to improve SMP support? + + + +debugger support is still limited. For example, you can set breakpoints, +but you can't specify which processor you want to set the breakpoint for. + + + +test on any possible SMP operating systems. Currently success reported for +Knoppix 4.0.2, WinNT 4.0 and WinXP SMP. + + + +several parts of the APIC model which weren't needed before are not +implemented yet. + + + +A number of people have suggested using threads to simulate each CPU in +a different thread. Then on a real SMP machine, the threads can execute +in parallel. This is a great idea, but it's not done at present. + + + +
+ +
Setting Up Networking in DLX Linux + +All Bochs binaries come with a working version of DLX Linux. This section +describes how to configure networking in Bochs and enable it within +DLX Linux. First you must add a ne2k line in your bochsrc +file. Then, when you boot the DLX Linux image, you need to type some Linux +commands to set up an IP address, a network route, and a name server. + + + +When you have an ne2k line in your bochsrc file, Bochs +will emulate a network card called an NE2000. Below are some examples of valid +ne2k lines for various operating systems. Choose the +one that's closest to what you need, add it to your bochsrc file, and +edit the values if necessary. + + # sample for Mac OS X + ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=en0 + # sample for FreeBSD + ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=fbsd, ethdev=xl0 + # sample for Linux + ne2k: ioaddr=0x300, irq=9, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0 + # sample for Windows + ne2k: ioaddr=0x300, irq=9, mac=00:c4:3B:00:C3:00, ethmod=win32, ethdev=NE2000 + +You see the pattern. Usually you won't need to change the I/O address, IRQ +number, or MAC address. The ethmod value depends on your +host operating system, and it must be either null, +fbsd (for FreeBSD or OpenBSD), linux, +or win32. The ethdev setting is the +name of the network interface on your system, and is also OS-dependent. On +UNIX systems you can get the name of the network interface by running +ifconfig. (Don't choose the loopback interface.) On +Windows systems, the correct ethdev setting is not always obvious, so we +provide a utility called niclist to list the names of +network interfaces to use. When you run niclist, it will +suggest an ne2k line which is a very good first try. + + + +Next, if you are on a UNIX machine you will need to become the root user. +Since bochs is sending and receiving raw network packets, you need to be root +to use the network device. To allow normal users to do this would be a +security problem. + + + +Now run Bochs to boot DLX Linux. Press enter a few times to accept the default +configuration choices. This tells Bochs read the configuration file and then +begin. DLX Linux should boot in the Bochs window, and you should see +that Linux detects the NE2000 card. Eventually it gets to a login prompt. + + ne.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov) + NE*000 ethercard probe at 0x300: b0 c4 20 00 00 00 + eth0: NE2000 found at 0x300, using IRQ 9. + + + + +At the login prompt, type "root" to log in as root. Then type the ifconfig and +route commands to set up networking. The exact IP numbers in the example won't +work for you; you must choose an IP configuration that is legal on your +network. + + + dlx login: root + Linux 1.3.89. + dlx:~# ifconfig eth0 192.168.0.99 # set bochs IP address + dlx:~# route add -net 192.168.0.0 # first 3 numbers match IP + dlx:~# route add default gw 192.168.0.1 # your gateway to the net + dlx:~# _ + + + + + +The bochs IP address must be an unused IP address on your +network. If you duplicate someone else's IP address, your network will +become very confused. + + + + +Finally, the network is ready and you can test it out with ping, telnet, or ftp +to various machines by their numerical IP address. Keep in mind that for all +UNIX host platforms, Bochs networking cannot talk to the host machine. That +means the host machine can't be the gateway either. You need another physical +machine on the network that bochs can talk to. On Win32 this restriction does +not apply. + + + + +When you have a working network configuration, you can make DLX Linux recreate +the same settings the next time you boot. Just add the ifconfig and route +commands to the end of /etc/rc.d/rc.inet1. I won't try to describe how +to use the vi editor in this limited amount of space... + + + + + + +To configure a name +server, set up /etc/resolv.conf with the IP address of +your name server as shown. + + dlx:~# echo 'nameserver 192.168.0.1' > /etc/resolv.conf + + +
+ +
Configuring and using a tuntap network interface + +If you use linux (optionally FreeBSD and Solaris, not tested), +you may want to access the network through a tuntap interface. The main +advantage of this interface, is that the guest has access to the host. The guest can even +have access to the whole network if the host routes or masquerades the guest requests. +No extra IP address is needed, all can be done using private IP addresses. + + + +You'll find here instructions to set up Linux/Bochs to provide network access to the guest OS +through a tuntap interface and private IP network. We're going to see howto : + + enable the tuntap interface in the Linux Kernel + configure Bochs to use the tuntap interface + set up the private network between the host and the guest + set up the host to masquerade the guest network accesses + + +
+ Tuntap description + +From the +tuntap.txt file in the Linux kernel tree : + + TUN/TAP provides packet reception and transmission for user space programs. + It can be viewed as a simple Point-to-Point or Ethernet device, which + instead of receiving packets from a physical media, receives them from + user space program and instead of sending packets via physical media + writes them to the user space program. + + When a program opens /dev/net/tun, driver creates and registers corresponding + net device tunX or tapX. After a program closed above devices, driver will + automatically delete tunXX or tapXX device and all routes corresponding to it. + + +
+ +
+ Set up the linux Kernel + <footnote><para>much of the information of the following section is taken from + <ulink url="http://maconlinux.org/lists/mol-general/August01/0056.html"> + this email from Samuel Rydh of the Mac-On-Linux list</ulink></para></footnote> + +First make sure the tuntap module is included in the kernel : + + + if you use a recent distribution, chances are that the needed modules are already build + Make sure that "Kernel module loader" - module auto-loading support is enabled in your kernel. + Add following line to the /etc/modules.conf: alias char-major-10-200 tun + Run: depmod -a The driver will be automatically loaded when application access /dev/net/tun. + + + Otherwise, recompile the kernel, including the configuration option + CONFIG_TUN (Network device support -> Universal TUN/TAP device driver support) + + + + + +Make sure there is a /dev/net/tun device. +(Can be created with 'mkdir /dev/net ; mknod /dev/net/tun c 10 200'). + + + + +In the same way, to use masquerading, you need a kernel with the following options : + + CONFIG_IP_NF_CONNTRACK (Connection tracking) + CONFIG_IP_NF_IPTABLES (IP tables support) + CONFIG_IP_NF_NAT (Full NAT) + + + +Some of the other options in this group is probably also needed, +(but the default setting should be OK). + + + +
+ +
+ Configure Bochs to use the tuntap interface + Make sure Bochs has one of the network adapters enabled. If you + have to recompile Bochs, use or + when running ./configure + (see ) + + edit your .bochsrc configuration file and add something like : + ne2k: ioaddr=0x300, irq=9, mac=fe:fd:00:00:00:01, + ethmod=tuntap, ethdev=/dev/net/tun0, script=/path/to/tunconfig + + + + Since the tuntap interface cannot be configured until a process opens it, + Bochs may run a script file for you. In this case + /path/to/tunconfig should be changed to match + the actual place where you'll create this script. + +
+ +
+Set up the private network between the host and the guest + + We'll set up a private network between the host and the guest with the following parameters: + + Host IP : 192.168.1.1 + Guest IP : 192.168.1.2 + + If your parameters are different, adapt the rest of the section to suit your needs. + + + Create the /path/to/tunconfig script : + + #!/bin/bash + /sbin/ifconfig ${1##/*/} 192.168.1.1 + + The script get the interface name as the first parameter. Linux + will forward incoming packets between interfaces. + + + Make it executable :chmod 755 /path/to/tunconfig + + + Run Bochs, install the guest OS, and set the following network parameters in the guest OS: + + IP: 192.168.1.2 + netmask: 255.255.255.0 + gateway: 192.168.1.1 + nameserver: whatever is used in linux + + + + Bochs must be started by root (at least for now - the + script won't have root privileges otherwise). + + + You may also have to edit /etc/hosts.allow in the host OS and add : + + ALL: 192.168.1.2 + + Don't forget to set up the route on the guest. + + + At this point, you should be able to ping/telnet/ftp/ssh the guest from the host + and vice-versa. + +
+ +
+Set up the host to masquerade the guest network accesses + + We are going to set up standard masquerading configuration. Edit + the /path/to/tunconfig script ans add : + + /sbin/iptables -D POSTROUTING -t nat -s 192.168.1.0/24 -d ! 192.168.1.0/24 -j MASQUERADE >& /dev/null + /sbin/iptables -t nat -s 192.168.1.0/24 -d ! 192.168.1.0/24 -A POSTROUTING -j MASQUERADE + echo 1 > /proc/sys/net/ipv4/ip_forward + + + + The configuration assumes the default policy is + ACCEPT (can be examined by doing '/sbin/iptables -L') + + + The iptables package must be installed. + And voila... The host should forward the packets of the guest to the rest of your network. + You could even have access to the internet... + + + You may need to load other modules if you want to use other fancy protocols (ftp,etc...) + + + +
+
+ +
Using the 'slirp' networking module + +Slirp is a software program that emulates a PPP, SLIP, or CSLIP connection to +the Internet via a shell account. The original version has been written by +Danny Gasparovski in 1995. It has been integrated in QEMU to provide user mode +networking. Now a port of the QEMU Slirp implementation is available in Bochs. + + +Features and limitations: + +Access to the internet and host network services without root/Administrator +privileges or additional libraries. +Builtin DHCP and TFTP servers +Optional SMB support on Linux +ICMP traffic (ping) from guest to the host's network or the internet +not supported +guest access from the host or external network disabled by default + + + +This example shows how to use the 'slirp' module with the NE2000 adapter. The line +is very similar for the E1000 or PCI Pseudo NIC. + +ne2k: mac=52:54:00:12:34:56, ethmod=slirp, ethdev=/home/volker/tests/bochs, script="" + +The "ethdev" value specifies the TFTP root directory. All other options for Slirp must +be set in a config file specified with "script" parameter. If no config file is set up, +Bochs uses this "classic" Slirp configuration shown in the "Default" column below. + +
Advanced Slirp setup with config file + +An example for a Slirp config file can be found in the Bochs sources and in +binary packages (misc/slirp.conf). +Slirp config file options + + + + Option + Description + Default value + + + + + restricted + if set to 1, only built-in services are available + 0 + + + net + base IP address of the virtual network + 10.0.2.0 + + + mask + netmask of the virtual network + 255.255.255.0 + + + host + IP address of the DHCP and TFTP server + 10.0.2.2 + + + hostname + DHCP client hostname + undefined + + + dhcpstart + start address of DHCP pool + 10.0.2.15 + + + dns + IP address of the virtual DNS server + 10.0.2.3 + + + bootfile + boot filename returned by DHCP + undefined + + + dnssearch + comma-separated list of DNS suffixes to search (DHCP extension) + undefined + + + smb_export + absolute path to the shared folder (non-Windows SMB support) + undefined + + + smb_srv + alternative IP address of the SMB server + 10.0.2.4 + + + hostfwd + map guest port to host port for host-to-guest access + (see below for details) + undefined + + + +
+
+
+
Access to guest services from the host + +With the config file option "hostfwd" you can map guest ports to ports on the host +system. This is the format of the directive: + + hostfwd = protocol:hostaddr:hostport-guestaddr:guestport + +The host and guest IP addresses are optional. This example shows how to access +the guest SSH server using the host port 12345. + + hostfwd = tcp::12345-:22 + +Up to 5 port redirection rules are supported per slirp instance. +
+
+ +
Using the 'socket' networking module + +The original patch for the 'socket' networking module has been written by +Mariusz Matuszek in 2003. It supported interconnecting two Bochs sessions +running on the same machine via UDP using an external program called 'bxhub'. + + +The 'socket' networking module is now integrated in the Bochs code with these +extensions: + +Integrated 'vnet' server features (ARP, ICMP-echo, DHCP and TFTP) +Command line options for 'bxhub' added for base UDP port and 'vnet' server features +Support for connects from up to 6 Bochs sessions +Support for connecting 'bxhub' on other machine + + + +The 'socket' networking module uses two UDP ports per Bochs session. By default +the first session receives packets from port 40000 and sends packets to port +40001. The second session uses then the ports 40002 and 40003. For further +sessions the port numbers are incremented accordingly. The port number for +receiving packets is specified with the 'ethdev' parameter of the bochsrc +line for the network adapter. The format is host:port +for connecting the 'bxhub' utility. If it runs on the same machine +('localhost') the host name can be omitted. + + +These examples show how to use the 'socket' module with the NE2000 adapter. The line +is very similar for the E1000 or PCI Pseudo NIC. + +ne2k: mac=52:54:00:12:34:56, ethmod=socket, ethdev=mymachine:40000, script="" +ne2k: mac=52:54:00:12:34:56, ethmod=socket, ethdev=40000, script="" + + +
Using the 'bxhub' utility + +If bxhub is started without command line options, these +default values are used: + +UDP base port 40000 +2 client connections +Server MAC address b0:c4:20:00:00:0f +TFTP support disabled + + + +To change the default settings, these parameters are supported: + +Usage: bxhub [options] + +Supported options: + -ports=... number of virtual ethernet ports (2 - 6) + -base=... base UDP port (bxhub uses 2 ports per Bochs session) + -mac=... host MAC address (default is b0:c4:20:00:00:0f) + -tftp=... enable TFTP support using specified directory + --help display this help and exit + + +
+
+
+Using Bochs internal debugger + + +You can now conditionally compile in a GDB like command line debugger, that +allows you to set breakpoints, step through instructions, and other +useful functions. If there isn't a command for something you believe +is generally useful for the debugger, let me know and I'll implement +it if possible. + + + +This section describes how to enable and use the Bochs command line debugger. +For it's builtin graphical front-end please see the debugger gui +section how to enable it. + + + +To use the debugger, you must configure Bochs with the + and flags. +For example: + + ./configure --enable-debugger --enable-disasm + + + + +You must use flex version 2.5.4 or greater. I have heard that +version 2.5.2 will not work. + + + +When you first start up Bochs, you will see the command line prompt + + + bochs:1> + + +From here, you may use the following commands: + + +
+Execution Control + + + c continue executing + cont + continue + + s [count] execute count instructions, default is 1 + step [count] + + s [cpu] [count] for SMP simulation, execute count instructions on cpu, default is 1 + step [cpu] [count] + + s all [count] for SMP simulation, execute count instructions on all cpus + step all [count] + + Ctrl-C stop execution, and return to command line prompt + Ctrl-D if at empty line on command line, exit + + q quit debugger and execution + quit + exit + + +
+ +
+BreakPoints + + + NOTE: The format of 'seg', 'off', and 'addr' in these descriptions, + are as follows. I don't have any way to set the current radix. + + hexidecimal: 0xcdef0123 + decimal: 123456789 + octal: 01234567 + + vbreak seg:off Set a virtual address instruction breakpoint + vb seg:off + + vbreak seg:off if "expr" Set a conditional virtual address instruction breakpoint + vb seg:off if "expr" + + lbreak addr Set a linear address instruction breakpoint + lb addr + + lbreak addr if "expr" Set a conditional linear address instruction breakpoint + lb addr if "expr" + + pbreak [*] addr Set a physical address instruction breakpoint + pb [*] addr (the '*' is optional for GDB compatibility) + break [*] addr + b [*] addr + + pbreak [*] addr if "expr" Set a conditional physical address instruction breakpoint + pb [*] addr if "expr" (the '*' is optional for GDB compatibility) + break [*] addr if "expr" + b [*] addr if "expr" + + info break Display state of all current breakpoints + bpe n Enable a breakpoint + bpd n Disable a breakpoint + delete n Delete a breakpoint + del n + d n + + + +
+ +
+Memory WatchPoints + + + + watch read addr Insert a read watch point at physical address addr + watch r addr Insert a read watch point at physical address addr + + watch write addr Insert a write watch point at physical address addr + watch w addr Insert a write watch point at physical address addr + + watch Display state of current memory watchpoints + + watch stop Stop simulation when a watchpoint is encountered (default) + watch continue Do not stop simulation when a watchpoint is encountered + + unwatch addr Remove watchpoint to specific physical address + unwatch Remove all watch points + + trace-mem on/off Enable/Disable memory access tracing + + + +
+ +
+Manipulating Memory + + + x /nuf addr Examine memory at linear address addr + xp /nuf addr Examine memory at physical address addr + n Count of how many units to display + u Unit size; one of + b Individual bytes + h Halfwords (2 bytes) + w Words (4 bytes) + g Giant words (8 bytes) + NOTE: these are *not* typical Intel nomenclature sizes, + but they are consistent with GDB convention. + f Printing format. one of + x Print in hexadecimal + d Print in decimal + u Print in unsigned decimal + o Print in octal + t Print in binary + + n, f, and u are optional parameters. u and f default to the last values + you used, or to w(words) and x(hex) if none have been supplied. + n currently defaults to 1. If none of these optional parameters are + used, no slash should be typed. addr is also optional. If you don't + specify it, it will be the value the next address (as if you had + specified n+1 in the last x command). + + setpmem addr datasize val Set physical memory location of size + datasize to value val. + + writemem dump a number of bytes of virtual memory starting from + the specified linear address into a file + + crc addr1 addr2 Show CRC32 for physical memory range addr1..addr2 + + + +
+ +
+Info commands + + + r|reg|regs|registers List of CPU integer registers and their contents + fp|fpu List of all FPU registers and their contents + mmx List of all MMX registers and their contents + sse|xmm List of all SSE registers and their contents + ymm List of all AVX registers and their contents + sreg Show segment registers and their contents + dreg Show debug registers and their contents + creg Show control registers and their contents + + info cpu List of all CPU registers and their contents + info eflags Show decoded EFLAGS register + info break Information about current breakpoint status + info tab Show paging address translation + info device Show state of the specified device + + +
+ +
+Manipulating CPU Registers + + + set reg = expr Change a CPU register to value of expression. + Currently only general purpose registers and instruction pointer + are supported. You may not change eflags, segment registers, + floating point or SIMD registers. + + Examples: set eax = 2+2/2 + set esi = 2*eax+ebx + + registers List of CPU registers and their contents + regs + reg + r + + +
+ +
+Disassembly commands + + + disassemble start end Disassemble instructions in given linear address + range, inclusive of start, exclusive of end. + Use "set $disassemble_size =" to tell + debugger desired segment size. Use a value for + end of less than start (or zero) if you only + want the first instruction disassembled. + + disassemble switch-mode Switch between Intel and AT&T disassebly styles + for debugger disassembler. + + disassemble size = n Tell debugger what segment size to use when + the "disassemble" command is used. Use values + of 0, 16 or 32 for n. Value of 0 means + "use segment size specified by current CS + segment". Default is 0. + + set $auto_disassemble = n Cause debugger to disassemble current instruction + every time execution stops if n=1. Default is 0. + Segment size of current CPU context is used for + disassembly, so the "disassemble size" variable is + ignored. + + set disassemble on The same as 'set $auto_disassemble = 1' + set disassemble off The same as 'set $auto_disassemble = 0' + + +
+ +
+Instruction tracing + + + trace on Disassemble every executed instruction. Note + that instructions which caused exceptions are + not really executed, and therefore not traced. + + trace off Disable instruction tracing. + + +
+ +
+Instrumentation + + +To use instrumentation features in bochs, you must compile in support for it. +You should build a custom instrumentation library in a separate directory in +the "instrument/" directory. To tell configure which instrumentation library +you want to use, use the option. + +The default library consists of a set of stubs, and the following are +equivalent: + + + ./configure [...] --enable-instrumentation + ./configure [...] --enable-instrumentation="instrument/stubs" + + +You could make a separate directory with your custom library, +for example "instrument/myinstrument", copy the contents of +the "instrument/stubs" directory to it, then customize it. Use: + + + ./configure [...] --enable-instrumentation="instrument/myinstrument" + + +
+ +
+Instrumentation commands + + + instrument [command] calls BX_INSTR_DEBUG_CMD instrumentation callback with [command] + + +
+ +
+Other Commands + + +ptime + +Print the current time (number of ticks since start of simulation). + +sb delta + +Insert a time break point "delta" instructions into the future ("delta" is a 64-bit integer followed by "L", for example 1000L). + +sba time + +Insert a time break point at "time" ("time" is a 64-bit integer followed by "L", for example 1000L). + +print-stack [num words] + +Print the num words top 16-bit words on the stack. Num +words defaults to 16. Only works reliably in protected mode when +the base address of the stack segment is zero. + +modebp + +Toggles CPU mode switch breakpoint. + +ldsym [global] filename [offset] + +Load symbols from file filename. If the global keyword is +added, then the the symbols will be visible in all contexts for which +symbols have not been loaded. Offset (default is 0) is added to +every symbol entry. The symbols are loaded in the current (executing) +context. + + + +The symbol file consists of zero or more lines of the format "%x %s". + +show [string] + + + Toggles show symbolic info (calls to begin with). + show - shows current show mode + show mode - show, when processor switch mode + show int - show, when interrupt is happens + show call - show, when call is happens + show ret - show, when iret is happens + show off - toggles off symbolic info + show dbg-all - turn on all show flags + show dbg-none - turn off all show flags + + +
+ +
+ +The Bochs debugger gui + + +The graphical front-end for the Bochs command line debugger +is available for Windows and GTK2 hosts. + + +To use the gui debugger, you must configure Bochs with the +default debugger switches and the flag. +For example: + + ./configure --enable-debugger --enable-disasm --enable-debugger-gui + + + +At runtime you need to add the value to the +display_library options parameter +in order to use the gui instead of the command line debugger. This example shows how to +use it with the 'x' gui: + +display_library: x, options="gui_debug" + + + +The gui debugger consists of a gui window with a menu bar, a button bar and some +child windows that show the cpu registers, disassembler output, memory dump and +the internal debugger output. A command prompt for entering debugger commands is +also available. + + +&FIXME; List the features here. + + +Most of the gui debugger settings are now saved to an INI file on exit and +restored at the next run. + +
+ +
+ +Related links + + +&FIXME; For information on advanced debugger usage see the developer documentation +(under construction). + +
+
+ +
+Using Bochs and the remote GDB stub + +This section covers how you can use Bochs with a remote GDB stub to debug your kernel. + + +
+Configuring Bochs + +The GDB stub is not active in standard Bochs binary package. So you must recompile Bochs. +Download the Bochs source package, unpack it and run the configure script +with the argument. + + + $ ./configure --enable-gdb-stub + + +After that, just run make and you should have a Bochs binary that contain a GDB stub in your directory. + +
+ +
+Running Bochs + +Enable the gdbstub option in bochsrc, then just start Bochs as normal. Bochs will stop and wait for GDB to connect to the stub. + +
+ +
+Running GDB + +Bochs GDB stub waits for a connection on TCP port 1234. Just start GDB like this: + + + $ gdb YOUR-KERNEL + . + . + . + (gdb) target remote localhost:1234 + Remote debugging using localhost:1234 + 0x0000fff0 in ?? () + (gdb) + + +You are now connected to the remote GDB stub in Bochs. You are now able to set breakpoints. +Use the continue (c) command to continue the simulation. + +Hitting ^C works. Example: + + + Program received signal 0, Signal 0. + syscall_testsuite_result (aux=0x1f11fe4) at ../rtmk/syscalls.c:33 + 33 { + (gdb) + + +
+ +
+ +
Using the serial port + + This section describes what is possible to do with Bochs serial port emulation. + These examples use dlxlinux disk image + (downloaded from + + http://bochs.sourceforge.net/guestos/dlxlinux3.tar.gz + ) running as guest, on a debian x86 linux 2.4.19 host. + + + For the examples to work in dlxlinux, after you login as root, you will need to + kill the running gpm, as it grabs the serial port. + +Welcome to DLX V1.0 (C) 1995-96 Erich Boehm + (C) 1995 Hannes Boehm + + +dlx login: root +Linux 1.3.89. +dlx:~# ps | grep gpm + 30 S0 S 0:00 /usr/bin/gpm -t bare + 40 1 S 0:00 grep gpm +dlx:~# kill -9 30 +dlx:~# + + + +
Logging serial port output to a file + + The first example shows how to log information sent to the serial port + on the guest system into a file on the host system. + + + Update the com1: section of your configuration file: + +com1: enabled=1, mode=file, dev=serial.txt + + After you've launch dlxlinux, everything sent to the serial port will be + logged to serial.txt : + +dlx:~# echo "logging to the serial port" > /dev/cua0 + + +host$ cat serial.txt +logging to the serial port +host$ + + +
+
Interactivity : connecting to a virtual terminal + + The second example shows how to connect to the guest OS, using a + virtual terminal on the host OS. + + + First, you need to find an unused virtual terminal. Typically, + X uses vt7; vt8 and up are unused. On my system, I can + switch from X to vt9 by pressing ctrl-alt-f9 : this virtual + terminal is not used, the screen is all black. Pressing alt-f7 + switches back to X. + + + Once you found an unused vt, update the com1: section of your + configuration file: + +com1: enabled=1, mode=term, dev=/dev/tty9 + + The number must be set according to the terminal you want to use (here 9). + + + Now, launch dlxlinux. After you log in as root and kill gpm, + enter the following command: + +dlx:~# /sbin/agetty 38400 cua0 + + If you switch to vt9, you can see dlx welcome banner, and the login prompt: + +Welcome to DLX V1.0 (C) 1995-96 Erich Boehm + (C) 1995 Hannes Boehm + + +dlx login: + + Note that dlxlinux is configured so you can not login as root from a + serial port. If you want to login, you have to create a new user first. + + + Also, if you plan to use this feature, the best would be to deactivate + gpm in /etc/rc.d/rc.local, and add a agetty line in /etc/inittab, + for example: + +T0:1234:respawn:/bin/agetty 38400 cua0 + + +
+
Interactivity : connecting to a pseudo terminal + + The third example is very similar to the second one, except that we + connect to the guest OS with kermit as client, and we the connection + is done through a pseudo terminal. + + + This example uses /dev/ptyp0 and /dev/ttyp0 as pseudo terminal pair. + We will tie Bochs to the controlling terminal, whereas kermit will + use the slave terminal. + + + Update the com1: section of your configuration file: + +com1: enabled=1, mode=term, dev=/dev/ptyp0 + + and lauch dlxlinux. After you log in as root, enter the command: + +dlx:~# /sbin/agetty 38400 cua0 + + Then in the host OS, launch kermit : + +host$ kermit -l /dev/ttyp0 +C-Kermit 7.0.196, 1 Jan 2000, for Linux + Copyright (C) 1985, 2000, + Trustees of Columbia University in the City of New York. +Type ? or HELP for help. +(/tmp/) C-Kermit>connect +Connecting to /dev/ttyp0, speed 0. +The escape character is Ctrl-\ (ASCII 28, FS) +Type the escape character followed by C to get back, +or followed by ? to see other options. +---------------------------------------------------- + +Welcome to DLX V1.0 (C) 1995-96 Erich Boehm + (C) 1995 Hannes Boehm + + +dlx login: + + The same comments as for example 2 apply here. + +
+
+ +
+BIOS Tips +
+ Booting from CD-ROMs + +A bootable CD-ROM has a special layout that is detected by the +BIOS boot loader code, and executed if it conforms the specifications. +This layout is called "El Torito Bootable CD-ROM Format Specification" +and has been published by Phoenix and IBM. A copy of this spec is on +Bochs tech specs page. + + +El Torito specifies 3 ways to have a bootable CD: + + +floppy emulation boot: A standard floppy image is burnt on the CD. +In this case the BIOS has to redirect all first floppy accesses to this +image and the real floppy drive becomes the second one. + + +a "no emulation" boot: In this case the BIOS is instructed to load an +arbitrary number of sectors straight into memory, and execute it. + + +hard disk emulation: A hard disk image is burnt on the CD. The +BIOS has to redirect all hard disk accesses to that image. The real hard disks +are still available, with BIOS numbers 81h and up. + + + +In Bochs 2.0, hard disk emulation is not implemented in the BIOS. +There are also subtilities about multiple boot-images CD-ROMs, that are +not handled by Bochs. + + + +However, our BIOS may be more strict than real PC BIOSes, I don't know. +But I would definitely be interested to know of any CD that can boot +on real hardware, but does not in Bochs. + + + +When failing to boot from CD-ROM, the BIOS outputs +the reason of the failure as +an error code, in the log file, and on the screen. + + + +Here is a summary of what can happen when booting from the CD. + + +CD Boot error codes + + + + + Error code + Reason + + + + 0x01 no atapi device found + 0x02 no atapi cdrom found + 0x03 can not read cd - BRVD + 0x04 cd is not eltorito (BRVD) + 0x05 cd is not eltorito (ISO TAG) + 0x06 cd is not eltorito (ELTORITO TAG) + 0x07 can not read cd - boot catalog + 0x08 boot catalog : bad header + 0x09 boot catalog : bad platform + 0x0A boot catalog : bad signature + 0x0B boot catalog : bootable flag not set + 0x0C can not read cd - boot image + + +
+ + + +0x01 no atapi device found +0x02 no atapi cdrom found + + +For the first two errors, an ata-*: type=cdrom is probably missing +from the configuration file. This is what you get if no cdrom has +been defined in Bochs conf file. + + + + +0x03 can not read cd - BRVD + + +For this error, the cdrom support has not been compiled in Bochs, +or Bochs could not open the file or device. This is what you get if +Bochs is not able to read the cd. + + + + +0x04 cd is not eltorito (BRVD) +0x05 cd is not eltorito (ISO TAG) +0x06 cd is not eltorito (ELTORITO TAG) + + +For these errors, the data has been read from the cd, but +the cd does not conform to the El Torito specification. This +is what you get if the cd is not bootable. + + + + +0x08 boot catalog : bad header +0x09 boot catalog : bad platform +0x0A boot catalog : bad signature +0x0B boot catalog : bootable flag not set + + +now the cd is eltorito, but the boot catalog is corrupted, or +the cd was made to boot on a ppc system. This should not happen +for a x86 bootable cd. + + + + +0x07 can not read cd - boot catalog +0x0C can not read cd - boot image + +here, specific part of the cd could not be read. This should +definitely not happen. + +
+ +
+ Disk translation + +Since the beginning of the PC era, disks have grown in size by a factor of 10000. Due to +differences between the ATA specification and BIOSes implementations, when disks reached +critical sizes, it +became necessary to translate the CHS geometry (cylinders, heads, sectors per track) +between the BIOS (int 13h) and the ATA interface. Please refer to the +ATA-FAQ +and +Hale Landis' document +for a complete discussion of the problem. + + +Unfortunately, there has never been any standard on the translation algorithms. + + +Bochs implements 4 well-known algorithms, selectable in the configuration file +in the "ataX-xxxx: ..., translation='algorithm'" section. + + +Disk translation algorithms + + + + Algorithm + Maximum disk size + Maximum logical and physical geometry (CHS) + Description + + + + + none + 528MB (1032192 sectors) + + LCHS:1024/16/63 + PCHS:1024/16/63 + + + no translation is done. The CHS received at the int13h interface + is sent as is to the ATA interface. + + + + large + 4.2GB (8257536 sectors) + + LCHS:1024/128/63 + PCHS:8192/16/63 + + + a standard bitshift algorithm (named Extended-CHS) + is used to translate the CHS between + the int13h interface + and the ATA interface. The translation is achieved by + multiplying/dividing the cylinder/head count by a power of 2 + (2, 4 or 8). + (a factor of 16 could not be used because the + head count would become 256, and MS-DOS thought this was 0) + Note that the number of sectors per track is not changed, so + a lower spt value will lead to a lower maximum disk size. + + + + echs + + + synonym for large + + + rechs + 7.9GB (15482880 sectors) + + LCHS:1024/240/63 + PCHS:15360/16/63 + + + a revised bitshift algorithm (called Revised Extended-CHS) + is used to translate the CHS between + the int13h interface + and the ATA interface. First the number of physical heads is forced to + 15, and the number of cylinders is adjusted accordingly. + Then, as in the simple extended CHS algorithm, the translation + is achieved by + multiplying/dividing the cylinder/head count by a power of 2 + (2, 4, 8 or 16). + The head count being forced to 15, it can safely be multiplied by 16 + without crashing dos. + Note that the number of sectors per track is not changed, so + a lower spt value will lead to a lower maximum disk size. + + + + lba + 8.4GB (16450560 sectors) + + LCHS:1024/255/63 + PCHS:16320/16/63 + + + a LBA-assisted algorithm + is used to translate the CHS between + the int13h interface + and the ATA interface. The translation is achieved by + first computing the physical size of the disk (LBA=C*H*S). + Then the sectors per track is forced to 63, and the head count + to 255. Then the cylinder count is computed (C=LBA/(63*255)) + Note that the number of sectors per track is forced to 63 + in the logical geometry, regardless of the actual geometry + reported by the disk. + Also note that the LBA-assisted algorithm has nothing to do with + LBA access at the ATA interface. + + + + auto + + + the best suited algorithm between none, large and lba is used + + + +
+ + +Setting a specific CHS translation should be done if you use a disk dump +of an actual disk, or use a real disk as a block device. You need to +know which geometry was used to format the disk, and which translation +was used. You must not set the translation to 'auto'. + + + + +rechs translation should only be useful for Compaq users who wants to +use a disk as a block device. Please report if you know any other +system that use such translation. + + + + +If you plan to create a new disk image (for example with bximage), +format it and install an OS on it, select the "auto" translation +for an automatic selection +of the best algorithm based on the disk image size. Be warned that an image created +with the "auto" translation might not be readable with previous versions of Bochs. +Upward compatibility will be maintained. + + + + +This translation applies only to int13h BIOS disk accesses. Older OSes (e.g. MS-DOS) +tend to use them a lot. On modern OSes, disk accesses through BIOS int13h are +limited to boot loaders. +The usual rules and tricks of the installed OS still apply (ie 1024 cylinders boot limit). + + + +
+
+ +
How to enter special key combination + +Your window manager may trap the key combination you want to enter +in Bochs guest OS, for example controlaltdelete. Here is a work-around: + + +Press and hold controlalt, +move your mouse cursor outside of the Bochs window. Release them, move +the cursor back in the Bochs window and press delete. + + +This should work for any key combination. + + +If you need one key combination frequently, set it up as user key combination +with the keyboard option in your +configuration file. This key combination is sent to the guest OS when you press +the user button in the headerbar. +Depending on the used display_library option, +it may even be possible to edit the shortcut before sending it. + +
+ +
+ Notes about VESA usage + + + Since Bochs 1.4 it is possible to use VESA graphics. There are some limitations in + the current implementation, but in general it should work ok (we have run several test + programs, the XFree86 VESA display driver, etc.) + + + + In order to use VESA VBE, you need to enable it in your bochsrc by setting the + vga option to vbe. + Finally, you need to use the + LGPL'd VGABIOS + as vgaromimage option for + applications to correctly detect VESA support. + + + + The VGABIOS is already included in the Bochs release, so no separate download is necessary. + + + + To take advantage of the VBE, you must tell Bochs to use the LGPL'd VGA BIOS + version 0.4c or higher. A current version of the VGA BIOS will work. + + + +Current limitations: + + 4bpp modes support is incomplete (8, 15, 16, 24 and 32bpp should work) + banked mode is very slow (if you can, just use Linear Frame Buffering instead!) + only 320x200, 640x400, 640x480, 800x600, 1024x768 are currently supported + + + + +Interesting Facts: + + You need a display driver capable of using the VESA BIOS for this to work + (a recent XFree86 will do, Windows 9x/NT/2K/XP probably will not work 'out of the box'. + Currently the VBE2 extension should be supported ok + + + +
Instructions to setup Bochs VBE in Windows Guest OS +This was contributed by Martin Bochnig in February 2004. + +Instructions for Win95/98: +========================== +I can only confirm that SciTech finally made a VBE driver +for Windows. It works out of the box, at least with win95 +as guest OS, provided you use Bochs 2.1 with the LGPL +vgabios. + +Here is how I did it : +- install win95 with the vga driver. +- download sdd 7 beta from +- download pmhelp.vxd from +- copy pmhelp.vxd to the win95 system directory +- install sdd7 + +800x600 and 1024x768 in 16 and 24 bpp modes here. +I did not try 32bpp. + + +This was contributed by Stanislav Shwartsman in September 2004. + +Instructions for Win2000/XP: +============================ + +Bochs VBE Display Drivers for Windows NT/2000 + + +
+
+ +
+ Notes about Cirrus SVGA usage + + + Since Bochs 2.2 it is possible to use Cirrus SVGA graphics. The Cirrus device + supports both ISA and PCI depending on the bochsrc settings. + If PCI is disabled or the Cirrus card is not assigned to a PCI slot, it appears + as a CL-GD5430 ISA with 2MB VRAM. If you assign the Cirrus card to a PCI slot, + it appears as a CL-GD5446 PCI with 4MB VRAM. + + + In order to use Cirrus SVGA, you need to compile Bochs using the + option and enable it in your bochsrc by setting the + vga option to cirrus. + Finally, you need to use the Cirrus version of the + LGPL'd VGABIOS + as vgaromimage option for + applications to correctly detect Cirrus support. + + + # Enable CL-GD5446 PCI + vga: extension=cirrus + vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest-cirrus + pci: enabled=1, chipset=i440fx, slot1=cirrus + + + + The VGABIOS is already included in the Bochs release, so no separate download is necessary. + +
+ +
+ Notes about Voodoo Graphics usage + + + Bochs supports the emulation of 4 different 3dfx Voodoo Graphics adapter models. + The Voodoo1 and Voodoo2 models are 3D-only add-on cards and require a VGA + compatible primary device. The Voodoo Banshee and it's successor Voodoo3 have + both a VGA core and a 2D/3D core, so no other VGA card is required. The 2D/3D + cards can be assigned to AGP if the i440BX chipset is selected (slot #5). + + + To emulate the Voodoo1 or Voodoo2 device only the "model" parameter of the + bochsrc option "voodoo" needs to be set. If the vga extension option is set + to "voodoo" in that case, the primary display adapter is an ISA VGA card. + + + For emulating the Voodoo Banshee or Voodoo3 adapter, the vga extension option + must be set to "voodoo". Using a different primary display adapter and a + Banshee compatible device with it's VGA interface disabled is not + implemented yet. Both Banshee and Voodoo3 currently need a specific external + VGA BIOS, since a Voodoo extension for the LGPL'd VGABIOS is not written yet. + + + These bochsrc settings should be used for Voodoo Banshee PCI: + + vga: extension=voodoo + vgaromimage: file=Pci_sg.rom + voodoo: model=banshee + + + + These settings are required for the Voodoo3 PCI: + + vga: extension=voodoo + vgaromimage: file=V3_2000_PCI_SG_2.15.06_LC.rom + voodoo: model=voodoo3 + + + + These settings are required for Voodoo Banshee AGP: + + pci: chipset=i440bx, slot5=voodoo + vga: extension=voodoo + vgaromimage: file=Agp_sg.rom + voodoo: model=banshee + + + + These settings are required for the Voodoo3 AGP: + + pci: chipset=i440bx, slot5=voodoo + vga: extension=voodoo + vgaromimage: file=1k11sg.rom + voodoo: model=voodoo3 + + +
+ +
Disk Image Modes + +Bochs can handle independent disk image format for each +disk present on the ata interfaces. + +The disk image type is selected in the configuration file +by the "mode" option of the ataX-xxx directives. +Example: + + +ata0-master: type=disk, mode=flat, path=10M.sample, cylinders=306, heads=4, spt=17 + + + + + +If unspecified, the default "mode" is flat. + + + + +Supported Disk Modes + + + + Name + Description + Features + + + + flat one file, flat layout + + accessible with mtools or winimage-like tools + + + concat multiple files, concatenated + + mappable to contained partitions + + + external accessed through an external C++ class + + developer specific, needs a C++ class at compile time + + + dll accessed through a DLL + + developer specific, windows only + + + sparse up to 10 layers stackable files + + commitable, rollbackable, growing + + + vmware3 vmware3 disk support + + vmware version 3 compatibility + + + vmware4 vmware4 disk support + + vmware version 4 (VMDK) compatibility + + + undoable read-only base file with a commitable redolog + + commitable, rollbackable + + + growing one growing file + growing + + + volatile read-only base file with a volatile redolog + + always rollbacked + + + vpc VirtualPC disk support + + fixed / dynamic size supported + + + vbox Oracle(tm) VM VirtualBox disk support + + VDI version 1.1 fixed / dynamic size supported + + + vvfat local directory appears as VFAT disk (with volatile redolog) + + optional commit or rollback + + + + +
+
+ +
flat + + +
description + +In flat mode, all sectors of the harddisk are stored in one flat file, +in lba order. + +
+
image creation + +Flat disk images can be created with the bximage utility +(see for more information). + +
+
path + +The "path" option of the ataX-xxx directive in the configuration file +must point to the flat image file. + +
+
external tools + +Flat images content can be accessed from the host by the +following tools : + + mtools (see ) + mount with a loopback (see ) + Winimage / DiskExplorer (see ) + Bochs Tools (see ) + + +
+
typical use + +Flat mode is Bochs default harddisk layout. This is also +the layout of disk images provided on Bochs websites. + +
+
limitations + +On some host OSes, Bochs flat disk images are limited to 2GiB. + +
+
+ + +
concat + + +
description + +In concat mode, all sectors of the harddisk are stored in several flat files, +in lba order. + +
+
image creation + +Disk images for the usage in 'concat' mode can be created as 'flat' mode image +files with the bximage utility (see for more +information). + +
+
path + +The "path" option of the ataX-xxx directive in the configuration file +must point to the first file (e.g. win95-1). The lower layer files names are +found by adding 1 to the last character (e.g. win95-2, win95-3, etc.). + +
+
external tools + +If every single file contains a complete partition, they can be accessed +with same tools as the 'flat' mode images. + +
+
typical use + +If the partition sizes and file sizes are set up correctly, this allows you to +store each partition in a separate file, which is very convenient if you want +to operate on a single partition (e.g. mount with loopback, create file system, +fsck, etc.). + +
+
limitations + +On some host OSes, there is a limit of 2GiB per file. + +
+
+ +
external/dll + + +
description + +This mode is only useful for developers and needs an additional C++ class +compiled in, or an additional DLL linked to Bochs. + +
+
+ +
sparse + + +
description + + Sparse disk support has been added by JustinSB. Sparse disk features are: + + + + Large hard drive can be created, and only used space will be stored + in the file. In practice, on Unix, this is not a large gain as it is + done anyway. + + + + + Multiple sparse drive images can be mounted on top of each other. + Writes go to the top image. This allows several similar configurations + to share a master "base" file, and also allows file system rollback or + no-write options. Up to 10 disk images can be layered on top of each other. + + + + +
+
image creation + +Sparse disk images must be created with the bximage utility +(see for more information). +Be sure to enter "sparse" when selecting the image type. + +
+
path + +The "path" option of the ataX-xxx directive in the configuration file +must point to the top layered file. The lower layer files names are found by +substracting 1 from the last character (must be a digit) + +
+
external tools + +No external tool support Sparse disk images yet. + +
+
typical use +
+ Space Saving + + Create a sparse disk image using bximage. Set size to eg 10GB. + Only allocated space will be stored, + so your drive image should be only about as large as the files stored on it. + +
+ +
+ Disk Rollback + + + + + Create a sparse disk image called "c.img.0". Point .bochsrc at "c.img.0". + In bochs, install your favorite OS. Switch off bochs. + + + + + Create a sparse disk image (of the same size) + and name it "c.img.1". Point .bochsrc at "c.img.1" + "c.img.0" is visible, but all writes go to "c.img.1". + After using bochs, you can simply delete + "c.img.1" to undo changes and go back to a clean OS install. + + + + +
+ +
+ Disk Optional Commit + + + + + Create a sparse disk image called "c.img.0". Point .bochsrc at "c.img.0". + In bochs, install your favorite OS. Switch off bochs. + + + + + Create a sparse disk image (of the same size) and name it "c.img.1". + Point .bochsrc at "c.img.1" + "c.img.0" is visible, but all writes go to "c.img.1". + After using bochs, if you want to keep the + changes, use the (currently non-existent) merge utility + to make a single unified drive image. + + + + + Alternatively simply create a new partition on top called "c.img.2". + + + + +
+ +
+ Common Base + + + + Create a sparse disk image called "base.img". Point .bochsrc at "base.img". + In bochs, install your favorite OS. Switch off bochs. + + + + + Create a sparse disk image (of the same size) and name it "www.img.1". + Make "wwww.img.0" a symlink to + "base.img". Point .bochsrc at "www.img.1". Using bochs, install a webserver. + + + + + Create a symlink to "base.img" called "db.img.0". + Create a sparse disk image (of the same size) + and name it "db.img.1". Point .bochsrc at "db.img.1". + Using bochs, install a database server. + + + + + + Now both a database server and webserver can be + run in separate virtual machines, but they share the common OS image, + saving drive space. + +
+ +
+
limitations + + There is a need for supporting utilities (yet unwritten) : + + + to merge two sparse disk images into a single image + + + to defragment a sparse disk image and remove unused space + + + +
+
+ +
vmware3 / vmware4 + + +
description + +Sharvil Nanavati has added vmware3/4 disk image support into Bochs +for Net Integration Technologies, Inc. +You should be able to use disk images created by vmware version 3 and 4. + +
+
image creation + +Create such disk image with vmware version 3 or 4. + +
+
path + +The "path" option of the ataX-xxx directive in the configuration file +must point to the vmware3/4 disk image. + +
+
external tools + +&FIXME; In addition to the utilities provided by VMware Inc. some other freeware +tools are available. + +
+
typical use + +If you want to use an existing vmware3/4 disk image. + +
+
limitations + +Only vmware versions 3 and 4 disk image files are supported. + +
+
+ +
undoable + + +
description + + Undoable disks are commitable/rollbackable disk images. + An undoable disk is based on a read-only image, associated + with a growing redolog, that contains all changes (writes) + made to the base image content. Currently, base images of + types 'flat', 'sparse', 'growing', 'vmware3', 'vmware4' and + 'vpc' are supported. + + + This redolog is dynamically created at runtime, if it does not + previously exists. + + + All writes go to the redolog, reads are done from the + redolog if previously written, or from the base file + otherwise. + + + If unspecified with the "journal" option of the ataX-xxx directive, + the redolog file name is created by adding a ".redolog" + suffix to the base image name. + + + File size of the redolog can grow up to the total disk + size plus a small overhead due to internal data management + (about 3% for a 32MiB disk, + less than 0.5% for a 2GiB disk). + + + After a run, the redolog will still be present, so the changes + are still visible the next time you run Bochs with this disk image. + +
+
image creation + +The flat / sparse / growing disk images must be created with the bximage utility +(see for more information). +The growing redolog is created automatically if needed. + +
+
path + + The "path" option of the ataX-xxx directive in the configuration file + must be the base image name. The redolog name can be set with the "journal" + option of the same directive. If not set, the redolog name is created by + adding the ".redolog" suffix to the base image name. + +
+
external tools + + To access the flat disk image content, + see for available tools. + + + + The up-to-date content can only be seen after you commit the redolog + to the flat file with the bximage utility. + + +
+
typical use + +Commit + + After a run, the redolog can be committed (merged) + to the base image with the bximage utility. + +Rollback + + After a run, the redolog can be rollbacked (discarded) + by simply deleting the redolog file. + +Common Base + + One base disk image with a guest OS installed can be used to install + different software as described above for the "sparse" disk image mode. + +Harddisk Image on a Read-Only Medium + + In the 'undoable' mode, the base file is always opened in read-only mode, + so it can safely be stored on a read-only medium (for example on a cdrom). + In that case it is recommended to specify the redolog file with the + "journal" option. + + +
+
limitations + + The "undoable" disk depends on the limitations of base disk image used. + +
+
+ +
growing + + +
description + + Growing disk images start as a small files, and + grow whenever new data is written to them. + + + Once a sector is + written in the growing file, subsequent writes to the same + sector will happen in place. + + + File size of Growing disk images can go up to the total disk + size plus a small overhead due to internal data management. + (about 3% for a 32MiB disk, + less than 0.5% for a 2GiB disk). + +
+
image creation + +Growing disk images must be created with the bximage utility +(see for more information). +Be sure to enter "growing" when selecting the image type. + +
+
path + + The "path" option of the ataX-xxx directive in the configuration file + must be the growing image name. + +
+
external tools + +No external tool support Growing disk images yet. + +
+
typical use + +Growing disk images can be used whenever you want to maximize disk space. +However, please note that Bochs will not check if enough disk space is available +before writing new data. If no disk space is available, a panic will occur. + +
+
limitations + + The size of the virtual disk is currently limited to 8 TB, but the maximum size + of the image file depends on host OS limitations. + +
+
+ +
volatile + + +
description + + Volatile disks are always-rollbacked disk images. + An volatile disk is based on a read-only image, associated with + a growing redolog, that contains all changes (writes) + made to the base image content. Currently, base images of + types 'flat', 'sparse', 'growing', 'vmware3', 'vmware4' and + 'vpc' are supported. + + + The redolog is dynamically created at runtime, when + Bochs starts, and is deleted when Bochs closes (win32) + or just after it has been created (Unix). + + + All writes go to the redolog, reads are done from the + redolog if previously written, or from the base file + otherwise. + + + If unspecified with the "journal" option of the ataX-xxx directive, + the redolog file name is created by adding a ".redolog" + suffix to the base image name. + + + File size of the redolog can grow up to the total disk + size plus a small overhead due to internal data management + (about 3% for a 32MiB disk, + less than 0.5% for a 2GiB disk). + + + After a run, the redolog is not any more present, so the changes + are discarded. + +
+
image creation + +The flat / sparse / growing disk images must be created with the bximage utility +(see for more information). +The growing redolog is created automatically. + +
+
path + + The "path" option of the ataX-xxx directive in the configuration file + must be the base image name. The redolog name can be set with the "journal" + option of the same directive. + If not set, the redolog name is created by adding the + ".redolog" suffix to the base image name. + A random suffix is also appended to the redolog name. + +
+
external tools + + See for tools + to access the flat disk image content. + +
+
typical use + +Repeatable simulations + + &FIXME; to be completed + +Multiple Bochs instances + + &FIXME; to be completed + +Harddisk Image on a Read-Only Medium + + In the 'volatile' mode, the base file is always opened in read-only mode, + so it can safely be stored on a read-only medium (for example on a cdrom). + In that case it is recommended to specify the redolog file with the + "journal" option. + + +
+
limitations + + The "volatile" disk depends on the limitations of base disk image used. + +
+
+ +
vpc + + +
description + + The "vpc" disk image mode is mostly a port of Qemu's "vpc" block + driver for VirtualPC disk images (written by Alex Beregszaszi and Kevin Wolf). + +
+
image creation + + Create such disk image with Microsoft VirtualPC (tm) or Qemu's disk image utility (qemu-img). + +
+
path + + The "path" option of the ataX-xxx directive in the configuration file + must point to the VirtualPC disk image. + +
+
external tools + + Use Microsoft VirtualPC (tm) tools to manipulate these disk images. + +
+
typical use + + Share disk images with VirtualPC. + +
+
limitations + + The based on the Qemu code the disk size is limited to 127 GB. + +
+
+ +
vvfat + + +
description + + The "vvfat" disk image mode is mostly a port of Qemu's "virtual VFAT" block + driver (written by Johannes E. Schindelin). It supports the read-only part + of this implementation plus some additions. The structures of the + virtual disk are created from the contents of the specified local directory + when Bochs is starting. All writes to this virtual disk go to a volatile + redolog and when closing Bochs, the user can decide whether or not to commit + the changes. If "No" is seclected, all changes will be lost when Bochs quits + and the files of the local directory are not modified. Otherwise the changes + of files and directories are committed. WARNING: Don't use important data without + backup in the "vvfat" directory when using this "optional commit" feature. + + + In addition to Qemu's "vvfat" implementation the Bochs one supports configurable + disk geometry, FAT32 and reading MBR and/or boot sector from file. When using + the autodetection feature, the CHS values 1024/16/63 (Qemu defaults) are used. + To use an MBR image file from a real disk it must be named vvfat_mbr.bin + and placed in the specified directory. Bochs uses the geometry and file system + type from this file and doesn't show it on the virtual disk. The same applies + to a boot sector image file, but it must be named vvfat_boot.bin. + Using both image file is also possible if they match (grabbed from the same disk). + + + FAT32 is enabled for disk with minimum 2 GB size, or if MBR / boot sector image + enable this filesystem. When using "vvfat" for a floppy, FAT12 is used (1.44M + media only). In all other cases FAT16 is used. Long filename support + is always present. + + + Special FAT file attributes are stored in a special file named vvfat_attr.cfg. + When using the "optional commit" feature, modified attributes are saved to this file. + The "optional commit" also supports setting the file modification date and time. + +
+
image creation + + Not necessary. The directory must exist before running Bochs. + +
+
path + + The "path" option of the ataX-xxx directive in the configuration file + must point to an existing local directory. The redolog name can be set + with the "journal" option of the same directive. If not set, the redolog + name is created by adding the filename "vvfat.dir.redolog" to the path. + A random suffix is also appended to the redolog name. + +
+
external tools + + You can use your favourite file manager to copy file to the directory you'd + like to use. The directory should not be modified while Bochs is running. + +
+
typical use + + Accessing files of the host hard drive is only possible with vvfat. + +
+
limitations + + There is no runtime write support present yet. All changes are written to + the volatile redolog and they can only be committed on Bochs exit. + + + When using the MBR from image file only the first partition is used and it + must be of type FAT16 or FAT32. FAT12 can be used for the floppy only. + An extended partition or other file system types are not supported. + + + The "vvfat" implementation does not support save/restore, since there is no + check if the host directory tree and all files are unmodified after saving + the Bochs state. + +
+
+ + + + +
+ +
Using the bximage tool + +Bximage is an easy to use console based tool for creating, converting and +resizing disk images, particularly for use with Bochs. It also supports +committing redolog files to their base images. It is completely interactive +if no command line arguments are used. It can be switched to a non-interactive +mode if all required parameters are given in the command line. + + +When you run bximage without one of the following options, it will appear in +interactive mode and ask for all required parameters to manipulate an image. + +Usage: bximage [options] [filename1] [filename2] + +Supported options: + -mode=... operation mode (create, convert, resize, commit, info) + -fd=... create: floppy image with size code + -hd=... create/resize: hard disk image with size in megabytes (M) + or gigabytes (G) + -imgmode=... create/convert: hard disk image mode + -b convert/resize: create a backup of the source image + commit: create backups of the base image and redolog file + -q quiet mode (don't prompt for user input) + --help display this help and exit + +Other arguments: + filename1 create: new image file + convert/resize: source image file + commit: base image file + filename2 convert/resize: destination image file + commit: redolog (journal) file + +Bximage: supported disk images modes (formats) + + + + Mode + Create / Resize / Convert target + Convert source / Commit base + + + + + flat + Yes + Yes + + + concat + Create only + Convert source only + + + dll + No + Convert source only + + + sparse + Yes + Yes + + + vmware3 + No + Yes + + + vmware4 + Yes + Yes + + + growing + Yes + Yes + + + vpc + Yes + Yes + + + +
+
+ +Disk image mode autodetection does not work for the modes concat +and dll. To use those images as convert source, you have to +add a prefix ("concat:" or "dll:") to the image path. + +
Create image + +This function can be used to create several disk image formats for the +use with Bochs. See the table above for supported formats (modes). +For an example of the usage, refer to . + +
+
Convert image + +With this function a disk image can be converted from one mode (format) +to another. The type of the source image is auto-detected. For the target +format it supports the same disk image modes as the create function. If the +name of the new image file is not specified or identical to the source one +and you have enabled the backup switch, a backup of the source file will be +created with it's original name plus the suffix ".orig". + +
+
Resize image + +This function can be used to increase the virtual disk size of an image. +It supports the same disk image modes as the create function. +Making a disk image smaller is not supported, since it may damage the +disk and data will be lost. If the name of the new image file is not +specified or identical to the source one and you have enabled the backup +switch, a backup of the source file will be created with it's original name +plus the suffix ".orig". + +
+
Commit 'undoable' redolog to base image + +The type of the base image is auto-detected. The name of the redolog +file only needs to be specified if it is not based on the base image. +If you have enabled the backup switch, backups of the original base and +redolog files will still be created with their original name plus the +suffix ".orig". + +
+
Disk image info + +This function can be used to determine the disk image format, geometry +and size. Note that Bochs can only detect the formats growing, sparse, +vmware3, vmware4 and vpc correctly. Other images with a file size +multiple of 512 are treated as flat ones. If the image doesn't support +returning the geometry, the cylinders are calculated based on 16 heads +and 63 sectors per track. + +
+
+ +
+ + +Guest operating systems + +In the past several tweaks were necessary to install a guest OS inside of Bochs. +Nowadays it's almost the same as installing it on a real machine. There are only +a few Bochs specific issues you should know about. Note that we cannot give you +a full installation guide if you don't know how to install an OS in the real +world. The following remarks apply to all guest OS installations. Some specific +issues are reported in the next sections. + + +First of all you need the installation media or image (floppy/CD/DVD). +For platforms that don't support raw device access it might be necessary to +create an image from the media. You must read the message regarding software +licenses in before you install or use a commercial +guest operating system in Bochs. + +Then you need to create a hard drive image with bximage. For the +required size see the documentation of the OS you'd like to install. See + how to create the image. + +Finally you have to create configuration for your guest OS. You can +edit the sample configuration distributed with Bochs or use the configuration +interface to adjust the settings. Check the documentation of your guest OS for +the required memory size, cpu speed and supported hardware. + + +Now you should be able to run Bochs and start the installation process. Depending +on the host cpu speed and the size of the guest OS it can take a few minutes or +even some hours. + + + +What disk images are available. +What works +Known problems + + + +
+ Knoppix + + + Contributed by Alexander Schuch. + + +
+ Getting Knoppix + + + Knoppix is a live CD (700M) or live DVD (3.2G) based on Debian GNU/Linux, with lots of + ready-to-run programs (web browser, office suite, a few games, and more), using + KDE as desktop environment. It can be booted directly from CD, without + any installation needed. You can download it from knoppix.org. + +
+ +
+ Preparing Bochs + + + As Knoppix runs completely from CD/DVD, you don't need to setup a hard disk. You just need to set up + the location of the downloaded ISO image in your bochsrc, and make Bochs boot + from it. Because Knoppix contains a graphical user interface, and has no other storage space but + the emulated RAM, it needs at least 128MB of it, see + megs option. Furthermore, you need to enable VBE support in + Bochs (see ). + +
+ +
+ Using Knoppix + + + There is nothing more to do! Just start Bochs and wait for Knoppix to load... + + + + You are logged in as normal user, if you want to become super user, just su. + There is no password needed (empty password). + +
+
+ +
+ + FreeBSD 5.2.1 + + + Contributed by Alexander Schuch. + + + + This section describes how to install FreeBSD 5.2.1 (miniinst) inside of Bochs, using an ISO image. + + +
+ Getting FreeBSD + + + As 5.2.1-RELEASE-i386-miniinst.iso (240M) is no longer available from + the FreeBSD FTP server, you might want to ask a (file) search engine of your choice + for a download location. Once you downloaded the file, you should check its integrity + using the provided MD5 checksum from the + FreeBSD 5.2.1 release announcement. + +
+ +
+ Preparing Bochs + + + Create a new hard disk image using bximage (see + ) with a size of at least 350M, as the standard + installation uses 280M on its own. + + + + Next, you need to setup your bochsrc so that Bochs knows about your + (still empty) hard disk, as well as about your ISO image. Make Bochs boot from CD-ROM and + start the emulation. + +
+ +
+ Installing FreeBSD + + + This is just a very short step-by-step installation guide for FreeBSD in Bochs. It + doesn't explain what you do nor why you do it, it just tells you how to do it. + For in-deepth information refer to the FreeBSD handbook: + Installing FreeBSD. + + + + FreeBSD boots up and shows a nice (text-mode) boot option screen. Just press + return there, that is, use the default option. After loading the + kernel and needed device drivers, select 'Standard' in the installation menu. + + + + A fdisk like partition program is loaded next, where you just press A + to use the entire disk, followed by Q to finish the selection. The next + dialog asks for the boot manager you want to use. Select 'Standard' and continue. + + + + In the Disklabel Editor, you have to setup the layout of your partition. If your (virtual) + hard disk is large enough, you can press A for auto-layout. However, you + need to make sure that the /usr partition is at least + 250M large, or you will end up with a 'disk full' error message during installation. If + this is not the case, select one partition after another and press D to + delete it again. After you deleted all partitions, create two new ones. The first one will + be a swap partition; press C, enter '32M' as size and select 'Swap' from + the dialog. Press C again, and accept the remaining capacity for your + filesystem partition. Choose 'FS' as partition type and enter '/' (slash) as mount point. + Your partition layout is complete now; press Q to leave the editor. + + + This 'all-in-one' partition layout is not recommended for a FreeBSD installation on a + real box; use 'auto-layout' or something comparable to that there. + + + + + You now can choose what set of programs/files (distribution) you want to install. Take + 'User' (option 8), and select 'No' when asked to install the ports collection. You are + back in the distribution selection, where you select the first item, called 'Exit'. + Choose to install from 'CD/DVD' and answer the 'Are you sure?' dialog with 'yes'. + + + + Now, while FreeBSD installs, it is a very good time to take a look at the + FreeBSD documentation, especially + the FreeBSD handbook + and the FreeBSD FAQ. + +
+ +
+ Post-installation configuration + + + All files are installed on your (virtual) hard disk now, and FreeBSD is ready for getting set + up. As this is a very basic FreeBSD installation, you just answer 'no' to nearly all questions, + but the one about your mouse: Answer 'yes' for PS/2 mouse, and choose 'Exit' at mouse configuration. + The miniinst FreeBSD ISO image contains nearly no binary packages, so don't browse the package + collection. Then, when asked to create a new user account, answer 'yes' and create a new user + called 'bochs' (or whatever you like). You might want to use /bin/csh + or /bin/tcsh as shell rather than /bin/sh. Next, + you are asked for the super user (root) password. The installation is finished now, there is + no need to visit the general configuration menu again - answer 'no' to that question. FreeBSD + will then reboot. Shutdown Bochs, as soon as the (virtual) computer boots. + +
+ +
+ Using FreeBSD + + + Open your bochsrc and change the boot sequence, so that Bochs will boot + from hard disk, rather than from CD-ROM from now on. Start Bochs again and watch the FreeBSD + boot process. + + + + Your keyboard might use the wrong keymap, so login (into FreeBSD) as super user and use + /stand/sysinstall to start the FreeBSD configuration program. Choose + 'keymap' and select the keymap you want to use. + + + + You have successfully installed FreeBSD now. You might want to shutdown FreeBSD using + shutdown -h now, quit Bochs, and create a backup of your hard disk + image, before you start playing around. + +
+
+ +
DOS +You must read the message regarding software licenses in + before you install or use MS-DOS, DR-DOS, FreeDOS or +any other DOS as a guest operating system in Bochs. +
Accessing your CDROM + +To access your CDROM in DOS, you must download an IDE CDROM driver. +Bochs emulates a very generic CDROM drive, and several drivers are known to +work. Others don't. This section describes how to set up your +config.sys and autoexec.bat to enable +the CDROM. + + + +The drivers that have been reported to work are +OAKCDROM.SYS that comes with several versions of Windows +and SBIDE.SYS version 1.21 from Creative +Labs + +To get it, go to Creative Labs web +site, click on Support, then click Download Files. You get to a screen +where you must select the operating system and the product for which you want +the driver. Choose DOS as the operating system, and "CD-ROM: 4x and above" as +the product. There are several choices, but you want +sbide121.exe from April 15, 1997. Version 2.0 does not +work. The download file is a self-extracting ZIP file, so on +DOS or Windows you just run it; on other platforms you can try using +the unzip command. The driver is called SBIDE.SYS. + and OAKCDROM.SYS that comes with several versions of Windows. +Copy the driver to your boot disk, and then set up the startup files as follows. + + +config.sys: + device=himem.sys + device=oakcdrom.sys /D:CD001 + -or- + device=sbide.sys /D:CD001 /P:1f0,14,3f6 + +autoexec.bat: + mscdex.exe /M:10 /D:CD001 + + + +If the files mentioned in config.sys and +autoexec.bat are not in the root directory, give the full +pathname, like c:\windows\himem.sys. + + +
+
SB16 driver for DOS + +To use the SB16 device in DOS you need to load a driver for it. The file +SBBASIC.EXE contains a self-extracting archive with all required file. +After unpacking it to C:\SB16 you can execute INSTALL.EXE +to install the driver. The file DISK.ID should contain the version +string SDR-31STD-1-US (Revision 1). + +
+
Bootdisks of early DOS versions + +On the Web there are bootdisks available for most of the DOS versions ever released, +but some of them have been reported to fail in Bochs. The bootdisk for MS-DOS 1.25 +contains a boot sector of a newer DOS version, so it would fail on real hardware, +too. The floppy image for MS-DOS 2.11 has a boot sector that tries to boot from +hard disk instead of the floppy. + +
+
+ +
+ Windows NT 4.0 + +You must read the message regarding software licenses in + before you install Windows NT 4.0 as a guest operating system in Bochs. + + +Here are the known issues about installing and running Windows NT4.0 : + + + + +If you want to use the LGPL'd VGABIOS to install Windows NT 4.0 you'll need +version 0.4c or higher. With older versions you'll get a black screen after +first reboot. + + + + +to log in you must press ctrl-alt-del, and it is likely that the window manager +will trap this key combination. You can either use the trick described in + or define a user short-cut +(callable through the user short-cut gui button) +in you configuration file, for example: + +keyboard: user_shortcut=ctrl-alt-del + + + + + +For installing and using Windows NT it is necessary to limit the maximum CPUID +to 3. In the configuration file you need to add a line like this: + +cpuid: cpuid_limit_winnt=1 + + + + +
+ +
+ Windows 2000 / Windows 2000 Server +You must read the message regarding software licenses in + before you install Windows 2000 / Windows 2000 Server as a guest operating system in Bochs. + + +
+ +
+ Windows XP +You must read the message regarding software licenses in + before you install Windows XP as a guest operating system in Bochs. + + Windows XP has been reported to install from the CDROM, and run inside Bochs. + The only known issue is to set the IPS to, at least, a value of 10000000. + +
+ +
+ Windows 7 +You must read the message regarding software licenses in + before you install Windows 7 as a guest operating system in Bochs. + + +
+ +
+SCO OpenServer 5.0.5 + +Contributed by Carl Sopchak + + + +You must read the message regarding software licenses in + before you install SCO OpenServer 5.0.5 as a guest operating system in Bochs. + + + +Back in April and May of 2002, I did some work on Bochs +in order to get it to install and boot SCO's OpenServer 5.0.5 (OSR5). +Since that time, I have had several e-mails asking about this error message +or that. The newsgroup posts done at the time had all of the information that I knew, +so I pointed people there. (I had not used Bochs since...) +In February of 2003, I got another such e-mail. +Since the sender indicated they were willing to pay me to get this going for them, +I agreed to spend a few hours on it (for free, which is not common :-}). Subsequently, +I decided to document this once and for all. (I did not charge anyone anything, this time...) + + + +Note: These steps were originally used with Bochs 1.4.1 (or thereabouts, +since I was using CVS heavily at the time). It is possible (likely) that later versions of Bochs +are more tolerant/bug free, and this install may be abbreviated. However, I have not tried +to streamline it at all. + + + +These steps were performed and confirmed using Bochs version 2.0.2, and SCO OpenServer version 5.0.5. +The host OS was Red Hat Linux 8.0. + + + +First, I downloaded the tarball, and extracted the source tree. I decided to use the tarball +instead of the RPM so that I knew what options were compiled in, etc. + +linux-$ tar -xzvf bochs-2.0.2.tar.gz + + + + +Next, I configured and compiled Bochs... + +linux-$ cd bochs-2.0.2 +linux-$ ./configure --enable-cdrom --enable-ne2000 +linux-$ make + + + + +I then created my disk image: + +linux-$ ./bximage +======================================================================== + bximage + Disk Image Creation Tool for Bochs +======================================================================== + +Do you want to create a floppy disk image or a hard disk image? +Please type hd or fd. [hd] hd + +What kind of image should I create? +Please type flat, sparse or growing. [flat] + +Enter the hard disk size in megabytes, between 1 and 8257535 +[10] 2048 + +I will create a hard disk image with + cyl=4161 + heads=16 + sectors per track=63 + total sectors=4194288 + total size=2047.99 megabytes + +What should I name the image? +[c.img] hd0.img + +Writing: [] Done. + +I wrote 2147475456 bytes to hd0.img. + +The following line should appear in your .bochsrc: + ata0-master: type=disk, path="hd0.img", cylinders=4161, heads=16, spt=63 + + + + +I then created my .bochsrc file. I did this via the interactive portion of Bochs, with the +end result as follows: + +floppya: 1_44="/dev/fd0", status=inserted +floppyb: 1_44="b.img", status=inserted +ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 +ata0-master: type=disk, path="hd0.img", cylinders=4161, heads=16, spt=63, translation=auto, biosdetect=auto, model="Generic 1234" +ata0-slave: type=cdrom, path="/dev/cdrom", status=inserted, biosdetect=auto, model="Generic 1234" +ata1: enabled=0 +ata2: enabled=0 +ata3: enabled=0 +romimage: file=bios/BIOS-bochs-latest +vgaromimage: file=bios/VGABIOS-lgpl-latest +megs: 64 +parport1: enabled=1, file="lp.pipe" +com1: enabled=0 +# no sb16 +boot: cdrom +floppy_bootsig_check: disabled=0 +vga: update_freq=5 +keyboard_serial_delay: 250 +keyboard_paste_delay: 100000 +cpu: ips=3000000 +clock: sync=realtime, time0=0 +mouse: enabled=0 +private_colormap: enabled=0 +pci: enabled=0 +# no ne2k +# no loader +log: osr5.log +logprefix: %t-%e-%i%d +debugger_log: - +panic: action=ask +error: action=report +info: action=report +debug: action=ignore +keyboard: type=mf, keymap=, user_shortcut=none +config_interface: textconfig +display_library: x + +Some important things to note are that you want to boot from the cdrom, and you do NOT want the ne2000 +card configured initially. (We'll add that later...) + + + +At this point, Bochs is ready to roll! Insert the OSR5 install CD into the drive, and start Bochs. +You should soon see the SCO "boot:" prompt: + +SCO OpenServer(TM) Release 5 + +boot +: defbootstr disable=fdi,dptr + + +Note the disable= parameter that you need. These two SCO drivers cause the install to fail, so they +need to be disabled for the install boot. You will not need this once OSR5 is installed. + + + +During the install of OSR5, there are two default configuration answers that need to be changed. +For the hard disk setup, you should turn bad tracking off, since it's unnecessary on an emulated disk. +(It won't hurt to do it, it will just take a VERY long time!) +For the network setup, change the network card to Deferred. You can change other settings, if you so +desire. However, I would do the initial install with as little configured as you can get away with, then +add whatever else is needed (one step at a time) after the initial install completes. + + + +Let the install copy the files. Go get lunch. Take a nap. Go have dinner... +This can take a LONG time. On my Pentium 4 1.7GHz system, this +step took just over eight hours! (BTW, it was MUCH longer in version 1.4.1. Great job, guys!) + + + +After the install finishes, you will need to change the following lines in .bochsrc file: + +ne2k: ioaddr=0x300, irq=10, mac=b0:c4:20:00:00:00, ethmod=linux, ethdev=eth0 +boot: disk + +Obviously, if you're not using Linux, the ethmode and ethdev values on the ne2k line will be different. +Also, since Bochs uses "raw" network card access, you'll have to "setuid root" on the Bochs executable: + +linux-$ chown root bochs +linux-$ chmod u+s bochs + +(If there is a way to give a "normal user" CAP_NET_RAW capability, that would be an alternative. +I don't know how to do that...) +Restart Bochs. Now, you can just press Enter at the OSR5 boot: prompt, because the offending +drivers have been linked out of the kernel. + + + +Before you configure the network card, I'd strongly suggest getting the latest "nat" driver from SCO. +Version 5.0.5b of this driver, according to the SCO web site, "correct[s] possible system lockup +under high load due to internal buffer overflow." The driver can be found +here. +To get the Disk Image file into SCO, I downloaded the VOL.000.000 file to my linux box, +and used tar to get it on to a floppy: + +linux-$ tar -cvf /dev/fd0 VOL.000.000 + +I then used tar within OSR5 to move it from the floppy to the /tmp directory: + +osr5-# cd /tmp +osr5-# tar -xvf /dev/fd0135ds18 + +You can then use 'custom' to install the driver from the image file. +You will then want to use 'scoadmin network' to configure the network card. Choose +the Novell NE2000 card, and set the parameters to match the ne2k: line in the .bochsrc file. +DO NOT have OSR5 look for the card, as Bochs may likely crash. (It did in version 1.4.1.) + + + +You can also configure a printer, if you want. Using the spoolpipe utility that I wrote +(which can be found in Bochs' misc directory), you can print from OSR5 through the parallel +port, and you'll hardly notice +that the printing is going through an extra layer of operating system! +(You could also set up a printer using network printing, if the printer is not on the host machine...) + + + +Obviously, dont forget to apply the release supplements and other patches that are considered +"must haves" for OSR5: rs505a, oss600a, oss497b (others?). + + + +That's about as far as I have got. I played around with OSR5 within Bochs a bit, but I +can by no means say that I did any kind of real testing, let alone exhaustive testing. + + + +And of course, YMMV! :-) + + +
+ +
+ + +
diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-bochs.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-bochs.html new file mode 100644 index 0000000..9618ffa --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-bochs.html @@ -0,0 +1,248 @@ + +Using Bochs
Bochs User Manual
PrevNext

Chapter 5. Using Bochs

+
- using plugins?
+- Resources for users
+testing status page: tells what has been tried and who got it working
+search on bochs web site
+SourceForge
+  - look for bug reports
+  - how to report problems (present as FIXME request in chapter 6 as well)
+  - How to make feature requests?

5.1. Command line arguments

The following table shows the arguments that can be used on the command line. +For other arguments, see section bochsrc. +

Table 5-1. command line arguments

ArgumentDescription
-qquick start (skip configuration interface)
-f filenamespecify configuration file
-ndon't try to load a configuration file
-r pathspecify path for restoring state (if save/restore support is compiled in)
--helpdisplay help message and exit

These arguments are handled directly after starting Bochs. The next step is to load +a default or specified configuration file (unless disabled with -n). Then the rest +of the command line (bochsrc options) is parsed. This is done after reading the +configuration file so that the command line arguments can override the settings +from the file.


PrevHomeNext
How to write your own keymap table Search order for the configuration file
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-bxcommit.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-bxcommit.html new file mode 100644 index 0000000..0f4dbf8 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-bxcommit.html @@ -0,0 +1,181 @@ + +Using the bxcommit tool
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.20. Using the bxcommit tool

This tool can commit redologs into flat images.

For now, only "undoable" redologs to flat image commits are supported. +Sparse disk image commits may be added in the future.

This tool is completely interactive, and does not need any command line parameter. +Bxcommit asks for the flat image name, the redolog name, and whether to remove +to redolog file after it commits it.

Session example : +
$ ./bxcommit 
+========================================================================
+                               bxcommit
+              Undoable Disk Image Commit Tool for Bochs
+========================================================================
+
+What is the flat image name?
+[c.img] myfile.img
+
+What is the redolog name?
+[myfile.img.redolog] toapply.redolog
+
+Shall I remove the redolog afterwards?
+[yes] 


PrevHomeNext
Using the bximage toolUpGuest operating systems
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-bximage.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-bximage.html new file mode 100644 index 0000000..2ef41d0 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-bximage.html @@ -0,0 +1,183 @@ + +Using the bximage tool
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.19. Using the bximage tool

Bximage is an easy to use console based tool for creating disk images, +particularly for use with Bochs. It is completely interactive if no command +line arguments are used. It can be switched to a non-interactive mode if all +required parameters are given in the command line.

When you run bximage without one of the following options, +it will appear in interactive mode and ask for all +required parameters to create an image. +
-fd        Create a floppy image.
+-hd        Create a hard disk image.
+-mode=...  Image mode (for hard disks only - see the bochsrc sample for
+           supported options).
+-size=...  Image size in megabytes (e.g. 1.44 for floppy image, 10 for hard
+           disk image).
+-q         Quiet  mode (don't prompt for user input). Without this option bximage
+           uses the command line parameters as defaults for the interactive mode.
+           If this option is given and one of the required parameters is missing,
+           bximage will fall back to interactive mode.
+--help     Print  a  summary  of  the command line options for bximage and exit.
+
+The filename parameter specifies the name of the image to be created.

For an example of the usage, refer to Section 8.1.


PrevHomeNext
Disk Image ModesUpUsing the bxcommit tool
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-save-restore.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-save-restore.html new file mode 100644 index 0000000..21c12b1 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-save-restore.html @@ -0,0 +1,176 @@ + +Save and restore simulation
Bochs User Manual
PrevChapter 5. Using BochsNext

5.4. Save and restore simulation

Starting with version 2.3, Bochs has limited save/restore support. The state of +cpu(s), memory and all devices can be saved now. When running Bochs with there +will be a button in the header bar called "Suspend". Depending on config interface +and gui there will be a prompt where you can enter a path or a gui folder +selection dialog box. It is possible to save the state at any time, but we +recommend to do it when the simulation is idle. After pressing OK/Enter, Bochs +will save a set of files into the selected folder. The state of hard disk images +is not handled yet, so Bochs will ask you if you want to continue after saving +state. We don't recommend to continue unless you are running a read-only guest +system (e.g. Live-CD).

To restore the saved simulation state you can select the restore function in the +text mode start menu or specify the restore path at the command line: +
bochs -r /path/to/save-restore-data

Then Bochs will start up using the saved configuration and log options, restores +the state of the hardware and begins the simulation. In the restore mode Bochs +will ignore bochsrc options from the command line and does not load a normal +config file.


PrevHomeNext
The configuration interface 'textconfig'UpCommon problems and what to do about them (Troubleshooting)
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-slirp.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-slirp.html new file mode 100644 index 0000000..40e3900 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-slirp.html @@ -0,0 +1,357 @@ + +Using the 'slirp' networking module
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.12. Using the 'slirp' networking module

Slirp is a software program that emulates a PPP, SLIP, or CSLIP connection to +the Internet via a shell account. The original version has been written by +Danny Gasparovski in 1995. It has been integrated in QEMU to provide user mode +networking. Now a port of the QEMU Slirp implementation is available in Bochs.

Features and limitations: +

  • Access to the internet and host network services without root/Administrator +privileges or additional libraries.

  • Builtin DHCP and TFTP servers

  • Optional SMB support on Linux

  • ICMP traffic (ping) from guest to the host's network or the internet +not supported

  • guest access from the host or external network disabled by default

This example shows how to use the 'slirp' module with the NE2000 adapter. The line +is very similar for the E1000 or PCI Pseudo NIC. +

ne2k: mac=52:54:00:12:34:56, ethmod=slirp, ethdev=/home/volker/tests/bochs, script=""
+The "ethdev" value specifies the TFTP root directory. All other options for Slirp must +be set in a config file specified with "script" parameter. If no config file is set up, +Bochs uses this "classic" Slirp configuration shown in the "Default" column below.

8.12.1. Advanced Slirp setup with config file

An example for a Slirp config file can be found in the Bochs sources and in +binary packages (misc/slirp.conf). +

Table 8-2. Slirp config file options

OptionDescriptionDefault value
restrictedif set to 1, only built-in services are available0
netbase IP address of the virtual network10.0.2.0
masknetmask of the virtual network255.255.255.0
hostIP address of the DHCP and TFTP server10.0.2.2
hostnameDHCP client hostnameundefined
dhcpstartstart address of DHCP pool10.0.2.15
dnsIP address of the virtual DNS server10.0.2.3
bootfileboot filename returned by DHCPundefined
dnssearchcomma-separated list of DNS suffixes to search (DHCP extension)undefined
smb_exportabsolute path to the shared folder (non-Windows SMB support)undefined
smb_srvalternative IP address of the SMB server10.0.2.4
hostfwdmap guest port to host port for host-to-guest access + (see below for details)undefined

8.12.2. Access to guest services from the host

With the config file option "hostfwd" you can map guest ports to ports on the host +system. This is the format of the directive: +

  hostfwd = protocol:hostaddr:hostport-guestaddr:guestport
+The host and guest IP addresses are optional. This example shows how to access +the guest SSH server using the host port 12345. +
  hostfwd = tcp::12345-:22
+Up to 5 port redirection rules are supported per slirp instance.


PrevHomeNext
Configuring and using a tuntap network interfaceUpUsing the 'socket' networking module
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-socket.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-socket.html new file mode 100644 index 0000000..e57ede8 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-socket.html @@ -0,0 +1,244 @@ + +Using the 'socket' networking module
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.13. Using the 'socket' networking module

The original patch for the 'socket' networking module has been written by +Mariusz Matuszek in 2003. It supported interconnecting two Bochs sessions +running on the same machine via UDP using an external program called 'bxhub'.

The 'socket' networking module is now integrated in the Bochs code with these +extensions: +

  • Integrated 'vnet' server features (ARP, ICMP-echo, DHCP and TFTP)

  • Command line options for 'bxhub' added for base UDP port and 'vnet' server features

  • Support for connects from up to 6 Bochs sessions

  • Support for connecting 'bxhub' on other machine

The 'socket' networking module uses two UDP ports per Bochs session. By default +the first session receives packets from port 40000 and sends packets to port +40001. The second session uses then the ports 40002 and 40003. For further +sessions the port numbers are incremented accordingly. The port number for +receiving packets is specified with the 'ethdev' parameter of the bochsrc +line for the network adapter. The format is host:port +for connecting the 'bxhub' utility. If it runs on the same machine +('localhost') the host name can be omitted.

These examples show how to use the 'socket' module with the NE2000 adapter. The line +is very similar for the E1000 or PCI Pseudo NIC. +

ne2k: mac=52:54:00:12:34:56, ethmod=socket, ethdev=mymachine:40000, script=""
+ne2k: mac=52:54:00:12:34:56, ethmod=socket, ethdev=40000, script=""

8.13.1. Using the 'bxhub' utility

If bxhub is started without command line options, these +default values are used: +

  • UDP base port 40000

  • 2 client connections

  • Server MAC address b0:c4:20:00:00:0f

  • TFTP support disabled

To change the default settings, these parameters are supported: +

Usage: bxhub [options]
+
+Supported options:
+  -ports=...    number of virtual ethernet ports (2 - 6)
+  -base=...     base UDP port (bxhub uses 2 ports per Bochs session)
+  -mac=...      host MAC address (default is b0:c4:20:00:00:0f)
+  -tftp=...     enable TFTP support using specified directory
+  --help        display this help and exit


PrevHomeNext
Using the 'slirp' networking moduleUpUsing Bochs internal debugger
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-sound.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-sound.html new file mode 100644 index 0000000..a299a53 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/using-sound.html @@ -0,0 +1,583 @@ + +Using sound
Bochs User Manual
PrevChapter 5. Using BochsNext

5.6. Using sound

5.6.1. Sound basics

Bochs supports two types of soundcards (SB16 ISA and ES1370 PCI) and the legacy +PC speaker. The lowlevel sound interface provides a set of functions for wave +(PCM) input / output and MIDI output using the host sound system. A driver must +not implement all of these functions. The following table shows the supported +drivers and their features. +

Table 5-3. Sound lowlevel modules

NameDescriptionWave inputMIDI output
alsause the default ALSA PCM device and the default ALSA sequencer + on LinuxYesYes
ossuse the Open Sound System on Linux and FreeBSDYesYes
osxfor output on Mac OS 9 and Mac OSXNoYes
sdlfor wave output on platforms supported by SDL (1.2.x or 2.x)NoNo
winfor output to the midi and wave mapper of WindowsYesYes

These special values are also valid for the sound driver: +

  • default - select platform-default sound driver.

  • file - wave and MIDI output to file(s)

  • dummy - no output at all

When compiling Bochs, the lowlevel sound support is activated if one of the soundcards +is enabled (--enable-sb16 or --enable-es1370). +The configure script detects the available drivers and sets up a platform-default +one.

At runtime the lowlevel sound module will be loaded automatically if one of the +sound devices is enabled in the bochsrc. The drivers and +devices for wave input / output and MIDI output must be set up with the +sound option.

5.6.2. The PC speaker

The PC speaker is connected to the PIT 8254 timer #2 and generates a square +wave beep with a frequency depending on the timer value. In Bochs the +speaker is a separate plugin that is controlled by the two events "beep on" +and "beep off". The "beep on" event is also called when the frequency +changes while turned on.

The destination for the speaker output can be selected with the mode +parameter of the speaker option. Three choices are available: +

  • sound : the beep is generated by the square wave +generator which is a part of the lowlevel sound support.

  • system : only available on Linux and Windows. +On Linux /dev/console is used for output and on Windows the Beep() function.

  • gui : forwards the beep to the related gui methods +(currently only used by the Carbon gui).

5.6.3. SB16 runtime configuration

Most of the SB16 configuration parameters are available in the runtime +configuration menu or dialog. In addition to this, there is a small program +called SB16CTRL to change emulation settings from inside +the simulation.

5.6.3.1. Runtime options

Unlike other devices, the SB16 emulation has it's own logfile and a loglevel parameter +to control what should be printed there. Both the log file and +loglevel parameters can be changed at runtime. See the +sb16 bochsrc option for details.

The output parameters midimode, midifile, +wavemode and wavefile are also available at +runtime.

The dmatimer parameter controls the DMA timing for wave (PCM) +input and output. When you get non-continuous sound this value can be ajusted +to fix this. This needs a reasonably correct setting for the +cpu: ips option.

5.6.3.2. SB16CTRL

The source for the SB16CTRL program that is used to modify +the runtime behavior of the SB16 emulation is included in +misc/sb16/. It is a C +program that can be run from inside the emulation.

It currently supports the following commands:

Table 5-4. Supported options for sb16ctrl

OptionDescription
-i number Show the selected emulator info string, + e.g. sb16ctrl -i 3 to show how many patch translations are active. +
-t six numbers Load a translation into the translation table. The numbers are: + "OldBankMSB,OldBankLSB,OldProgram,NewBankMSB,NewBankLSB,NewProgram". + All values can be 0..127 or 255. 255 for "Old" values means match + any and for "New" values means don't change, + e.g. sb16ctrl -t 255,255,0,255,255,32 + to change patch 0 (Piano) to patch 32 (Acoustic Bass). +
-r Reset the patch translation table e.g. sb16ctrl -r. +
-m some numbers Upload the given numbers to the midi output device. Note + that it should be a complete midi message, and also that it is + subject to patch translation, + e.g. sb16ctrl -m 0x80,64,0 + to send a note-off message to channel 0. +
-f filename Read in a file and execute the commands in it. These have + the same format as the above commands, except that they don't have + the dash "-" in front of them. + Comment lines are supported and start with a hash sign "#". +
-h Show a brief summary of the commands. +

All numbers can be valid parameters to the strtol() function, so hex and +octal notation is fine. They have to be delimited by either commas "," or +slashes "/", spaces are not allowed.

The command line can have any number of commands. However, if none are given, +"-f -" is assumed, which means commands are taken from stdin.


PrevHomeNext
Save and restore simulationUpCommon problems and what to do about them (Troubleshooting)
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/vesa-notes.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/vesa-notes.html new file mode 100644 index 0000000..04f3a0c --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/vesa-notes.html @@ -0,0 +1,303 @@ + +Notes about VESA usage
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.16. Notes about VESA usage

Since Bochs 1.4 it is possible to use VESA graphics. There are some limitations in + the current implementation, but in general it should work ok (we have run several test + programs, the XFree86 VESA display driver, etc.) +

In order to use VESA VBE, you need to compile Bochs using the --enable-vbe + option and enable it in your bochsrc by setting the + vga option to vbe. + Finally, you need to use the + LGPL'd VGABIOS + as vgaromimage option for + applications to correctly detect VESA support. +

Note: The VGABIOS is already included in the Bochs release, so no separate download is necessary. +

Note: To take advantage of the VBE, you must tell Bochs to use the LGPL'd VGA BIOS + version 0.4c or higher. A current version of the VGA BIOS will work. +

Current limitations: +

  • 4bpp modes support is incomplete (8, 15, 16, 24 and 32bpp should work)

  • banked mode is very slow (if you can, just use Linear Frame Buffering instead!)

  • only 320x200, 640x400, 640x480, 800x600, 1024x768 are currently supported

Interesting Facts: +

  • You need a display driver capable of using the VESA BIOS for this to work + (a recent XFree86 will do, Windows 9x/NT/2K/XP probably will not work 'out of the box'.

  • Currently the VBE2 extension should be supported ok

8.16.1. Instructions to setup Bochs VBE in Windows Guest OS

This was contributed by Martin Bochnig in February 2004.

Instructions for Win95/98:
+==========================
+I can only confirm that SciTech finally made a VBE driver
+for Windows. It works out of the box, at least with win95
+as guest OS, provided you use Bochs 2.1 with the LGPL 
+vgabios.
+
+Here is how I did it :
+- install win95 with the vga driver.
+- download sdd 7 beta from http://www.majorgeeks.com/download382.html
+- download pmhelp.vxd from http://unununium.org/viewcvs/snap/redist/release/pmhelp.vxd
+- copy pmhelp.vxd to the win95 system directory
+- install sdd7
+
+800x600 and 1024x768 in 16 and 24 bpp modes here.
+I did not try 32bpp.

This was contributed by Stanislav Shwartsman in September 2004.

Instructions for Win2000/XP:
+============================
+
+Bochs VBE Display Drivers for Windows NT/2000
+http://dhenriq.en.eresmas.com/

PrevHomeNext
How to enter special key combinationUpNotes about Cirrus SVGA usage
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/voodoo-notes.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/voodoo-notes.html new file mode 100644 index 0000000..1f587e1 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/voodoo-notes.html @@ -0,0 +1,205 @@ + +Notes about Voodoo Graphics usage
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.21. Notes about Voodoo Graphics usage

Bochs supports the emulation of 4 different 3dfx Voodoo Graphics adapter models. + The Voodoo1 and Voodoo2 models are 3D-only add-on cards and require a VGA + compatible primary device. The Voodoo Banshee and it's successor Voodoo3 have + both a VGA core and a 2D/3D core, so no other VGA card is required. The 2D/3D + cards can be assigned to AGP if the i440BX chipset is selected (slot #5). +

To emulate the Voodoo1 or Voodoo2 device only the "model" parameter of the + bochsrc option "voodoo" needs to be set. If the vga extension option is set + to "voodoo" in that case, the primary display adapter is an ISA VGA card. +

For emulating the Voodoo Banshee or Voodoo3 adapter, the vga extension option + must be set to "voodoo". Using a different primary display adapter and a + Banshee compatible device with it's VGA interface disabled is not + implemented yet. Both Banshee and Voodoo3 currently need a specific external + VGA BIOS, since a Voodoo extension for the LGPL'd VGABIOS is not written yet. +

These bochsrc settings should be used for Voodoo Banshee PCI: +

  vga: extension=voodoo
+  vgaromimage: file=Pci_sg.rom
+  voodoo: model=banshee
+  
+

These settings are required for the Voodoo3 PCI: +

  vga: extension=voodoo
+  vgaromimage: file=V3_2000_PCI_SG_2.15.06_LC.rom
+  voodoo: model=voodoo3
+  
+

These settings are required for Voodoo Banshee AGP: +

  pci: chipset=i440bx, slot5=voodoo
+  vga: extension=voodoo
+  vgaromimage: file=Agp_sg.rom
+  voodoo: model=banshee
+  
+

These settings are required for the Voodoo3 AGP: +

  pci: chipset=i440bx, slot5=voodoo
+  vga: extension=voodoo
+  vgaromimage: file=1k11sg.rom
+  voodoo: model=voodoo3
+  
+


PrevHomeNext
Notes about Cirrus SVGA usageUpDisk Image Modes
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/who-uses-bochs.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/who-uses-bochs.html new file mode 100644 index 0000000..542cdf0 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/who-uses-bochs.html @@ -0,0 +1,178 @@ + +Who uses Bochs?
Bochs User Manual
PrevChapter 1. Introduction to BochsNext

1.2. Who uses Bochs?

It is hard to estimate how many people have tried Bochs or use it on a +regular basis, but a few statistics give an indication. The bochs-developers mailing list, which is the +primary source of news on bugs and releases, has over 400 subscribers. The +latest version has been downloaded over 150,000 times from SourceForge, not +counting any mirror website or CVS users.

Bochs has many possible uses, and different people use it for different +things. Many people use it to run applications in a second operating system +without needing two different computers or dual-booting. Running +Windows software on a non-x86 workstation or on an x86 Unix box are common +uses. Also, because every hardware instruction and every line of simulator +code is accessible, Bochs is used extensively for debugging new operating +systems. If you were writing boot code for your home-brewed +x86 operating system and it didn't work right, booting it in Bochs could +give you great visibility into what is really going on. The Bochs +debugger lets you simulate quickly or slowly, pausing whenever you want +to look at the contents of memory or the CPU registers. Or, if you +wanted to study which parts of a program take the most time, you could use +Bochs to measure how often certain pieces of the code were executed.

Bochs has been used as a teaching tool in Operating Systems classes, in which +students used and modified it to learn how the PC hardware works. As a final +project the students had to add a new peripheral device, so they had to learn +all about I/O ports, interrupts, and device drivers. In industry, it is used +to support legacy applications on modern hardware, and as a reference model +when testing new x86-compatible hardware.

There may be as many uses of Bochs as there are users. Do you want to run +your old DOS games? Or learn how to program under GNU/Linux, without leaving your +Windows desktop? Or reverse engineer your printer driver? You decide.


PrevHomeNext
Introduction to BochsUpIs Bochs right for me?
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/will-it-work-for-me.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/will-it-work-for-me.html new file mode 100644 index 0000000..e059531 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/will-it-work-for-me.html @@ -0,0 +1,169 @@ + +Will it work for me?
Bochs User Manual
PrevChapter 1. Introduction to BochsNext

1.4. Will it work for me?

Whether Bochs works for you depends on your host hardware, host operating +system, guest operating system, guest software, and your ability to work in +a command-line environment using documentation. There is no gui or wizard +to help you through the setup process. You do not get a recovery or installation +disk to assist you in the process of installing a guest operating system. +Bochs only provides you with the "virtual hardware", and it is up to you to do the rest.

Bochs will run on Windows, GNU/Linux, FreeBSD, OpenBSD, or BeOS. +If you are running on x86 hardware, you have a range of choices. +Check the installation section for your host platform to see what options +Bochs supports on your platform. If the most important factor is speed, +you may want to try a virtualization product instead of Bochs (VMware, plex86).

If you are using a non-x86 machine, then Bochs is one of the few choices for +running x86 software. Bochs has been known to work on Solaris (Sparc), +GNU/Linux (PowerPC/Alpha), MacOS (PowerPC), IRIX (MIPS), BeOS (PowerPC), Digital +Unix (Alpha), and AIX (PowerPC).

You can also find more detailed testing information on the testing +status page on the Bochs web site.


PrevHomeNext
Is Bochs right for me?UpBochs License
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/winimage.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/winimage.html new file mode 100644 index 0000000..7795498 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/winimage.html @@ -0,0 +1,271 @@ + +Win32 only: Tools to manipulate disk images
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.4. Win32 only: Tools to manipulate disk images

8.4.1. Winimage

Someone on the bochs-developers list mentioned that they use a program +called WinImage, from www.winimage.com +to read and write disk images (floppy and hard disk). Winimage is a +commercial product with a 30-day trial.

If anyone wants to write a tutorial, send mail to bochs-developers mailing list and volunteer.

8.4.2. DiskExplorer

This section was contributed by Luca Cassioli and Stanislav Shwartsman

I eventually found what all of you were looking for for a long time: a +freeware, graphical, win32 compatible HardDisk image editor! It can +handle a large variety of formats, but the one you need is VMWARE +2.0 PLAIN DISK: you can import/export to/from Bochs images COMPLETE +DIRECTORIES!

You can find it at +http://hp.vector.co.jp/authors/VA013937/editdisk/index_e.html

8.4.3. Ben Lunt's MTOOLs for Bochs and Win32 and/or DOS

Ben Lunt wrote a set of utilities for Dos/Win32 to manipulate flat disk images.

You can find it at +http://www.frontiernet.net/~fys/mtools.htm

These utilities includes : +

  • + BOCHSRC.EXE "Bochs Resource" + A utility to create/modify a Bochs resource file.

  • + MKDOSFS.EXE "Make DOS FS" + A utility to create a FAT disk image of specified size.

  • + MCOPYF.EXE "Copy From" + A utility to copy an existing file from a FAT disk image to the current + directory.

  • + MDEL.EXE "Delete file" + A utility to delete an existing file from a FAT disk image.

  • + MDIREX.EXE "Directory Extended" + A utility to view a FAT disk images directory and FAT contents.

  • + MGETIMG.EXE "Get Disk Image" + A utility to create a disk image from a floppy (multiple formats).

  • + MBOOTCD.EXE "Create a CDROM Image with boot options" + Create a CDROM image capable of booting with only a ROOT and a single file.

  • + MGETCD.EXE "Get Disk Image of Physical CD" + A utility to create a disk image from a CD.

  • + MCDINFO.EXE "Get CD Info" + A utility to the info from a CD. Not much yet, but a little.


PrevHomeNext
Bochs GNU/Linux DiskToolsUpX Windows: Color allocation problems
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/xcolormap.html b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/xcolormap.html new file mode 100644 index 0000000..d77abad --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/docs/user/xcolormap.html @@ -0,0 +1,164 @@ + +X Windows: Color allocation problems
Bochs User Manual
PrevChapter 8. Tips and TechniquesNext

8.5. X Windows: Color allocation problems

One common problem in X windows is that the screen colors can be abnormal +if other X programs have already allocated all the colors. If the colors +don't look right, try quitting colorful applications such as Netscape, +clearing any complex images in the background, etc. so that Bochs has a +chance to allocate the colors it needs.

If Bochs continues to have problems, or you want Bochs to have perfect +colors without having to quit any other application, you can try turning +on the private_colormap option +in the configuration file. Using a private +colormap causes the Bochs window to have its own set of 256 colors to work +with. When the cursor is over the Bochs display, Bochs will look correct +and other parts of the screen may change to very strange colors. When the +cursor goes to any other window, the other windows will look correct +and Bochs will have strange colors. A better solution, if your hardware +can support it, is to run your X server with 24-bit or 32-bit color.


PrevHomeNext
Win32 only: Tools to manipulate disk imagesUpScreen saver turns on too quickly
\ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl-pc-de.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl-pc-de.map new file mode 100644 index 0000000..de4fd59 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl-pc-de.map @@ -0,0 +1,222 @@ +# Bochs Keymap file +# $Id: sdl-pc-de.map,v 1.2 2002/10/24 21:06:55 bdenney Exp $ +# Target: PC(x86) keyboard, DE keymap, SDL gui on X11 +# Author: Volker Ruppert +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Host_key_name +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Host_key_name +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Host_key_name is the name of the key combination according to the gui library +# (X windows, SDL, etc). Each GUI module must provide a function that converts +# these host key names into numbers. A pointer to the conversion function is +# passed to loadKeymap(), and it is used when parsing the keymap file. As the +# keymap file is parsed, the conversion function is called for each host key +# name, to convert it into a number. Only the number is stored. If the host +# key name is not found, the conversion function returns BX_KEYMAP_UNKNOWN, and +# the keymap code will panic, like this: +# +# [KMAP ] line 51: unknown host key name 'SDLK_PAREN_RIGHT' +# +# If this happens, you must edit the keymap file, and either correct the host +# key name or comment out that line. +# + +BX_KEY_0 '0' SDLK_0 +BX_KEY_0+BX_KEY_SHIFT_L '=' SDLK_EQUALS +BX_KEY_1 '1' SDLK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' SDLK_EXCLAIM +BX_KEY_2 '2' SDLK_2 +BX_KEY_2+BX_KEY_ALT_R '' SDLK_2 +BX_KEY_2+BX_KEY_SHIFT_L '"' SDLK_QUOTEDBL +BX_KEY_3 '3' SDLK_3 +BX_KEY_3+BX_KEY_SHIFT_L '' SDLK_3 +BX_KEY_4 '4' SDLK_4 +BX_KEY_4+BX_KEY_SHIFT_L '$' SDLK_DOLLAR +BX_KEY_4+BX_KEY_ALT_R '' SDLK_4 +BX_KEY_5 '5' SDLK_5 +BX_KEY_5+BX_KEY_ALT_R '' SDLK_5 +BX_KEY_5+BX_KEY_SHIFT_L '%' SDLK_5 +BX_KEY_6 '6' SDLK_6 +BX_KEY_6+BX_KEY_SHIFT_L '&' SDLK_AMPERSAND +BX_KEY_7 '7' SDLK_7 +BX_KEY_7+BX_KEY_ALT_R '{' SDLK_7 +BX_KEY_7+BX_KEY_SHIFT_L '/' SDLK_SLASH +BX_KEY_8 '8' SDLK_8 +BX_KEY_8+BX_KEY_ALT_R '[' SDLK_LEFTBRACKET +BX_KEY_8+BX_KEY_SHIFT_L '(' SDLK_LEFTPAREN +BX_KEY_9 '9' SDLK_9 +BX_KEY_9+BX_KEY_ALT_R ']' SDLK_RIGHTBRACKET +BX_KEY_9+BX_KEY_SHIFT_L ')' SDLK_RIGHTPAREN +BX_KEY_A+BX_KEY_SHIFT_L 'A' SDLK_a +BX_KEY_A 'a' SDLK_a +BX_KEY_A+BX_KEY_ALT_R '' SDLK_a +BX_KEY_B+BX_KEY_SHIFT_L 'B' SDLK_b +BX_KEY_B 'b' SDLK_b +BX_KEY_C+BX_KEY_SHIFT_L 'C' SDLK_c +BX_KEY_C 'c' SDLK_c +BX_KEY_C+BX_KEY_ALT_R '' SDLK_c +BX_KEY_D+BX_KEY_SHIFT_L 'D' SDLK_d +BX_KEY_D 'd' SDLK_d +BX_KEY_E+BX_KEY_SHIFT_L 'E' SDLK_e +BX_KEY_E+BX_KEY_ALT_R none SDLK_EURO +BX_KEY_E 'e' SDLK_e +BX_KEY_F+BX_KEY_SHIFT_L 'F' SDLK_f +BX_KEY_F 'f' SDLK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' SDLK_g +BX_KEY_G 'g' SDLK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' SDLK_h +BX_KEY_H 'h' SDLK_h +BX_KEY_I+BX_KEY_SHIFT_L 'I' SDLK_i +BX_KEY_I 'i' SDLK_i +BX_KEY_J+BX_KEY_SHIFT_L 'J' SDLK_j +BX_KEY_J 'j' SDLK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' SDLK_k +BX_KEY_K 'k' SDLK_k +BX_KEY_L+BX_KEY_SHIFT_L 'L' SDLK_l +BX_KEY_L 'l' SDLK_l +BX_KEY_M+BX_KEY_SHIFT_L 'M' SDLK_m +BX_KEY_M 'm' SDLK_m +BX_KEY_M+BX_KEY_ALT_R '' SDLK_m +BX_KEY_N+BX_KEY_SHIFT_L 'N' SDLK_n +BX_KEY_N 'n' SDLK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' SDLK_o +BX_KEY_O 'o' SDLK_o +BX_KEY_O+BX_KEY_ALT_R '' SDLK_o +BX_KEY_P+BX_KEY_SHIFT_L 'P' SDLK_p +BX_KEY_P 'p' SDLK_p +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' SDLK_q +BX_KEY_Q+BX_KEY_ALT_R '@' SDLK_AT +BX_KEY_Q 'q' SDLK_q +BX_KEY_R+BX_KEY_SHIFT_L 'R' SDLK_r +BX_KEY_R+BX_KEY_ALT_R '' SDLK_r +BX_KEY_R 'r' SDLK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' SDLK_s +BX_KEY_S 's' SDLK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' SDLK_t +BX_KEY_T 't' SDLK_t +BX_KEY_U+BX_KEY_SHIFT_L 'U' SDLK_u +BX_KEY_U 'u' SDLK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' SDLK_v +BX_KEY_V 'v' SDLK_v +BX_KEY_W+BX_KEY_SHIFT_L 'W' SDLK_w +BX_KEY_W 'w' SDLK_w +BX_KEY_X+BX_KEY_SHIFT_L 'X' SDLK_x +BX_KEY_X+BX_KEY_ALT_R '' SDLK_x +BX_KEY_X 'x' SDLK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Z' SDLK_z +BX_KEY_Y 'z' SDLK_z +BX_KEY_Z+BX_KEY_SHIFT_L 'Y' SDLK_y +BX_KEY_Z+BX_KEY_ALT_R '' SDLK_y +BX_KEY_Z 'y' SDLK_y +BX_KEY_F1 none SDLK_F1 +BX_KEY_F2 none SDLK_F2 +BX_KEY_F3 none SDLK_F3 +BX_KEY_F4 none SDLK_F4 +BX_KEY_F5 none SDLK_F5 +BX_KEY_F6 none SDLK_F6 +BX_KEY_F7 none SDLK_F7 +BX_KEY_F8 none SDLK_F8 +BX_KEY_F9 none SDLK_F9 +BX_KEY_F10 none SDLK_F10 +BX_KEY_F11 none SDLK_F11 +BX_KEY_F12 none SDLK_F12 +BX_KEY_ALT_L none SDLK_LALT +BX_KEY_ALT_L none SDLK_LMETA +BX_KEY_ALT_R none SDLK_RALT +BX_KEY_ALT_R none SDLK_MODE +BX_KEY_BACKSLASH apostrophe SDLK_QUOTE +BX_KEY_BACKSLASH '#' SDLK_HASH +BX_KEY_BACKSPACE none SDLK_BACKSPACE +BX_KEY_CAPS_LOCK none SDLK_CAPSLOCK +BX_KEY_COMMA ',' SDLK_COMMA +BX_KEY_COMMA+BX_KEY_SHIFT_L ';' SDLK_SEMICOLON +BX_KEY_CTRL_L none SDLK_LCTRL +BX_KEY_CTRL_R none SDLK_RCTRL +BX_KEY_DELETE none SDLK_DELETE +BX_KEY_DOWN none SDLK_DOWN +BX_KEY_END none SDLK_END +BX_KEY_ENTER return SDLK_RETURN +BX_KEY_EQUALS none SDLK_WORLD_20 +BX_KEY_EQUALS+BX_KEY_ALT_R '' SDLK_WORLD_20 +BX_KEY_EQUALS+BX_KEY_SHIFT_L '`' SDLK_WORLD_20 +BX_KEY_ESC none SDLK_ESCAPE +BX_KEY_GRAVE '^' SDLK_CARET +BX_KEY_GRAVE+BX_KEY_SHIFT_L '' SDLK_CARET +BX_KEY_GRAVE+BX_KEY_ALT_R '' SDLK_CARET +BX_KEY_HOME none SDLK_HOME +BX_KEY_INSERT none SDLK_INSERT +BX_KEY_KP_5 none SDLK_KP5 +BX_KEY_KP_ADD none SDLK_KP_PLUS +BX_KEY_KP_DELETE none SDLK_KP_PERIOD +BX_KEY_KP_DIVIDE none SDLK_KP_DIVIDE +BX_KEY_KP_DOWN none SDLK_KP2 +BX_KEY_KP_END none SDLK_KP1 +BX_KEY_KP_ENTER none SDLK_KP_ENTER +BX_KEY_KP_HOME none SDLK_KP7 +BX_KEY_KP_INSERT none SDLK_KP0 +BX_KEY_KP_LEFT none SDLK_KP4 +BX_KEY_KP_MULTIPLY none SDLK_KP_MULTIPLY +BX_KEY_KP_PAGE_DOWN none SDLK_KP3 +BX_KEY_KP_PAGE_UP none SDLK_KP9 +BX_KEY_KP_RIGHT none SDLK_KP6 +BX_KEY_KP_SUBTRACT none SDLK_KP_MINUS +BX_KEY_KP_UP none SDLK_KP8 +BX_KEY_LEFT none SDLK_LEFT +BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R '|' SDLK_LESS +BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' SDLK_GREATER +BX_KEY_LEFT_BACKSLASH '<' SDLK_LESS +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '' SDLK_WORLD_92 +BX_KEY_LEFT_BRACKET '' SDLK_WORLD_92 +BX_KEY_MENU none SDLK_MENU +BX_KEY_MINUS+BX_KEY_ALT_L backslash SDLK_BACKSLASH +BX_KEY_MINUS+BX_KEY_SHIFT_L '?' SDLK_QUESTION +BX_KEY_MINUS '' SDLK_WORLD_63 +BX_KEY_NUM_LOCK none SDLK_NUMLOCK +BX_KEY_PAGE_DOWN none SDLK_PAGEDOWN +BX_KEY_PAGE_UP none SDLK_PAGEUP +BX_KEY_PAUSE none SDLK_BREAK +BX_KEY_PAUSE none SDLK_PAUSE +BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' SDLK_COLON +BX_KEY_PERIOD '.' SDLK_PERIOD +BX_KEY_PERIOD+BX_KEY_ALT_L '' SDLK_PERIOD +BX_KEY_PRINT none SDLK_PRINT +BX_KEY_PRINT none SDLK_SYSREQ +BX_KEY_RIGHT none SDLK_RIGHT +BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R '~' SDLK_PLUS +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '*' SDLK_PLUS +BX_KEY_RIGHT_BRACKET '+' SDLK_PLUS +BX_KEY_SCRL_LOCK none SDLK_SCROLLOCK +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '' SDLK_WORLD_86 +BX_KEY_SEMICOLON '' SDLK_WORLD_86 +BX_KEY_SHIFT_L none SDLK_LSHIFT +BX_KEY_SHIFT_R none SDLK_RSHIFT +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '' SDLK_WORLD_68 +BX_KEY_SINGLE_QUOTE '' SDLK_WORLD_68 +BX_KEY_SLASH '-' SDLK_MINUS +BX_KEY_SLASH+BX_KEY_SHIFT_L '_' SDLK_UNDERSCORE +BX_KEY_SPACE space SDLK_SPACE +BX_KEY_TAB tab SDLK_TAB +BX_KEY_UP none SDLK_UP +BX_KEY_WIN_L none SDLK_LSUPER +BX_KEY_WIN_R none SDLK_RSUPER diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl-pc-us.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl-pc-us.map new file mode 100644 index 0000000..3440992 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl-pc-us.map @@ -0,0 +1,211 @@ +# Bochs Keymap file +# $Id: sdl-pc-us.map,v 1.2 2002/10/24 21:06:55 bdenney Exp $ +# Target: PC(x86) keyboard, US keymap, SDL gui +# Author: Bryce Denney +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Host_key_name +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Host_key_name +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Host_key_name is the name of the key combination according to the gui library +# (X windows, SDL, etc). Each GUI module must provide a function that converts +# these host key names into numbers. A pointer to the conversion function is +# passed to loadKeymap(), and it is used when parsing the keymap file. As the +# keymap file is parsed, the conversion function is called for each host key +# name, to convert it into a number. Only the number is stored. If the host +# key name is not found, the conversion function returns BX_KEYMAP_UNKNOWN, and +# the keymap code will panic, like this: +# +# [KMAP ] line 51: unknown host key name 'SDLK_PAREN_RIGHT' +# +# If this happens, you must edit the keymap file, and either correct the host +# key name or comment out that line. +# + +BX_KEY_0 '0' SDLK_0 +BX_KEY_0+BX_KEY_SHIFT_L ')' SDLK_RIGHTPAREN +BX_KEY_1 '1' SDLK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' SDLK_EXCLAIM +BX_KEY_2 '2' SDLK_2 +BX_KEY_2+BX_KEY_SHIFT_L '@' SDLK_AT +BX_KEY_3 '3' SDLK_3 +BX_KEY_3+BX_KEY_SHIFT_L '#' SDLK_HASH +BX_KEY_4 '4' SDLK_4 +BX_KEY_4+BX_KEY_SHIFT_L '$' SDLK_DOLLAR +BX_KEY_5 '5' SDLK_5 +#BX_KEY_5+BX_KEY_SHIFT_L '%' SDLK_PERCENT +BX_KEY_6 '6' SDLK_6 +BX_KEY_6+BX_KEY_SHIFT_L '^' SDLK_CARET +BX_KEY_7 '7' SDLK_7 +BX_KEY_7+BX_KEY_SHIFT_L '&' SDLK_AMPERSAND +BX_KEY_8 '8' SDLK_8 +BX_KEY_8+BX_KEY_SHIFT_L '*' SDLK_ASTERISK +BX_KEY_9 '9' SDLK_9 +BX_KEY_9+BX_KEY_SHIFT_L '(' SDLK_LEFTPAREN +BX_KEY_A+BX_KEY_SHIFT_L 'A' SDLK_a +BX_KEY_A 'a' SDLK_a +BX_KEY_B+BX_KEY_SHIFT_L 'B' SDLK_b +BX_KEY_B 'b' SDLK_b +BX_KEY_C+BX_KEY_SHIFT_L 'C' SDLK_c +BX_KEY_C 'c' SDLK_c +BX_KEY_D+BX_KEY_SHIFT_L 'D' SDLK_d +BX_KEY_D 'd' SDLK_d +BX_KEY_E+BX_KEY_SHIFT_L 'E' SDLK_e +BX_KEY_E 'e' SDLK_e +BX_KEY_F+BX_KEY_SHIFT_L 'F' SDLK_f +BX_KEY_F 'f' SDLK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' SDLK_g +BX_KEY_G 'g' SDLK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' SDLK_h +BX_KEY_H 'h' SDLK_h +BX_KEY_I+BX_KEY_SHIFT_L 'I' SDLK_i +BX_KEY_I 'i' SDLK_i +BX_KEY_J+BX_KEY_SHIFT_L 'J' SDLK_j +BX_KEY_J 'j' SDLK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' SDLK_k +BX_KEY_K 'k' SDLK_k +BX_KEY_L+BX_KEY_SHIFT_L 'L' SDLK_l +BX_KEY_L 'l' SDLK_l +BX_KEY_M+BX_KEY_SHIFT_L 'M' SDLK_m +BX_KEY_M 'm' SDLK_m +BX_KEY_N+BX_KEY_SHIFT_L 'N' SDLK_n +BX_KEY_N 'n' SDLK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' SDLK_o +BX_KEY_O 'o' SDLK_o +BX_KEY_P+BX_KEY_SHIFT_L 'P' SDLK_p +BX_KEY_P 'p' SDLK_p +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' SDLK_q +BX_KEY_Q 'q' SDLK_q +BX_KEY_R+BX_KEY_SHIFT_L 'R' SDLK_r +BX_KEY_R 'r' SDLK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' SDLK_s +BX_KEY_S 's' SDLK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' SDLK_t +BX_KEY_T 't' SDLK_t +BX_KEY_U+BX_KEY_SHIFT_L 'U' SDLK_u +BX_KEY_U 'u' SDLK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' SDLK_v +BX_KEY_V 'v' SDLK_v +BX_KEY_W+BX_KEY_SHIFT_L 'W' SDLK_w +BX_KEY_W 'w' SDLK_w +BX_KEY_X+BX_KEY_SHIFT_L 'X' SDLK_x +BX_KEY_X 'x' SDLK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Y' SDLK_y +BX_KEY_Y 'y' SDLK_y +BX_KEY_Z+BX_KEY_SHIFT_L 'Z' SDLK_z +BX_KEY_Z 'z' SDLK_z +BX_KEY_F1 none SDLK_F1 +BX_KEY_F2 none SDLK_F2 +BX_KEY_F3 none SDLK_F3 +BX_KEY_F4 none SDLK_F4 +BX_KEY_F5 none SDLK_F5 +BX_KEY_F6 none SDLK_F6 +BX_KEY_F7 none SDLK_F7 +BX_KEY_F8 none SDLK_F8 +BX_KEY_F9 none SDLK_F9 +BX_KEY_F10 none SDLK_F10 +BX_KEY_F11 none SDLK_F11 +BX_KEY_F12 none SDLK_F12 +BX_KEY_ALT_L none SDLK_LALT +BX_KEY_ALT_L none SDLK_LMETA +BX_KEY_ALT_R none SDLK_MODE +#BX_KEY_ALT_R none SDLK_Multi_key +BX_KEY_BACKSLASH backslash SDLK_BACKSLASH +#BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '|' SDLK_bar +BX_KEY_BACKSPACE none SDLK_BACKSPACE +BX_KEY_CAPS_LOCK none SDLK_CAPSLOCK +BX_KEY_COMMA ',' SDLK_COMMA +BX_KEY_COMMA+BX_KEY_SHIFT_L '<' SDLK_LESS +BX_KEY_CTRL_L none SDLK_LCTRL +BX_KEY_CTRL_R none SDLK_RCTRL +BX_KEY_DELETE none SDLK_DELETE +BX_KEY_DOWN none SDLK_DOWN +BX_KEY_END none SDLK_END +BX_KEY_ENTER return SDLK_RETURN +BX_KEY_EQUALS '=' SDLK_EQUALS +BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' SDLK_PLUS +BX_KEY_ESC none SDLK_ESCAPE +#BX_KEY_GRAVE+BX_KEY_SHIFT_L '~' SDLK_asciitilde +BX_KEY_GRAVE '`' SDLK_BACKQUOTE +BX_KEY_HOME none SDLK_HOME +BX_KEY_INSERT none SDLK_INSERT +BX_KEY_KP_5 none SDLK_KP5 +#BX_KEY_KP_5 none SDLK_KP_BEGIN +BX_KEY_KP_ADD none SDLK_KP_PLUS +BX_KEY_KP_DELETE none SDLK_KP_PERIOD +#BX_KEY_KP_DELETE none SDLK_KP_DELETE +BX_KEY_KP_DIVIDE none SDLK_KP_DIVIDE +BX_KEY_KP_DOWN none SDLK_KP2 +#BX_KEY_KP_DOWN none SDLK_KP_DOWN +BX_KEY_KP_END none SDLK_KP1 +#BX_KEY_KP_END none SDLK_KP_END +BX_KEY_KP_ENTER none SDLK_KP_ENTER +BX_KEY_KP_HOME none SDLK_KP7 +#BX_KEY_KP_HOME none SDLK_KP_HOME +BX_KEY_KP_INSERT none SDLK_KP0 +#BX_KEY_KP_INSERT none SDLK_KP_INSERT +BX_KEY_KP_LEFT none SDLK_KP4 +#BX_KEY_KP_LEFT none SDLK_KP_LEFT +BX_KEY_KP_MULTIPLY none SDLK_KP_MULTIPLY +BX_KEY_KP_PAGE_DOWN none SDLK_KP3 +#BX_KEY_KP_PAGE_DOWN none SDLK_KP_PAGE_DOWN +BX_KEY_KP_PAGE_UP none SDLK_KP9 +#BX_KEY_KP_PAGE_UP none SDLK_KP_PAGE_UP +BX_KEY_KP_RIGHT none SDLK_KP6 +#BX_KEY_KP_RIGHT none SDLK_KP_Right +BX_KEY_KP_SUBTRACT none SDLK_KP_MINUS +BX_KEY_KP_UP none SDLK_KP8 +#BX_KEY_KP_UP none SDLK_KP_Up +BX_KEY_LEFT none SDLK_LEFT +#BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '{' SDLK_BRACELEFT +BX_KEY_LEFT_BRACKET '[' SDLK_LEFTBRACKET +BX_KEY_MENU none SDLK_MENU +BX_KEY_MINUS '-' SDLK_MINUS +BX_KEY_MINUS+BX_KEY_SHIFT_L '_' SDLK_UNDERSCORE +BX_KEY_NUM_LOCK none SDLK_NUMLOCK +BX_KEY_PAGE_DOWN none SDLK_PAGEDOWN +BX_KEY_PAGE_UP none SDLK_PAGEUP +BX_KEY_PAUSE none SDLK_BREAK +BX_KEY_PAUSE none SDLK_PAUSE +BX_KEY_PERIOD+BX_KEY_SHIFT_L '>' SDLK_GREATER +BX_KEY_PERIOD '.' SDLK_PERIOD +BX_KEY_PRINT none SDLK_PRINT +BX_KEY_PRINT none SDLK_SYSREQ +BX_KEY_RIGHT none SDLK_RIGHT +#BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '}' SDLK_BRACERIGHT +BX_KEY_RIGHT_BRACKET ']' SDLK_RIGHTBRACKET +BX_KEY_SCRL_LOCK none SDLK_SCROLLOCK +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L ':' SDLK_COLON +BX_KEY_SEMICOLON ';' SDLK_SEMICOLON +BX_KEY_SHIFT_L none SDLK_LSHIFT +BX_KEY_SHIFT_R none SDLK_RSHIFT +BX_KEY_SINGLE_QUOTE apostrophe SDLK_QUOTE +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '"' SDLK_QUOTEDBL +BX_KEY_SLASH+BX_KEY_SHIFT_L '?' SDLK_QUESTION +BX_KEY_SLASH '/' SDLK_SLASH +BX_KEY_SPACE space SDLK_SPACE +#BX_KEY_TAB none SDLK_ISO_LEFT_TAB +BX_KEY_TAB tab SDLK_TAB +BX_KEY_UP none SDLK_UP +BX_KEY_WIN_L none SDLK_LSUPER +BX_KEY_WIN_R none SDLK_LSUPER diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl2-pc-de.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl2-pc-de.map new file mode 100644 index 0000000..496a235 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl2-pc-de.map @@ -0,0 +1,219 @@ +# Bochs Keymap file +# $Id: sdl2-pc-de.map 12400 2014-07-06 18:29:06Z vruppert $ +# Target: PC(x86) keyboard, DE keymap, SDL2 gui +# Author: Volker Ruppert +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Host_key_name +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Host_key_name +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Host_key_name is the name of the key combination according to the gui library +# (X windows, SDL, etc). Each GUI module must provide a function that converts +# these host key names into numbers. A pointer to the conversion function is +# passed to loadKeymap(), and it is used when parsing the keymap file. As the +# keymap file is parsed, the conversion function is called for each host key +# name, to convert it into a number. Only the number is stored. If the host +# key name is not found, the conversion function returns BX_KEYMAP_UNKNOWN, and +# the keymap code will panic, like this: +# +# [KMAP ] line 51: unknown host key name 'SDLK_PAREN_RIGHT' +# +# If this happens, you must edit the keymap file, and either correct the host +# key name or comment out that line. +# + +BX_KEY_0 '0' SDLK_0 +BX_KEY_0+BX_KEY_SHIFT_L '=' SDLK_EQUALS +BX_KEY_1 '1' SDLK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' SDLK_EXCLAIM +BX_KEY_2 '2' SDLK_2 +BX_KEY_2+BX_KEY_ALT_R '' SDLK_2 +BX_KEY_2+BX_KEY_SHIFT_L '"' SDLK_QUOTEDBL +BX_KEY_3 '3' SDLK_3 +BX_KEY_3+BX_KEY_SHIFT_L '' SDLK_3 +BX_KEY_4 '4' SDLK_4 +BX_KEY_4+BX_KEY_SHIFT_L '$' SDLK_DOLLAR +BX_KEY_4+BX_KEY_ALT_R '' SDLK_4 +BX_KEY_5 '5' SDLK_5 +BX_KEY_5+BX_KEY_ALT_R '' SDLK_5 +BX_KEY_5+BX_KEY_SHIFT_L '%' SDLK_5 +BX_KEY_6 '6' SDLK_6 +BX_KEY_6+BX_KEY_SHIFT_L '&' SDLK_AMPERSAND +BX_KEY_7 '7' SDLK_7 +BX_KEY_7+BX_KEY_ALT_R '{' SDLK_7 +BX_KEY_7+BX_KEY_SHIFT_L '/' SDLK_SLASH +BX_KEY_8 '8' SDLK_8 +BX_KEY_8+BX_KEY_ALT_R '[' SDLK_LEFTBRACKET +BX_KEY_8+BX_KEY_SHIFT_L '(' SDLK_LEFTPAREN +BX_KEY_9 '9' SDLK_9 +BX_KEY_9+BX_KEY_ALT_R ']' SDLK_RIGHTBRACKET +BX_KEY_9+BX_KEY_SHIFT_L ')' SDLK_RIGHTPAREN +BX_KEY_A+BX_KEY_SHIFT_L 'A' SDLK_a +BX_KEY_A 'a' SDLK_a +BX_KEY_A+BX_KEY_ALT_R '' SDLK_a +BX_KEY_B+BX_KEY_SHIFT_L 'B' SDLK_b +BX_KEY_B 'b' SDLK_b +BX_KEY_C+BX_KEY_SHIFT_L 'C' SDLK_c +BX_KEY_C 'c' SDLK_c +BX_KEY_C+BX_KEY_ALT_R '' SDLK_c +BX_KEY_D+BX_KEY_SHIFT_L 'D' SDLK_d +BX_KEY_D 'd' SDLK_d +BX_KEY_E+BX_KEY_SHIFT_L 'E' SDLK_e +BX_KEY_E 'e' SDLK_e +BX_KEY_F+BX_KEY_SHIFT_L 'F' SDLK_f +BX_KEY_F 'f' SDLK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' SDLK_g +BX_KEY_G 'g' SDLK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' SDLK_h +BX_KEY_H 'h' SDLK_h +BX_KEY_I+BX_KEY_SHIFT_L 'I' SDLK_i +BX_KEY_I 'i' SDLK_i +BX_KEY_J+BX_KEY_SHIFT_L 'J' SDLK_j +BX_KEY_J 'j' SDLK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' SDLK_k +BX_KEY_K 'k' SDLK_k +BX_KEY_L+BX_KEY_SHIFT_L 'L' SDLK_l +BX_KEY_L 'l' SDLK_l +BX_KEY_M+BX_KEY_SHIFT_L 'M' SDLK_m +BX_KEY_M 'm' SDLK_m +BX_KEY_M+BX_KEY_ALT_R '' SDLK_m +BX_KEY_N+BX_KEY_SHIFT_L 'N' SDLK_n +BX_KEY_N 'n' SDLK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' SDLK_o +BX_KEY_O 'o' SDLK_o +BX_KEY_O+BX_KEY_ALT_R '' SDLK_o +BX_KEY_P+BX_KEY_SHIFT_L 'P' SDLK_p +BX_KEY_P 'p' SDLK_p +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' SDLK_q +BX_KEY_Q+BX_KEY_ALT_R '@' SDLK_AT +BX_KEY_Q 'q' SDLK_q +BX_KEY_R+BX_KEY_SHIFT_L 'R' SDLK_r +BX_KEY_R+BX_KEY_ALT_R '' SDLK_r +BX_KEY_R 'r' SDLK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' SDLK_s +BX_KEY_S 's' SDLK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' SDLK_t +BX_KEY_T 't' SDLK_t +BX_KEY_U+BX_KEY_SHIFT_L 'U' SDLK_u +BX_KEY_U 'u' SDLK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' SDLK_v +BX_KEY_V 'v' SDLK_v +BX_KEY_W+BX_KEY_SHIFT_L 'W' SDLK_w +BX_KEY_W 'w' SDLK_w +BX_KEY_X+BX_KEY_SHIFT_L 'X' SDLK_x +BX_KEY_X+BX_KEY_ALT_R '' SDLK_x +BX_KEY_X 'x' SDLK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Z' SDLK_z +BX_KEY_Y 'z' SDLK_z +BX_KEY_Z+BX_KEY_SHIFT_L 'Y' SDLK_y +BX_KEY_Z+BX_KEY_ALT_R '' SDLK_y +BX_KEY_Z 'y' SDLK_y +BX_KEY_F1 none SDLK_F1 +BX_KEY_F2 none SDLK_F2 +BX_KEY_F3 none SDLK_F3 +BX_KEY_F4 none SDLK_F4 +BX_KEY_F5 none SDLK_F5 +BX_KEY_F6 none SDLK_F6 +BX_KEY_F7 none SDLK_F7 +BX_KEY_F8 none SDLK_F8 +BX_KEY_F9 none SDLK_F9 +BX_KEY_F10 none SDLK_F10 +BX_KEY_F11 none SDLK_F11 +BX_KEY_F12 none SDLK_F12 +BX_KEY_ALT_L none SDLK_LALT +BX_KEY_ALT_R none SDLK_RALT +BX_KEY_ALT_R none SDLK_MODE +BX_KEY_BACKSLASH apostrophe SDLK_QUOTE +BX_KEY_BACKSLASH '#' SDLK_HASH +BX_KEY_BACKSPACE none SDLK_BACKSPACE +BX_KEY_CAPS_LOCK none SDLK_CAPSLOCK +BX_KEY_COMMA ',' SDLK_COMMA +BX_KEY_COMMA+BX_KEY_SHIFT_L ';' SDLK_SEMICOLON +BX_KEY_CTRL_L none SDLK_LCTRL +BX_KEY_CTRL_R none SDLK_RCTRL +BX_KEY_DELETE none SDLK_DELETE +BX_KEY_DOWN none SDLK_DOWN +BX_KEY_END none SDLK_END +BX_KEY_ENTER return SDLK_RETURN +BX_KEY_EQUALS none SDLK_WORLD_20 +BX_KEY_EQUALS+BX_KEY_ALT_R '' SDLK_WORLD_20 +BX_KEY_EQUALS+BX_KEY_SHIFT_L '`' SDLK_WORLD_20 +BX_KEY_ESC none SDLK_ESCAPE +BX_KEY_GRAVE '^' SDLK_CARET +BX_KEY_GRAVE+BX_KEY_SHIFT_L '' SDLK_CARET +BX_KEY_GRAVE+BX_KEY_ALT_R '' SDLK_CARET +BX_KEY_HOME none SDLK_HOME +BX_KEY_INSERT none SDLK_INSERT +BX_KEY_KP_5 none SDLK_KP_5 +BX_KEY_KP_ADD none SDLK_KP_PLUS +BX_KEY_KP_DELETE none SDLK_KP_PERIOD +BX_KEY_KP_DIVIDE none SDLK_KP_DIVIDE +BX_KEY_KP_DOWN none SDLK_KP_2 +BX_KEY_KP_END none SDLK_KP_1 +BX_KEY_KP_ENTER none SDLK_KP_ENTER +BX_KEY_KP_HOME none SDLK_KP_7 +BX_KEY_KP_INSERT none SDLK_KP_0 +BX_KEY_KP_LEFT none SDLK_KP_4 +BX_KEY_KP_MULTIPLY none SDLK_KP_MULTIPLY +BX_KEY_KP_PAGE_DOWN none SDLK_KP_3 +BX_KEY_KP_PAGE_UP none SDLK_KP_9 +BX_KEY_KP_RIGHT none SDLK_KP_6 +BX_KEY_KP_SUBTRACT none SDLK_KP_MINUS +BX_KEY_KP_UP none SDLK_KP_8 +BX_KEY_LEFT none SDLK_LEFT +BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R '|' SDLK_LESS +BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' SDLK_GREATER +BX_KEY_LEFT_BACKSLASH '<' SDLK_LESS +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '' SDLK_WORLD_92 +BX_KEY_LEFT_BRACKET '' SDLK_WORLD_92 +BX_KEY_MENU none SDLK_MENU +BX_KEY_MINUS+BX_KEY_ALT_L backslash SDLK_BACKSLASH +BX_KEY_MINUS+BX_KEY_SHIFT_L '?' SDLK_QUESTION +BX_KEY_MINUS '' SDLK_WORLD_63 +BX_KEY_NUM_LOCK none SDLK_NUMLOCKCLEAR +BX_KEY_PAGE_DOWN none SDLK_PAGEDOWN +BX_KEY_PAGE_UP none SDLK_PAGEUP +BX_KEY_PAUSE none SDLK_PAUSE +BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' SDLK_COLON +BX_KEY_PERIOD '.' SDLK_PERIOD +BX_KEY_PERIOD+BX_KEY_ALT_L '' SDLK_PERIOD +BX_KEY_PRINT none SDLK_PRINTSCREEN +BX_KEY_PRINT none SDLK_SYSREQ +BX_KEY_RIGHT none SDLK_RIGHT +BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R '~' SDLK_PLUS +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '*' SDLK_PLUS +BX_KEY_RIGHT_BRACKET '+' SDLK_PLUS +BX_KEY_SCRL_LOCK none SDLK_SCROLLLOCK +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '' SDLK_WORLD_86 +BX_KEY_SEMICOLON '' SDLK_WORLD_86 +BX_KEY_SHIFT_L none SDLK_LSHIFT +BX_KEY_SHIFT_R none SDLK_RSHIFT +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '' SDLK_WORLD_68 +BX_KEY_SINGLE_QUOTE '' SDLK_WORLD_68 +BX_KEY_SLASH '-' SDLK_MINUS +BX_KEY_SLASH+BX_KEY_SHIFT_L '_' SDLK_UNDERSCORE +BX_KEY_SPACE space SDLK_SPACE +BX_KEY_TAB tab SDLK_TAB +BX_KEY_UP none SDLK_UP +BX_KEY_WIN_L none SDLK_LGUI +BX_KEY_WIN_R none SDLK_RGUI diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl2-pc-us.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl2-pc-us.map new file mode 100644 index 0000000..7fb1eaa --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/sdl2-pc-us.map @@ -0,0 +1,191 @@ +# Bochs Keymap file +# $Id: sdl2-pc-us.map 12400 2014-07-06 18:29:06Z vruppert $ +# Target: PC(x86) keyboard, US keymap, SDL2 gui +# Author: Volker Ruppert (based on SDL keymap by Bryce Denney) +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Host_key_name +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Host_key_name +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Host_key_name is the name of the key combination according to the gui library +# (X windows, SDL, etc). Each GUI module must provide a function that converts +# these host key names into numbers. A pointer to the conversion function is +# passed to loadKeymap(), and it is used when parsing the keymap file. As the +# keymap file is parsed, the conversion function is called for each host key +# name, to convert it into a number. Only the number is stored. If the host +# key name is not found, the conversion function returns BX_KEYMAP_UNKNOWN, and +# the keymap code will panic, like this: +# +# [KMAP ] line 51: unknown host key name 'SDLK_PAREN_RIGHT' +# +# If this happens, you must edit the keymap file, and either correct the host +# key name or comment out that line. +# + +BX_KEY_0 '0' SDLK_0 +BX_KEY_0+BX_KEY_SHIFT_L ')' SDLK_RIGHTPAREN +BX_KEY_1 '1' SDLK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' SDLK_EXCLAIM +BX_KEY_2 '2' SDLK_2 +BX_KEY_2+BX_KEY_SHIFT_L '@' SDLK_AT +BX_KEY_3 '3' SDLK_3 +BX_KEY_3+BX_KEY_SHIFT_L '#' SDLK_HASH +BX_KEY_4 '4' SDLK_4 +BX_KEY_4+BX_KEY_SHIFT_L '$' SDLK_DOLLAR +BX_KEY_5 '5' SDLK_5 +BX_KEY_6 '6' SDLK_6 +BX_KEY_6+BX_KEY_SHIFT_L '^' SDLK_CARET +BX_KEY_7 '7' SDLK_7 +BX_KEY_7+BX_KEY_SHIFT_L '&' SDLK_AMPERSAND +BX_KEY_8 '8' SDLK_8 +BX_KEY_8+BX_KEY_SHIFT_L '*' SDLK_ASTERISK +BX_KEY_9 '9' SDLK_9 +BX_KEY_9+BX_KEY_SHIFT_L '(' SDLK_LEFTPAREN +BX_KEY_A+BX_KEY_SHIFT_L 'A' SDLK_a +BX_KEY_A 'a' SDLK_a +BX_KEY_B+BX_KEY_SHIFT_L 'B' SDLK_b +BX_KEY_B 'b' SDLK_b +BX_KEY_C+BX_KEY_SHIFT_L 'C' SDLK_c +BX_KEY_C 'c' SDLK_c +BX_KEY_D+BX_KEY_SHIFT_L 'D' SDLK_d +BX_KEY_D 'd' SDLK_d +BX_KEY_E+BX_KEY_SHIFT_L 'E' SDLK_e +BX_KEY_E 'e' SDLK_e +BX_KEY_F+BX_KEY_SHIFT_L 'F' SDLK_f +BX_KEY_F 'f' SDLK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' SDLK_g +BX_KEY_G 'g' SDLK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' SDLK_h +BX_KEY_H 'h' SDLK_h +BX_KEY_I+BX_KEY_SHIFT_L 'I' SDLK_i +BX_KEY_I 'i' SDLK_i +BX_KEY_J+BX_KEY_SHIFT_L 'J' SDLK_j +BX_KEY_J 'j' SDLK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' SDLK_k +BX_KEY_K 'k' SDLK_k +BX_KEY_L+BX_KEY_SHIFT_L 'L' SDLK_l +BX_KEY_L 'l' SDLK_l +BX_KEY_M+BX_KEY_SHIFT_L 'M' SDLK_m +BX_KEY_M 'm' SDLK_m +BX_KEY_N+BX_KEY_SHIFT_L 'N' SDLK_n +BX_KEY_N 'n' SDLK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' SDLK_o +BX_KEY_O 'o' SDLK_o +BX_KEY_P+BX_KEY_SHIFT_L 'P' SDLK_p +BX_KEY_P 'p' SDLK_p +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' SDLK_q +BX_KEY_Q 'q' SDLK_q +BX_KEY_R+BX_KEY_SHIFT_L 'R' SDLK_r +BX_KEY_R 'r' SDLK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' SDLK_s +BX_KEY_S 's' SDLK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' SDLK_t +BX_KEY_T 't' SDLK_t +BX_KEY_U+BX_KEY_SHIFT_L 'U' SDLK_u +BX_KEY_U 'u' SDLK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' SDLK_v +BX_KEY_V 'v' SDLK_v +BX_KEY_W+BX_KEY_SHIFT_L 'W' SDLK_w +BX_KEY_W 'w' SDLK_w +BX_KEY_X+BX_KEY_SHIFT_L 'X' SDLK_x +BX_KEY_X 'x' SDLK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Y' SDLK_y +BX_KEY_Y 'y' SDLK_y +BX_KEY_Z+BX_KEY_SHIFT_L 'Z' SDLK_z +BX_KEY_Z 'z' SDLK_z +BX_KEY_F1 none SDLK_F1 +BX_KEY_F2 none SDLK_F2 +BX_KEY_F3 none SDLK_F3 +BX_KEY_F4 none SDLK_F4 +BX_KEY_F5 none SDLK_F5 +BX_KEY_F6 none SDLK_F6 +BX_KEY_F7 none SDLK_F7 +BX_KEY_F8 none SDLK_F8 +BX_KEY_F9 none SDLK_F9 +BX_KEY_F10 none SDLK_F10 +BX_KEY_F11 none SDLK_F11 +BX_KEY_F12 none SDLK_F12 +BX_KEY_ALT_L none SDLK_LALT +BX_KEY_ALT_R none SDLK_MODE +BX_KEY_BACKSLASH backslash SDLK_BACKSLASH +BX_KEY_BACKSPACE none SDLK_BACKSPACE +BX_KEY_CAPS_LOCK none SDLK_CAPSLOCK +BX_KEY_COMMA ',' SDLK_COMMA +BX_KEY_COMMA+BX_KEY_SHIFT_L '<' SDLK_LESS +BX_KEY_CTRL_L none SDLK_LCTRL +BX_KEY_CTRL_R none SDLK_RCTRL +BX_KEY_DELETE none SDLK_DELETE +BX_KEY_DOWN none SDLK_DOWN +BX_KEY_END none SDLK_END +BX_KEY_ENTER return SDLK_RETURN +BX_KEY_EQUALS '=' SDLK_EQUALS +BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' SDLK_PLUS +BX_KEY_ESC none SDLK_ESCAPE +BX_KEY_GRAVE '`' SDLK_BACKQUOTE +BX_KEY_HOME none SDLK_HOME +BX_KEY_INSERT none SDLK_INSERT +BX_KEY_KP_5 none SDLK_KP_5 +BX_KEY_KP_ADD none SDLK_KP_PLUS +BX_KEY_KP_DELETE none SDLK_KP_PERIOD +BX_KEY_KP_DIVIDE none SDLK_KP_DIVIDE +BX_KEY_KP_DOWN none SDLK_KP_2 +BX_KEY_KP_END none SDLK_KP_1 +BX_KEY_KP_ENTER none SDLK_KP_ENTER +BX_KEY_KP_HOME none SDLK_KP_7 +BX_KEY_KP_INSERT none SDLK_KP_0 +BX_KEY_KP_LEFT none SDLK_KP_4 +BX_KEY_KP_MULTIPLY none SDLK_KP_MULTIPLY +BX_KEY_KP_PAGE_DOWN none SDLK_KP_3 +BX_KEY_KP_PAGE_UP none SDLK_KP_9 +BX_KEY_KP_RIGHT none SDLK_KP_6 +BX_KEY_KP_SUBTRACT none SDLK_KP_MINUS +BX_KEY_KP_UP none SDLK_KP_8 +BX_KEY_LEFT none SDLK_LEFT +BX_KEY_LEFT_BRACKET '[' SDLK_LEFTBRACKET +BX_KEY_MENU none SDLK_MENU +BX_KEY_MINUS '-' SDLK_MINUS +BX_KEY_MINUS+BX_KEY_SHIFT_L '_' SDLK_UNDERSCORE +BX_KEY_NUM_LOCK none SDLK_NUMLOCKCLEAR +BX_KEY_PAGE_DOWN none SDLK_PAGEDOWN +BX_KEY_PAGE_UP none SDLK_PAGEUP +BX_KEY_PAUSE none SDLK_PAUSE +BX_KEY_PERIOD+BX_KEY_SHIFT_L '>' SDLK_GREATER +BX_KEY_PERIOD '.' SDLK_PERIOD +BX_KEY_PRINT none SDLK_PRINTSCREEN +BX_KEY_PRINT none SDLK_SYSREQ +BX_KEY_RIGHT none SDLK_RIGHT +BX_KEY_RIGHT_BRACKET ']' SDLK_RIGHTBRACKET +BX_KEY_SCRL_LOCK none SDLK_SCROLLLOCK +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L ':' SDLK_COLON +BX_KEY_SEMICOLON ';' SDLK_SEMICOLON +BX_KEY_SHIFT_L none SDLK_LSHIFT +BX_KEY_SHIFT_R none SDLK_RSHIFT +BX_KEY_SINGLE_QUOTE apostrophe SDLK_QUOTE +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '"' SDLK_QUOTEDBL +BX_KEY_SLASH+BX_KEY_SHIFT_L '?' SDLK_QUESTION +BX_KEY_SLASH '/' SDLK_SLASH +BX_KEY_SPACE space SDLK_SPACE +BX_KEY_TAB tab SDLK_TAB +BX_KEY_UP none SDLK_UP +BX_KEY_WIN_L none SDLK_LGUI +BX_KEY_WIN_R none SDLK_RGUI diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-be.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-be.map new file mode 100644 index 0000000..0a607e0 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-be.map @@ -0,0 +1,220 @@ +# Bochs Keymap file +# $Id: x11-pc-be.map,v 1.2 2003/07/29 13:31:11 bdenney Exp $ +# Target: PC(x86) keyboard, BE keymap +# Author: Wouter Verhelst, +# based on FR keymap by Christophe Bothamy, Bryce Denney +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. + +BX_KEY_0+BX_KEY_SHIFT_L '0' XK_0 +BX_KEY_0 '' XK_agrave +BX_KEY_0+BX_KEY_ALT_R '}' XK_braceright +BX_KEY_1+BX_KEY_SHIFT_L '1' XK_1 +BX_KEY_1 '&' XK_ampersand +BX_KEY_1+BX_KEY_ALT_R '|' XK_bar +BX_KEY_2+BX_KEY_SHIFT_L '2' XK_2 +BX_KEY_2+BX_KEY_ALT_R '@' XK_at +BX_KEY_2 '' XK_eacute +BX_KEY_3+BX_KEY_SHIFT_L '3' XK_3 +BX_KEY_3+BX_KEY_ALT_R '#' XK_numbersign +BX_KEY_3 '"' XK_quotedbl +BX_KEY_4+BX_KEY_SHIFT_L '4' XK_4 +BX_KEY_4 apostrophe XK_apostrophe +BX_KEY_5+BX_KEY_SHIFT_L '5' XK_5 +BX_KEY_5 '(' XK_parenleft +BX_KEY_6+BX_KEY_SHIFT_L '6' XK_6 +BX_KEY_6+BX_KEY_ALT_R '^' XK_asciicircum +BX_KEY_6 '' XK_section +BX_KEY_7+BX_KEY_SHIFT_L '7' XK_7 +BX_KEY_7 '' XK_egrave +BX_KEY_8+BX_KEY_SHIFT_L '8' XK_8 +BX_KEY_8 '!' XK_exclam +BX_KEY_9+BX_KEY_SHIFT_L '9' XK_9 +BX_KEY_9+BX_KEY_ALT_R '{' XK_braceleft +BX_KEY_9 '' XK_ccedilla +BX_KEY_A+BX_KEY_SHIFT_L 'Q' XK_Q +BX_KEY_A 'q' XK_q +BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B +BX_KEY_B 'b' XK_b +BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C +BX_KEY_C 'c' XK_c +BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D +BX_KEY_D 'd' XK_d +BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E +BX_KEY_E 'e' XK_e +BX_KEY_E+BX_KEY_ALT_R none XK_EuroSign +BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F +BX_KEY_F 'f' XK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G +BX_KEY_G 'g' XK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H +BX_KEY_H 'h' XK_h +BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I +BX_KEY_I 'i' XK_i +BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J +BX_KEY_J 'j' XK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K +BX_KEY_K 'k' XK_k +BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L +BX_KEY_L 'l' XK_l +BX_KEY_M+BX_KEY_SHIFT_L '?' XK_question +BX_KEY_M ',' XK_comma +BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N +BX_KEY_N 'n' XK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O +BX_KEY_O 'o' XK_o +BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P +BX_KEY_P 'p' XK_p +BX_KEY_Q+BX_KEY_SHIFT_L 'A' XK_A +BX_KEY_Q 'a' XK_a +BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R +BX_KEY_R 'r' XK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S +BX_KEY_S 's' XK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T +BX_KEY_T 't' XK_t +BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U +BX_KEY_U 'u' XK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V +BX_KEY_V 'v' XK_v +BX_KEY_W+BX_KEY_SHIFT_L 'Z' XK_Z +BX_KEY_W 'z' XK_z +BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X +BX_KEY_X 'x' XK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y +BX_KEY_Y 'y' XK_y +BX_KEY_Z+BX_KEY_SHIFT_L 'W' XK_W +BX_KEY_Z 'w' XK_w +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_ALT_R none XK_Alt_R +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_BACKSLASH '' XK_mu +BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '' XK_sterling +BX_KEY_BACKSLASH+BX_KEY_ALT_R '`' XK_dead_grave +BX_KEY_BACKSPACE none XK_BackSpace +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_COMMA+BX_KEY_SHIFT_L '.' XK_period +BX_KEY_COMMA ';' XK_semicolon +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_CTRL_R none XK_Control_R +BX_KEY_DELETE none XK_Delete +BX_KEY_DOWN none XK_Down +BX_KEY_END none XK_End +BX_KEY_ENTER return XK_Return +BX_KEY_EQUALS '-' XK_minus +BX_KEY_EQUALS+BX_KEY_SHIFT_L '_' XK_underscore +BX_KEY_ESC none XK_Escape +BX_KEY_GRAVE '' XK_twosuperior +BX_KEY_GRAVE+BX_KEY_SHIFT_L '' XK_threesuperior +BX_KEY_HOME none XK_Home +BX_KEY_INSERT none XK_Insert +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_LEFT none XK_Left +BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater +BX_KEY_LEFT_BACKSLASH '<' XK_less +BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R backslash XK_backslash +BX_KEY_LEFT_BRACKET none XK_dead_circumflex +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L none XK_dead_diaeresis +BX_KEY_LEFT_BRACKET+BX_KEY_ALT_R '[' XK_bracketleft +BX_KEY_MENU none XK_Menu +BX_KEY_MINUS+BX_KEY_SHIFT_L '' XK_degree +BX_KEY_MINUS ')' XK_parenright +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_PAGE_DOWN none XK_Page_Down +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause +BX_KEY_PERIOD ':' XK_colon +BX_KEY_PERIOD+BX_KEY_SHIFT_L '/' XK_slash +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_RIGHT none XK_Right +BX_KEY_RIGHT_BRACKET '$' XK_dollar +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '*' XK_asterisk +BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R ']' XK_bracketright +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L 'M' XK_M +BX_KEY_SEMICOLON 'm' XK_m +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_SHIFT_R none XK_Shift_R +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '%' XK_percent +BX_KEY_SINGLE_QUOTE+BX_KEY_ALT_R none XK_dead_acute +BX_KEY_SINGLE_QUOTE '' XK_ugrave +BX_KEY_SLASH '=' XK_equal +BX_KEY_SLASH+BX_KEY_SHIFT_L '+' XK_plus +BX_KEY_SLASH+BX_KEY_ALT_R none XK_dead_tilde +BX_KEY_SPACE space XK_space +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_TAB tab XK_Tab +BX_KEY_UP none XK_Up +BX_KEY_WIN_L none XK_Super_L +BX_KEY_WIN_R none XK_Super_R diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-da.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-da.map new file mode 100644 index 0000000..41ead2b --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-da.map @@ -0,0 +1,247 @@ +# Bochs Keymap file +# $Id: x11-pc-da.map,v 0.9 2002/09/02 +# Target: PC(x86) keyboard, DA keymap +# Author: Andreas Ott +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. + +BX_KEY_0 '0' XK_0 +BX_KEY_0+BX_KEY_ALT_R '}' XK_braceright +BX_KEY_0+BX_KEY_SHIFT_L '=' XK_equal +BX_KEY_1 '1' XK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam +BX_KEY_1+BX_KEY_ALT_R '' XK_exclamdown +BX_KEY_2 '2' XK_2 +BX_KEY_2+BX_KEY_SHIFT_L '=' XK_quotedbl +BX_KEY_2+BX_KEY_ALT_R '@' XK_at # XK_twosuperior +BX_KEY_3 '3' XK_3 +BX_KEY_3+BX_KEY_SHIFT_L '#' XK_numbersign +BX_KEY_3+BX_KEY_ALT_R '' XK_sterling +BX_KEY_4 '4' XK_4 +BX_KEY_4+BX_KEY_SHIFT_L '' XK_currency +BX_KEY_4+BX_KEY_ALT_R '$' XK_dollar +BX_KEY_5 '5' XK_5 +BX_KEY_5+BX_KEY_ALT_R '' XK_onehalf +BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent +BX_KEY_6 '6' XK_6 +BX_KEY_6+BX_KEY_SHIFT_L '&' XK_ampersand +BX_KEY_6+BX_KEY_ALT_R '' XK_yen +BX_KEY_7 '7' XK_7 +BX_KEY_7+BX_KEY_ALT_R '{' XK_braceleft +BX_KEY_7+BX_KEY_SHIFT_L '/' XK_slash +BX_KEY_8 '8' XK_8 +BX_KEY_8+BX_KEY_ALT_R '[' XK_bracketleft +BX_KEY_8+BX_KEY_SHIFT_L '(' XK_parenleft +BX_KEY_9 '9' XK_9 +BX_KEY_9+BX_KEY_ALT_R ']' XK_bracketright +BX_KEY_9+BX_KEY_SHIFT_L ')' XK_parenright +BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A +BX_KEY_A 'a' XK_a +BX_KEY_A+BX_KEY_ALT_R '' XK_ordfeminine +BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B +BX_KEY_B 'b' XK_b +BX_KEY_B+BX_KEY_ALT_R none XK_rightdoublequotemark +BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C +BX_KEY_C 'c' XK_c +BX_KEY_C+BX_KEY_ALT_R '' XK_copyright +BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D +BX_KEY_D 'd' XK_d +BX_KEY_D+BX_KEY_ALT_R '' XK_eth +BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E +BX_KEY_E+BX_KEY_ALT_R '?' XK_EuroSign +BX_KEY_E 'e' XK_e +BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F +BX_KEY_F+BX_KEY_ALT_R '?' XK_dstroke +BX_KEY_F 'f' XK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G +BX_KEY_G+BX_KEY_ALT_R '?' XK_eng +BX_KEY_G 'g' XK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H +BX_KEY_H 'h' XK_h +BX_KEY_H+BX_KEY_ALT_R '?' XK_hstroke +BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I +BX_KEY_I 'i' XK_i +BX_KEY_I+BX_KEY_ALT_R none XK_rightarrow +BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J +BX_KEY_J 'j' XK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K +BX_KEY_K 'k' XK_k +BX_KEY_K+BX_KEY_ALT_R none XK_kra +BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L +BX_KEY_L 'l' XK_l +BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M +BX_KEY_M 'm' XK_m +BX_KEY_M+BX_KEY_ALT_R '' XK_mu +BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N +BX_KEY_N 'n' XK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O +BX_KEY_O 'o' XK_o +BX_KEY_O+BX_KEY_ALT_R none XK_oslash +BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P +BX_KEY_P 'p' XK_p +BX_KEY_P+BX_KEY_ALT_R '' XK_thorn +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q +BX_KEY_Q+BX_KEY_ALT_R '@' XK_at +BX_KEY_Q 'q' XK_q +BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R +BX_KEY_R+BX_KEY_ALT_R '' XK_registered +BX_KEY_R 'r' XK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S +BX_KEY_S 's' XK_s +BX_KEY_S+BX_KEY_ALT_R '' XK_ssharp +BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T +BX_KEY_T 't' XK_t +BX_KEY_T+BX_KEY_ALT_R '' XK_thorn +BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U +BX_KEY_U+BX_KEY_ALT_R none XK_downarrow +BX_KEY_U 'u' XK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V +BX_KEY_V+BX_KEY_ALT_R none XK_leftdoublequotemark +BX_KEY_V 'v' XK_v +BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W +BX_KEY_W+BX_KEY_ALT_R '?' XK_lstroke +BX_KEY_W 'w' XK_w +BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X +BX_KEY_X+BX_KEY_ALT_R '' XK_guillemotright +BX_KEY_X 'x' XK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y +BX_KEY_Y+BX_KEY_ALT_R none XK_leftarrow +BX_KEY_Y 'y' XK_y +BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z +BX_KEY_Z+BX_KEY_ALT_R '' XK_guillemotleft +BX_KEY_Z 'z' XK_z +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_BACKSLASH apostrophe XK_apostrophe +BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '*' XK_asterisk +BX_KEY_BACKSPACE none XK_BackSpace +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_COMMA ',' XK_comma +BX_KEY_COMMA+BX_KEY_ALT_R none XK_horizconnector +BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_CTRL_R none XK_Control_R +BX_KEY_DELETE none XK_Delete +BX_KEY_DOWN none XK_Down +BX_KEY_END none XK_End +BX_KEY_ENTER return XK_Return +BX_KEY_EQUALS none XK_acute +BX_KEY_EQUALS+BX_KEY_ALT_R '|' XK_bar +BX_KEY_EQUALS+BX_KEY_SHIFT_L '`' XK_grave +BX_KEY_ESC none XK_Escape +BX_KEY_GRAVE '' XK_onehalf +BX_KEY_GRAVE+BX_KEY_SHIFT_L '' XK_section +BX_KEY_GRAVE+BX_KEY_ALT_R '' XK_threequarters +BX_KEY_HOME none XK_Home +BX_KEY_INSERT none XK_Insert +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_LEFT none XK_Left +BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R backslash XK_backslash +BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater +BX_KEY_LEFT_BACKSLASH '<' XK_less +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '' XK_Aring +BX_KEY_LEFT_BRACKET+BX_KEY_ALT_L none XK_diaeresis +BX_KEY_LEFT_BRACKET '' XK_aring +BX_KEY_MENU none XK_Menu +BX_KEY_MINUS+BX_KEY_ALT_R '' XK_plusminus +BX_KEY_MINUS+BX_KEY_SHIFT_L '?' XK_question +BX_KEY_MINUS '+' XK_plus +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_PAGE_DOWN none XK_Page_Down +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause +BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' XK_colon +BX_KEY_PERIOD '.' XK_period +BX_KEY_PERIOD+BX_KEY_ALT_R '' XK_periodcentered +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_RIGHT none XK_Right +BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R '~' XK_asciitilde +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '^' XK_asciicircum +BX_KEY_RIGHT_BRACKET '"' XK_diaeresis +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '' XK_AE +BX_KEY_SEMICOLON '' XK_ae +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_SHIFT_R none XK_Shift_R +BX_KEY_SINGLE_QUOTE '' XK_oslash +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '' XK_Ooblique +BX_KEY_SLASH+BX_KEY_ALT_R '' XK_hyphen +BX_KEY_SLASH '-' XK_minus +BX_KEY_SLASH+BX_KEY_SHIFT_L '_' XK_underscore +BX_KEY_SPACE space XK_space +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_TAB tab XK_Tab +BX_KEY_UP none XK_Up +BX_KEY_WIN_L none XK_Super_L +BX_KEY_WIN_R none XK_Super_R diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-de.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-de.map new file mode 100644 index 0000000..1c354f4 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-de.map @@ -0,0 +1,248 @@ +# Bochs Keymap file +# $Id: x11-pc-de.map,v 1.8 2004/06/05 15:45:05 vruppert Exp $ +# Target: PC(x86) keyboard, DE keymap +# Author: Volker Ruppert +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. + +BX_KEY_0 '0' XK_0 +BX_KEY_0+BX_KEY_ALT_R '}' XK_braceright +BX_KEY_0+BX_KEY_SHIFT_L '=' XK_equal +BX_KEY_1 '1' XK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam +BX_KEY_1+BX_KEY_ALT_R '' XK_onesuperior +BX_KEY_2 '2' XK_2 +BX_KEY_2+BX_KEY_SHIFT_L '"' XK_quotedbl +BX_KEY_2+BX_KEY_ALT_R '' XK_twosuperior +BX_KEY_3 '3' XK_3 +BX_KEY_3+BX_KEY_SHIFT_L '' XK_section +BX_KEY_3+BX_KEY_ALT_R '' XK_threesuperior +BX_KEY_4 '4' XK_4 +BX_KEY_4+BX_KEY_SHIFT_L '$' XK_dollar +BX_KEY_4+BX_KEY_ALT_R '' XK_onequarter +BX_KEY_5 '5' XK_5 +BX_KEY_5+BX_KEY_ALT_R '' XK_onehalf +BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent +BX_KEY_6 '6' XK_6 +BX_KEY_6+BX_KEY_SHIFT_L '&' XK_ampersand +BX_KEY_6+BX_KEY_ALT_R '' XK_threequarters +BX_KEY_7 '7' XK_7 +BX_KEY_7+BX_KEY_ALT_R '{' XK_braceleft +BX_KEY_7+BX_KEY_SHIFT_L '/' XK_slash +BX_KEY_8 '8' XK_8 +BX_KEY_8+BX_KEY_ALT_R '[' XK_bracketleft +BX_KEY_8+BX_KEY_SHIFT_L '(' XK_parenleft +BX_KEY_9 '9' XK_9 +BX_KEY_9+BX_KEY_ALT_R ']' XK_bracketright +BX_KEY_9+BX_KEY_SHIFT_L ')' XK_parenright +BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A +BX_KEY_A 'a' XK_a +BX_KEY_A+BX_KEY_ALT_R '' XK_ae +BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B +BX_KEY_B 'b' XK_b +BX_KEY_B+BX_KEY_ALT_R none XK_rightdoublequotemark +BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C +BX_KEY_C 'c' XK_c +BX_KEY_C+BX_KEY_ALT_R '' XK_cent +BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D +BX_KEY_D 'd' XK_d +BX_KEY_D+BX_KEY_ALT_R '' XK_eth +BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E +BX_KEY_E+BX_KEY_ALT_R none XK_EuroSign +BX_KEY_E 'e' XK_e +BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F +BX_KEY_F+BX_KEY_ALT_R none XK_dstroke +BX_KEY_F 'f' XK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G +BX_KEY_G+BX_KEY_ALT_R none XK_eng +BX_KEY_G 'g' XK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H +BX_KEY_H 'h' XK_h +BX_KEY_H+BX_KEY_ALT_R none XK_hstroke +BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I +BX_KEY_I 'i' XK_i +BX_KEY_I+BX_KEY_ALT_R none XK_rightarrow +BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J +BX_KEY_J 'j' XK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K +BX_KEY_K 'k' XK_k +BX_KEY_K+BX_KEY_ALT_R none XK_kra +BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L +BX_KEY_L 'l' XK_l +BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M +BX_KEY_M 'm' XK_m +BX_KEY_M+BX_KEY_ALT_R '' XK_mu +BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N +BX_KEY_N 'n' XK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O +BX_KEY_O 'o' XK_o +BX_KEY_O+BX_KEY_ALT_R '' XK_oslash +BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P +BX_KEY_P 'p' XK_p +BX_KEY_P+BX_KEY_ALT_R '' XK_thorn +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q +BX_KEY_Q+BX_KEY_ALT_R '@' XK_at +BX_KEY_Q 'q' XK_q +BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R +BX_KEY_R+BX_KEY_ALT_R '' XK_paragraph +BX_KEY_R 'r' XK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S +BX_KEY_S 's' XK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T +BX_KEY_T 't' XK_t +BX_KEY_T+BX_KEY_ALT_R none XK_tslash +BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U +BX_KEY_U+BX_KEY_ALT_R none XK_downarrow +BX_KEY_U 'u' XK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V +BX_KEY_V+BX_KEY_ALT_R none XK_leftdoublequotemark +BX_KEY_V 'v' XK_v +BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W +BX_KEY_W+BX_KEY_ALT_R none XK_lstroke +BX_KEY_W 'w' XK_w +BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X +BX_KEY_X+BX_KEY_ALT_R '' XK_guillemotright +BX_KEY_X 'x' XK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Z' XK_Z +BX_KEY_Y+BX_KEY_ALT_R none XK_leftarrow +BX_KEY_Y 'z' XK_z +BX_KEY_Z+BX_KEY_SHIFT_L 'Y' XK_Y +BX_KEY_Z+BX_KEY_ALT_R '' XK_guillemotleft +BX_KEY_Z 'y' XK_y +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_ALT_R none XK_Alt_R +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_ALT_R none XK_ISO_Level3_Shift +BX_KEY_BACKSLASH apostrophe XK_apostrophe +BX_KEY_BACKSLASH '#' XK_numbersign +BX_KEY_BACKSPACE none XK_BackSpace +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_COMMA ',' XK_comma +BX_KEY_COMMA+BX_KEY_ALT_R none XK_horizconnector +BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_CTRL_R none XK_Control_R +BX_KEY_DELETE none XK_Delete +BX_KEY_DOWN none XK_Down +BX_KEY_END none XK_End +BX_KEY_ENTER return XK_Return +BX_KEY_EQUALS none XK_acute +BX_KEY_EQUALS+BX_KEY_ALT_R '' XK_cedilla +BX_KEY_EQUALS+BX_KEY_SHIFT_L '`' XK_grave +BX_KEY_ESC none XK_Escape +BX_KEY_GRAVE '^' XK_asciicircum +BX_KEY_GRAVE+BX_KEY_SHIFT_L '' XK_degree +BX_KEY_GRAVE+BX_KEY_ALT_R '' XK_notsign +BX_KEY_HOME none XK_Home +BX_KEY_INSERT none XK_Insert +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_LEFT none XK_Left +BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R '|' XK_bar +BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater +BX_KEY_LEFT_BACKSLASH '<' XK_less +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '' XK_Udiaeresis +BX_KEY_LEFT_BRACKET+BX_KEY_ALT_L none XK_diaeresis +BX_KEY_LEFT_BRACKET '' XK_udiaeresis +BX_KEY_MENU none XK_Menu +BX_KEY_MINUS+BX_KEY_ALT_L backslash XK_backslash +BX_KEY_MINUS+BX_KEY_SHIFT_L '?' XK_question +BX_KEY_MINUS '' XK_ssharp +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_PAGE_DOWN none XK_Page_Down +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause +BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' XK_colon +BX_KEY_PERIOD '.' XK_period +BX_KEY_PERIOD+BX_KEY_ALT_L '' XK_periodcentered +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_RIGHT none XK_Right +BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R '~' XK_asciitilde +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '*' XK_asterisk +BX_KEY_RIGHT_BRACKET '+' XK_plus +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '' XK_Odiaeresis +BX_KEY_SEMICOLON '' XK_odiaeresis +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_SHIFT_R none XK_Shift_R +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '' XK_Adiaeresis +BX_KEY_SINGLE_QUOTE '' XK_adiaeresis +BX_KEY_SLASH none XK_dead_belowdot +BX_KEY_SLASH '-' XK_minus +BX_KEY_SLASH+BX_KEY_SHIFT_L '_' XK_underscore +BX_KEY_SPACE space XK_space +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_TAB tab XK_Tab +BX_KEY_UP none XK_Up +BX_KEY_WIN_L none XK_Super_L +BX_KEY_WIN_R none XK_Super_R diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-es.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-es.map new file mode 100644 index 0000000..3856044 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-es.map @@ -0,0 +1,217 @@ +# Bochs Keymap file +# $Id: x11-pc-es.map,v 1.4 2002/09/25 08:00:24 bdenney Exp $ +# Target: PC(x86) keyboard, ES keymap +# Author: Vicente Hernando Ara +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. +# +BX_KEY_0 none XK_0 +BX_KEY_0 none XK_equal +BX_KEY_1 none XK_1 +BX_KEY_1 none XK_bar +BX_KEY_1 none XK_exclam +BX_KEY_2 none XK_2 +BX_KEY_2 none XK_at +BX_KEY_2 none XK_quotedbl +BX_KEY_3 none XK_3 +BX_KEY_3 none XK_numbersign +BX_KEY_3 none XK_periodcentered +BX_KEY_4 none XK_4 +BX_KEY_4 none XK_dollar +BX_KEY_5 none XK_5 +BX_KEY_5 none XK_percent +BX_KEY_6 none XK_6 +BX_KEY_6 none XK_ampersand +BX_KEY_7 none XK_7 +BX_KEY_7 none XK_slash +BX_KEY_8 none XK_8 +BX_KEY_8 none XK_parenleft +BX_KEY_9 none XK_9 +BX_KEY_9 none XK_parenright +BX_KEY_A none XK_A +BX_KEY_A none XK_a +BX_KEY_B none XK_B +BX_KEY_B none XK_b +BX_KEY_C none XK_C +BX_KEY_C none XK_c +BX_KEY_D none XK_D +BX_KEY_D none XK_d +BX_KEY_E none XK_E +BX_KEY_E none XK_EuroSign +BX_KEY_E none XK_e +BX_KEY_F none XK_F +BX_KEY_F none XK_f +BX_KEY_G none XK_G +BX_KEY_G none XK_g +BX_KEY_H none XK_H +BX_KEY_H none XK_h +BX_KEY_I none XK_I +BX_KEY_I none XK_i +BX_KEY_J none XK_J +BX_KEY_J none XK_j +BX_KEY_K none XK_K +BX_KEY_K none XK_k +BX_KEY_L none XK_L +BX_KEY_L none XK_l +BX_KEY_M none XK_M +BX_KEY_M none XK_m +BX_KEY_N none XK_N +BX_KEY_N none XK_n +BX_KEY_O none XK_O +BX_KEY_O none XK_o +BX_KEY_P none XK_P +BX_KEY_P none XK_p +BX_KEY_Q none XK_Q +BX_KEY_Q none XK_q +BX_KEY_R none XK_R +BX_KEY_R none XK_r +BX_KEY_S none XK_S +BX_KEY_S none XK_s +BX_KEY_T none XK_T +BX_KEY_T none XK_t +BX_KEY_U none XK_U +BX_KEY_U none XK_u +BX_KEY_V none XK_V +BX_KEY_V none XK_v +BX_KEY_W none XK_W +BX_KEY_W none XK_w +BX_KEY_X none XK_X +BX_KEY_X none XK_x +BX_KEY_Y none XK_Y +BX_KEY_Y none XK_y +BX_KEY_Z none XK_Z +BX_KEY_Z none XK_z +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_ALT_R none XK_Alt_R +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_BACKSLASH none XK_Ccedilla +BX_KEY_BACKSLASH none XK_ccedilla +BX_KEY_BACKSPACE none XK_BackSpace +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_COMMA none XK_comma +BX_KEY_COMMA none XK_semicolon +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_CTRL_R none XK_Control_R +BX_KEY_DELETE none XK_Delete +BX_KEY_DOWN none XK_Down +BX_KEY_END none XK_End +BX_KEY_ENTER none XK_Return +BX_KEY_EQUALS none XK_exclamdown +BX_KEY_EQUALS none XK_questiondown +BX_KEY_ESC none XK_Escape +BX_KEY_GRAVE none XK_asciitilde +BX_KEY_GRAVE none XK_backslash +BX_KEY_GRAVE none XK_grave +BX_KEY_GRAVE none XK_masculine +BX_KEY_GRAVE none XK_ordfeminine +BX_KEY_HOME none XK_Home +BX_KEY_INSERT none XK_Insert +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_LEFT none XK_Left +BX_KEY_LEFT_BACKSLASH none XK_greater +BX_KEY_LEFT_BACKSLASH none XK_less +BX_KEY_LEFT_BRACKET none XK_braceleft +BX_KEY_LEFT_BRACKET none XK_bracketleft +BX_KEY_LEFT_BRACKET none XK_dead_circumflex +BX_KEY_LEFT_BRACKET none XK_dead_grave +BX_KEY_MENU none XK_Menu +BX_KEY_MINUS none XK_apostrophe +BX_KEY_MINUS none XK_question +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_PAGE_DOWN none XK_Page_Down +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause +BX_KEY_PERIOD none XK_colon +BX_KEY_PERIOD none XK_period +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_RIGHT none XK_Right +BX_KEY_RIGHT_BRACKET none XK_asterisk +BX_KEY_RIGHT_BRACKET none XK_braceright +BX_KEY_RIGHT_BRACKET none XK_bracketright +BX_KEY_RIGHT_BRACKET none XK_plus +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_SEMICOLON none XK_Ntilde +BX_KEY_SEMICOLON none XK_ntilde +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_SHIFT_R none XK_Shift_R +BX_KEY_SINGLE_QUOTE none XK_dead_acute +BX_KEY_SINGLE_QUOTE none XK_dead_diaeresis +BX_KEY_SLASH none XK_minus +BX_KEY_SLASH none XK_underscore +BX_KEY_SPACE none XK_space +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_TAB none XK_Tab +BX_KEY_UP none XK_Up +BX_KEY_WIN_L none XK_Super_L +BX_KEY_WIN_R none XK_Super_R diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-fr.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-fr.map new file mode 100644 index 0000000..869b328 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-fr.map @@ -0,0 +1,218 @@ +# Bochs Keymap file +# $Id: x11-pc-fr.map,v 1.5 2002/09/25 08:00:24 bdenney Exp $ +# Target: PC(x86) keyboard, FR keymap +# Author: Christophe Bothamy, Bryce Denney +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. + +BX_KEY_0+BX_KEY_SHIFT_L '0' XK_0 +BX_KEY_0 '' XK_agrave +BX_KEY_0+BX_KEY_ALT_R '@' XK_at +BX_KEY_1+BX_KEY_SHIFT_L '1' XK_1 +BX_KEY_1 '&' XK_ampersand +BX_KEY_2+BX_KEY_SHIFT_L '2' XK_2 +BX_KEY_2+BX_KEY_ALT_R '~' XK_asciitilde +BX_KEY_2 '' XK_eacute +BX_KEY_3+BX_KEY_SHIFT_L '3' XK_3 +BX_KEY_3+BX_KEY_ALT_R '#' XK_numbersign +BX_KEY_3 '"' XK_quotedbl +BX_KEY_4+BX_KEY_SHIFT_L '4' XK_4 +BX_KEY_4 apostrophe XK_apostrophe +BX_KEY_4+BX_KEY_ALT_R '{' XK_braceleft +BX_KEY_5+BX_KEY_SHIFT_L '5' XK_5 +BX_KEY_5+BX_KEY_ALT_R '[' XK_bracketleft +BX_KEY_5 '(' XK_parenleft +BX_KEY_6+BX_KEY_SHIFT_L '6' XK_6 +BX_KEY_6+BX_KEY_ALT_R '|' XK_bar +BX_KEY_6 '-' XK_minus +BX_KEY_7+BX_KEY_SHIFT_L '7' XK_7 +BX_KEY_7 '' XK_egrave +BX_KEY_7+BX_KEY_ALT_R '`' XK_grave +BX_KEY_8+BX_KEY_SHIFT_L '8' XK_8 +BX_KEY_8+BX_KEY_ALT_R backslash XK_backslash +BX_KEY_8 '_' XK_underscore +BX_KEY_9+BX_KEY_SHIFT_L '9' XK_9 +BX_KEY_9+BX_KEY_ALT_R '^' XK_asciicircum +BX_KEY_9 '' XK_ccedilla +BX_KEY_A+BX_KEY_SHIFT_L 'Q' XK_Q +BX_KEY_A 'q' XK_q +BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B +BX_KEY_B 'b' XK_b +BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C +BX_KEY_C 'c' XK_c +BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D +BX_KEY_D 'd' XK_d +BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E +BX_KEY_E 'e' XK_e +BX_KEY_E+BX_KEY_ALT_R none XK_EuroSign +BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F +BX_KEY_F 'f' XK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G +BX_KEY_G 'g' XK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H +BX_KEY_H 'h' XK_h +BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I +BX_KEY_I 'i' XK_i +BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J +BX_KEY_J 'j' XK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K +BX_KEY_K 'k' XK_k +BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L +BX_KEY_L 'l' XK_l +BX_KEY_M+BX_KEY_SHIFT_L '?' XK_question +BX_KEY_M ',' XK_comma +BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N +BX_KEY_N 'n' XK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O +BX_KEY_O 'o' XK_o +BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P +BX_KEY_P 'p' XK_p +BX_KEY_Q+BX_KEY_SHIFT_L 'A' XK_A +BX_KEY_Q 'a' XK_a +BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R +BX_KEY_R 'r' XK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S +BX_KEY_S 's' XK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T +BX_KEY_T 't' XK_t +BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U +BX_KEY_U 'u' XK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V +BX_KEY_V 'v' XK_v +BX_KEY_W+BX_KEY_SHIFT_L 'Z' XK_Z +BX_KEY_W 'z' XK_z +BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X +BX_KEY_X 'x' XK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y +BX_KEY_Y 'y' XK_y +BX_KEY_Z+BX_KEY_SHIFT_L 'W' XK_W +BX_KEY_Z 'w' XK_w +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_ALT_R none XK_Alt_R +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_BACKSLASH '*' XK_asterisk +BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '' XK_mu +BX_KEY_BACKSPACE none XK_BackSpace +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_COMMA+BX_KEY_SHIFT_L '.' XK_period +BX_KEY_COMMA ';' XK_semicolon +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_CTRL_R none XK_Control_R +BX_KEY_DELETE none XK_Delete +BX_KEY_DOWN none XK_Down +BX_KEY_END none XK_End +BX_KEY_ENTER return XK_Return +BX_KEY_EQUALS+BX_KEY_ALT_R '}' XK_braceright +BX_KEY_EQUALS '=' XK_equal +BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' XK_plus +BX_KEY_ESC none XK_Escape +BX_KEY_GRAVE '' XK_twosuperior +BX_KEY_HOME none XK_Home +BX_KEY_INSERT none XK_Insert +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_LEFT none XK_Left +BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater +BX_KEY_LEFT_BACKSLASH '<' XK_less +BX_KEY_LEFT_BRACKET '^' XK_dead_circumflex +BX_KEY_LEFT_BRACKET none XK_dead_diaeresis +BX_KEY_MENU none XK_Menu +BX_KEY_MINUS+BX_KEY_ALT_R ']' XK_bracketright +BX_KEY_MINUS+BX_KEY_SHIFT_L '' XK_degree +BX_KEY_MINUS ')' XK_parenright +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_PAGE_DOWN none XK_Page_Down +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause +BX_KEY_PERIOD ':' XK_colon +BX_KEY_PERIOD+BX_KEY_SHIFT_L '/' XK_slash +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_RIGHT none XK_Right +BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R '' XK_currency +BX_KEY_RIGHT_BRACKET '$' XK_dollar +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '' XK_sterling +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L 'M' XK_M +BX_KEY_SEMICOLON 'm' XK_m +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_SHIFT_R none XK_Shift_R +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '%' XK_percent +BX_KEY_SINGLE_QUOTE '' XK_ugrave +BX_KEY_SLASH '!' XK_exclam +BX_KEY_SLASH+BX_KEY_SHIFT_L '' XK_section +BX_KEY_SPACE space XK_space +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_TAB tab XK_Tab +BX_KEY_UP none XK_Up +BX_KEY_WIN_L none XK_Super_L +BX_KEY_WIN_R none XK_Super_R diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-it.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-it.map new file mode 100644 index 0000000..fac365e --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-it.map @@ -0,0 +1,207 @@ +# Bochs Keymap file +# $Id: x11-pc-it.map,v 1.2 2002/09/25 08:00:25 bdenney Exp $ +# Target: PC(x86) keyboard, IT keymap +# Author: Emanuele Goldoni +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. +# + +BX_KEY_0 '0' XK_0 +BX_KEY_0+BX_KEY_SHIFT_L '=' XK_equal +BX_KEY_1 '1' XK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam +BX_KEY_2 '2' XK_2 +BX_KEY_2+BX_KEY_SHIFT_L '"' XK_quotedbl +BX_KEY_3 '3' XK_3 +BX_KEY_3+BX_KEY_SHIFT_L '' XK_sterling +BX_KEY_4 '4' XK_4 +BX_KEY_4+BX_KEY_SHIFT_L '$' XK_dollar +BX_KEY_5 '5' XK_5 +BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent +BX_KEY_6 '6' XK_6 +BX_KEY_6+BX_KEY_SHIFT_L '&' XK_ampersand +BX_KEY_7 '7' XK_7 +BX_KEY_7+BX_KEY_SHIFT_L '/' XK_slash +BX_KEY_8 '8' XK_8 +BX_KEY_8+BX_KEY_SHIFT_L '(' XK_parenleft +BX_KEY_9 '9' XK_9 +BX_KEY_9+BX_KEY_SHIFT_L ')' XK_parenright +BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A +BX_KEY_A 'a' XK_a +BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B +BX_KEY_B 'b' XK_b +BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C +BX_KEY_C 'c' XK_c +BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D +BX_KEY_D 'd' XK_d +BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E +BX_KEY_E 'e' XK_e +BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F +BX_KEY_F 'f' XK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G +BX_KEY_G 'g' XK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H +BX_KEY_H 'h' XK_h +BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I +BX_KEY_I 'i' XK_i +BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J +BX_KEY_J 'j' XK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K +BX_KEY_K 'k' XK_k +BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L +BX_KEY_L 'l' XK_l +BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M +BX_KEY_M 'm' XK_m +BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N +BX_KEY_N 'n' XK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O +BX_KEY_O 'o' XK_o +BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P +BX_KEY_P 'p' XK_p +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q +BX_KEY_Q 'q' XK_q +BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R +BX_KEY_R 'r' XK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S +BX_KEY_S 's' XK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T +BX_KEY_T 't' XK_t +BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U +BX_KEY_U 'u' XK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V +BX_KEY_V 'v' XK_v +BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W +BX_KEY_W 'w' XK_w +BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X +BX_KEY_X 'x' XK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y +BX_KEY_Y 'y' XK_y +BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z +BX_KEY_Z 'z' XK_z +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_ALT_R none XK_Alt_R +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_BACKSLASH '' XK_ugrave +BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '' XK_section +BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater +BX_KEY_LEFT_BACKSLASH '<' XK_less +BX_KEY_BACKSPACE none XK_BackSpace +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_COMMA ',' XK_comma +BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_CTRL_R none XK_Control_R +BX_KEY_DELETE none XK_Delete +BX_KEY_DOWN none XK_Down +BX_KEY_END none XK_End +BX_KEY_ENTER return XK_Return +BX_KEY_EQUALS '' XK_igrave +BX_KEY_EQUALS+BX_KEY_SHIFT_L '^' XK_asciicircum +BX_KEY_ESC none XK_Escape +BX_KEY_GRAVE+BX_KEY_SHIFT_L '|' XK_bar +BX_KEY_GRAVE backslash XK_backslash +BX_KEY_HOME none XK_Home +BX_KEY_INSERT none XK_Insert +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_LEFT none XK_Left +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '' XK_eacute +BX_KEY_LEFT_BRACKET '' XK_egrave +BX_KEY_MENU none XK_Menu +BX_KEY_MINUS apostrophe XK_apostrophe +BX_KEY_MINUS+BX_KEY_SHIFT_L '?' XK_question +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_PAGE_DOWN none XK_Page_Down +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause +BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' XK_colon +BX_KEY_PERIOD '.' XK_period +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_RIGHT none XK_Right +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '*' XK_asterisk +BX_KEY_RIGHT_BRACKET '+' XK_plus +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '' XK_ccedilla +BX_KEY_SEMICOLON '' XK_ograve +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_SHIFT_R none XK_Shift_R +BX_KEY_SINGLE_QUOTE '' XK_agrave +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '' XK_degree +BX_KEY_SLASH+BX_KEY_SHIFT_L '_' XK_underscore +BX_KEY_SLASH '-' XK_minus +BX_KEY_SPACE space XK_space +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_TAB tab XK_Tab +BX_KEY_UP none XK_Up +BX_KEY_WIN_L none XK_Super_L +BX_KEY_WIN_R none XK_Super_R diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-ru.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-ru.map new file mode 100644 index 0000000..1b26156 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-ru.map @@ -0,0 +1,211 @@ +# Bochs Keymap file +# $Id: x11-pc-ru.map,v 1.1 2004/10/17 17:16:43 vruppert Exp $ +# Target: PC(x86) keyboard, RU keymap +# Author: Dmitry Soshnikov +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. +# +# Note: this is charset-1251 layout map (using in Windows and some newest +# implementations of Linux), which works properly. Users of KOI8-R should +# slightly modify the map to achieve proper matching (actually didn't tested. +# - D.S.) It concerns of "," and "." symbols, which are placed on the second +# row of the keyboard (instead of placing it on "?/" button in charset-1251), +# and some other (unimportant) symbols. Main symbolic keyboard should work. + +BX_KEY_0 '0' XK_0 +BX_KEY_0+BX_KEY_SHIFT_L ')' XK_parenright +BX_KEY_1 '1' XK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam +BX_KEY_2 '2' XK_2 +BX_KEY_2+BX_KEY_SHIFT_L '"' XK_quotedbl +BX_KEY_3 '3' XK_3 +BX_KEY_3+BX_KEY_SHIFT_L '?' XK_numerosign +BX_KEY_4 '4' XK_4 +BX_KEY_4+BX_KEY_SHIFT_L ';' XK_semicolon +BX_KEY_5 '5' XK_5 +BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent +BX_KEY_6 '6' XK_6 +BX_KEY_6+BX_KEY_SHIFT_L ':' XK_colon +BX_KEY_7 '7' XK_7 +BX_KEY_7+BX_KEY_SHIFT_L '?' XK_question +BX_KEY_8 '8' XK_8 +BX_KEY_8+BX_KEY_SHIFT_L '*' XK_asterisk +BX_KEY_9 '9' XK_9 +BX_KEY_9+BX_KEY_SHIFT_L '(' XK_parenleft +BX_KEY_A+BX_KEY_SHIFT_L '' XK_Cyrillic_EF +BX_KEY_A '' XK_Cyrillic_ef +BX_KEY_B+BX_KEY_SHIFT_L '' XK_Cyrillic_I +BX_KEY_B '' XK_Cyrillic_i +BX_KEY_C+BX_KEY_SHIFT_L '' XK_Cyrillic_ES +BX_KEY_C '' XK_Cyrillic_es +BX_KEY_D+BX_KEY_SHIFT_L '' XK_Cyrillic_VE +BX_KEY_D '' XK_Cyrillic_ve +BX_KEY_E+BX_KEY_SHIFT_L '' XK_Cyrillic_U +BX_KEY_E '' XK_Cyrillic_u +BX_KEY_F+BX_KEY_SHIFT_L '' XK_Cyrillic_A +BX_KEY_F '' XK_Cyrillic_a +BX_KEY_G+BX_KEY_SHIFT_L '' XK_Cyrillic_PE +BX_KEY_G '' XK_Cyrillic_pe +BX_KEY_H+BX_KEY_SHIFT_L '' XK_Cyrillic_ER +BX_KEY_H '' XK_Cyrillic_er +BX_KEY_I+BX_KEY_SHIFT_L '' XK_Cyrillic_SHA +BX_KEY_I '' XK_Cyrillic_sha +BX_KEY_J+BX_KEY_SHIFT_L '' XK_Cyrillic_O +BX_KEY_J '' XK_Cyrillic_o +BX_KEY_K+BX_KEY_SHIFT_L '' XK_Cyrillic_EL +BX_KEY_K '' XK_Cyrillic_el +BX_KEY_L+BX_KEY_SHIFT_L '' XK_Cyrillic_DE +BX_KEY_L '' XK_Cyrillic_de +BX_KEY_M+BX_KEY_SHIFT_L '' XK_Cyrillic_SOFTSIGN +BX_KEY_M '' XK_Cyrillic_softsign +BX_KEY_N+BX_KEY_SHIFT_L '' XK_Cyrillic_TE +BX_KEY_N '' XK_Cyrillic_te +BX_KEY_O+BX_KEY_SHIFT_L '' XK_Cyrillic_SHCHA +BX_KEY_O '' XK_Cyrillic_shcha +BX_KEY_P+BX_KEY_SHIFT_L '' XK_Cyrillic_ZE +BX_KEY_P '' XK_Cyrillic_ze +BX_KEY_Q+BX_KEY_SHIFT_L '' XK_Cyrillic_SHORTI +BX_KEY_Q '' XK_Cyrillic_shorti +BX_KEY_R+BX_KEY_SHIFT_L '' XK_Cyrillic_KA +BX_KEY_R '' XK_Cyrillic_ka +BX_KEY_S+BX_KEY_SHIFT_L '' XK_Cyrillic_YERU +BX_KEY_S '' XK_Cyrillic_yeru +BX_KEY_T+BX_KEY_SHIFT_L '' XK_Cyrillic_IE +BX_KEY_T '' XK_Cyrillic_ie +BX_KEY_U+BX_KEY_SHIFT_L '' XK_Cyrillic_GHE +BX_KEY_U '' XK_Cyrillic_ghe +BX_KEY_V+BX_KEY_SHIFT_L '' XK_Cyrillic_EM +BX_KEY_V '' XK_Cyrillic_em +BX_KEY_W+BX_KEY_SHIFT_L '' XK_Cyrillic_TSE +BX_KEY_W '' XK_Cyrillic_tse +BX_KEY_X+BX_KEY_SHIFT_L '' XK_Cyrillic_CHE +BX_KEY_X '' XK_Cyrillic_che +BX_KEY_Y+BX_KEY_SHIFT_L '' XK_Cyrillic_EN +BX_KEY_Y '' XK_Cyrillic_en +BX_KEY_Z+BX_KEY_SHIFT_L '' XK_Cyrillic_YA +BX_KEY_Z '' XK_Cyrillic_ya +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_ALT_R none XK_Alt_R +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_BACKSLASH backslash XK_backslash +BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '|' XK_bar +BX_KEY_BACKSPACE none XK_BackSpace +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_COMMA '' XK_Cyrillic_be +BX_KEY_COMMA+BX_KEY_SHIFT_L '' XK_Cyrillic_BE +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_CTRL_R none XK_Control_R +BX_KEY_DELETE none XK_Delete +BX_KEY_DOWN none XK_Down +BX_KEY_END none XK_End +BX_KEY_ENTER return XK_Return +BX_KEY_EQUALS '=' XK_equal +BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' XK_plus +BX_KEY_ESC none XK_Escape +BX_KEY_GRAVE+BX_KEY_SHIFT_L '' XK_Cyrillic_IO +BX_KEY_GRAVE '' XK_Cyrillic_io +BX_KEY_HOME none XK_Home +BX_KEY_INSERT none XK_Insert +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_LEFT none XK_Left +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '' XK_Cyrillic_HA +BX_KEY_LEFT_BRACKET '' XK_Cyrillic_ha +BX_KEY_MENU none XK_Menu +BX_KEY_MINUS '-' XK_minus +BX_KEY_MINUS+BX_KEY_SHIFT_L '_' XK_underscore +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_PAGE_DOWN none XK_Page_Down +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause +BX_KEY_PERIOD+BX_KEY_SHIFT_L '' XK_Cyrillic_YU +BX_KEY_PERIOD '' XK_Cyrillic_yu +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_RIGHT none XK_Right +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '' XK_Cyrillic_HARDSIGN +BX_KEY_RIGHT_BRACKET '' XK_Cyrillic_hardsign +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '' XK_Cyrillic_ZHE +BX_KEY_SEMICOLON '' XK_Cyrillic_zhe +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_SHIFT_R none XK_Shift_R +BX_KEY_SINGLE_QUOTE '' XK_Cyrillic_e +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '' XK_Cyrillic_E +BX_KEY_SLASH+BX_KEY_SHIFT_L ',' XK_comma +BX_KEY_SLASH '.' XK_period +BX_KEY_SPACE space XK_space +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_TAB tab XK_Tab +BX_KEY_UP none XK_Up +BX_KEY_WIN_L none XK_Super_L +BX_KEY_WIN_R none XK_Super_R diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-se.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-se.map new file mode 100644 index 0000000..c564ca8 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-se.map @@ -0,0 +1,278 @@ +# Bochs Keymap file +# $Id: x11-pc-se.map,v 1.2 2002/09/25 08:00:25 bdenney Exp $ +# Target: PC(x86) keyboard, SE keymap +# Author: Magnus 'Moggen' berg +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. +# + +# Upper key groups +BX_KEY_ESC none XK_Escape + +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 + +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 + +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 + +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause + +# Main key group +# Row 1 +BX_KEY_GRAVE '' XK_section +BX_KEY_GRAVE+BX_KEY_SHIFT_L '' XK_onehalf +BX_KEY_GRAVE+BX_KEY_ALT_R '' XK_paragraph +BX_KEY_GRAVE+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_threequarters +BX_KEY_1 '1' XK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam +BX_KEY_1+BX_KEY_ALT_R '' XK_exclamdown +BX_KEY_1+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_onesuperior +BX_KEY_2 '2' XK_2 +BX_KEY_2+BX_KEY_SHIFT_L '"' XK_quotedbl +BX_KEY_2+BX_KEY_ALT_R '@' XK_at +BX_KEY_2+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_twosuperior +BX_KEY_3 '3' XK_3 +BX_KEY_3+BX_KEY_SHIFT_L '#' XK_numbersign +BX_KEY_3+BX_KEY_ALT_R '' XK_sterling +BX_KEY_3+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_threesuperior +BX_KEY_4 '4' XK_4 +BX_KEY_4+BX_KEY_SHIFT_L '' XK_currency +BX_KEY_4+BX_KEY_ALT_R '$' XK_dollar +BX_KEY_4+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_onequarter +BX_KEY_5 '5' XK_5 +BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent +BX_KEY_5+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_cent +BX_KEY_6 '6' XK_6 +BX_KEY_6+BX_KEY_SHIFT_L '&' XK_ampersand +BX_KEY_6+BX_KEY_ALT_R '' XK_yen +BX_KEY_7 '7' XK_7 +BX_KEY_7+BX_KEY_SHIFT_L '/' XK_slash +BX_KEY_7+BX_KEY_ALT_R '{' XK_braceleft +BX_KEY_7+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_division +BX_KEY_8 '8' XK_8 +BX_KEY_8+BX_KEY_SHIFT_L '(' XK_parenleft +BX_KEY_8+BX_KEY_ALT_R '[' XK_bracketleft +BX_KEY_9 '9' XK_9 +BX_KEY_9+BX_KEY_SHIFT_L ')' XK_parenright +BX_KEY_9+BX_KEY_ALT_R ']' XK_bracketright +BX_KEY_0 '0' XK_0 +BX_KEY_0+BX_KEY_SHIFT_L '=' XK_equal +BX_KEY_0+BX_KEY_ALT_R '}' XK_braceright +BX_KEY_0+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_degree +BX_KEY_MINUS '+' XK_plus +BX_KEY_MINUS+BX_KEY_SHIFT_L '?' XK_question +BX_KEY_MINUS+BX_KEY_ALT_L backslash XK_backslash +BX_KEY_MINUS+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_questiondown +BX_KEY_EQUALS none XK_dead_acute +BX_KEY_EQUALS+BX_KEY_SHIFT_L none XK_dead_grave +BX_KEY_EQUALS+BX_KEY_ALT_L '' XK_plusminus +BX_KEY_EQUALS+BX_KEY_ALT_L+BX_KEY_ALT_R '' XK_notsign +BX_KEY_BACKSPACE none XK_BackSpace + +# Row 2 +BX_KEY_TAB tab XK_Tab +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_Q 'q' XK_q +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q +BX_KEY_W 'w' XK_w +BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W +BX_KEY_E 'e' XK_e +BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E +BX_KEY_E+BX_KEY_SHIFT_L+BX_KEY_ALT_R none XK_EuroSign +BX_KEY_R 'r' XK_r +BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R +BX_KEY_R+BX_KEY_ALT_R '' XK_registered +BX_KEY_T 't' XK_t +BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T +BX_KEY_T+BX_KEY_ALT_R '' XK_thorn +BX_KEY_T+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_THORN +BX_KEY_Y 'y' XK_y +BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y +BX_KEY_U 'u' XK_u +BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U +BX_KEY_I 'i' XK_i +BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I +BX_KEY_O 'o' XK_o +BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O +BX_KEY_P 'p' XK_p +BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P +BX_KEY_LEFT_BRACKET '' XK_aring +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '' XK_Aring +BX_KEY_RIGHT_BRACKET none XK_dead_diaeresis +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L none XK_dead_circumflex +BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R none XK_dead_tilde +BX_KEY_ENTER return XK_Return + +# Row 3 +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_A 'a' XK_a +BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A +BX_KEY_A+BX_KEY_ALT_R '' XK_ordfeminine +BX_KEY_A+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_masculine +BX_KEY_S 's' XK_s +BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S +BX_KEY_S+BX_KEY_ALT_R '' XK_ssharp +BX_KEY_D 'd' XK_d +BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D +BX_KEY_D+BX_KEY_ALT_R '' XK_eth +BX_KEY_D+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_ETH +BX_KEY_F 'f' XK_f +BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F +BX_KEY_G 'g' XK_g +BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G +BX_KEY_H 'h' XK_h +BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H +BX_KEY_J 'j' XK_j +BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J +BX_KEY_K 'k' XK_k +BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K +BX_KEY_L 'l' XK_l +BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L +BX_KEY_SEMICOLON '' XK_odiaeresis +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '' XK_Odiaeresis +BX_KEY_SEMICOLON+BX_KEY_ALT_R '' XK_oslash +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_Ooblique +BX_KEY_SINGLE_QUOTE '' XK_adiaeresis +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '' XK_Adiaeresis +BX_KEY_SINGLE_QUOTE+BX_KEY_ALT_R '' XK_ae +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_AE +BX_KEY_BACKSLASH apostrophe XK_apostrophe +BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '*' XK_asterisk +BX_KEY_BACKSLASH+BX_KEY_ALT_R '' XK_acute +BX_KEY_BACKSLASH+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_multiply + +# Row 4 +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_LEFT_BACKSLASH '<' XK_less +BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater +BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R '|' XK_bar +BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L+BX_KEY_ALT_R '' XK_brokenbar +BX_KEY_Z 'z' XK_z +BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z +BX_KEY_Z+BX_KEY_ALT_R '' XK_guillemotleft +BX_KEY_X 'x' XK_x +BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X +BX_KEY_X+BX_KEY_ALT_R '' XK_guillemotright +BX_KEY_C 'c' XK_c +BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C +BX_KEY_C+BX_KEY_ALT_R '' XK_copyright +BX_KEY_V 'v' XK_v +BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V +BX_KEY_V+BX_KEY_SHIFT_L+BX_KEY_ALT_R '`' XK_grave +BX_KEY_B 'b' XK_b +BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B +BX_KEY_N 'n' XK_n +BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N +BX_KEY_M 'm' XK_m +BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M +BX_KEY_M+BX_KEY_ALT_R '' XK_mu +BX_KEY_COMMA ',' XK_comma +BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon +BX_KEY_PERIOD '.' XK_period +BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' XK_colon +BX_KEY_PERIOD+BX_KEY_ALT_R '' XK_periodcentered +BX_KEY_SLASH '-' XK_minus +BX_KEY_SLASH+BX_KEY_SHIFT '_' XK_underscore +BX_KEY_SLASH+BX_KEY_ALT_R '' XK_hyphen +BX_KEY_SLASH+BX_KEY_SHIFT+BX_KEY_ALT_R '' XK_macron +BX_KEY_SHIFT_R none XK_Shift_R + +# Row 5 +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_WIN_L none XK_Super_L +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_SPACE space XK_space +BX_KEY_SPACE+BX_KEY_ALT_R none XK_nobreakspace +BX_KEY_ALT_R none XK_Alt_R +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_WIN_R none XK_Super_R +BX_KEY_MENU none XK_Menu +BX_KEY_CTRL_R none XK_Control_R + +# Ins/Del/Home/End/PgUp/PgDn +BX_KEY_INSERT none XK_Insert +BX_KEY_DELETE none XK_Delete +BX_KEY_HOME none XK_Home +BX_KEY_END none XK_End +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAGE_DOWN none XK_Page_Down + +# Arrow keys +BX_KEY_LEFT none XK_Left +BX_KEY_RIGHT none XK_Right +BX_KEY_UP none XK_Up +BX_KEY_DOWN none XK_Down + +# Numerical keypad +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-si.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-si.map new file mode 100644 index 0000000..a734f98 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-si.map @@ -0,0 +1,206 @@ +# Bochs Keymap file +# $Id: x11-pc-si.map,v 1.1 2005/12/26 21:20:42 vruppert Exp $ +# Target: PC(x86) keyboard, SI keymap +# Author: Mitja Ursic +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. +# + +BX_KEY_0 '0' XK_0 +BX_KEY_0+BX_KEY_SHIFT_L ')' XK_parenright +BX_KEY_1 '1' XK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam +BX_KEY_2 '2' XK_2 +BX_KEY_2+BX_KEY_SHIFT_L '@' XK_at +BX_KEY_3 '3' XK_3 +BX_KEY_3+BX_KEY_SHIFT_L '#' XK_numbersign +BX_KEY_4 '4' XK_4 +BX_KEY_4+BX_KEY_SHIFT_L '$' XK_dollar +BX_KEY_5 '5' XK_5 +BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent +BX_KEY_6 '6' XK_6 +BX_KEY_7+BX_KEY_SHIFT_L '&' XK_ampersand +BX_KEY_7 '7' XK_7 +BX_KEY_SLASH none XK_cacute +BX_KEY_8 '8' XK_8 +BX_KEY_KP_MULTIPLY '*' XK_asterisk +BX_KEY_9 '9' XK_9 +BX_KEY_9+BX_KEY_SHIFT_L '(' XK_parenleft +BX_KEY_A+BX_KEY_SHIFT_L 'a' XK_A +BX_KEY_A 'a' XK_a +BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B +BX_KEY_B 'b' XK_b +BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C +BX_KEY_C 'c' XK_c +BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D +BX_KEY_D 'd' XK_d +BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E +BX_KEY_E 'e' XK_e +BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F +BX_KEY_F 'f' XK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G +BX_KEY_G 'g' XK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H +BX_KEY_H 'h' XK_h +BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I +BX_KEY_I 'i' XK_i +BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J +BX_KEY_J 'j' XK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K +BX_KEY_K 'k' XK_k +BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L +BX_KEY_L 'l' XK_l +BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M +BX_KEY_M 'm' XK_m +BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N +BX_KEY_N 'n' XK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O +BX_KEY_O 'o' XK_o +BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P +BX_KEY_P 'p' XK_p +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q +BX_KEY_Q 'q' XK_q +BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R +BX_KEY_R 'r' XK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S +BX_KEY_S 's' XK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T +BX_KEY_T 't' XK_t +BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U +BX_KEY_U 'u' XK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V +BX_KEY_V 'v' XK_v +BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W +BX_KEY_W 'w' XK_w +BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X +BX_KEY_X 'x' XK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y +BX_KEY_Y 'y' XK_y +BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z +BX_KEY_Z 'z' XK_z +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_ALT_R none XK_Alt_R +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_BACKSLASH backslash XK_backslash +BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '|' XK_bar +BX_KEY_BACKSPACE none XK_BackSpace +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_COMMA ',' XK_comma +BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_CTRL_R none XK_Control_R +BX_KEY_DELETE none XK_Delete +BX_KEY_DOWN none XK_Down +BX_KEY_END none XK_End +BX_KEY_ENTER return XK_Return +BX_KEY_EQUALS '=' XK_zcaron +BX_KEY_KP_ADD '+' XK_plus +BX_KEY_ESC none XK_Escape +BX_KEY_GRAVE+BX_KEY_SHIFT_L '~' XK_asciitilde +BX_KEY_GRAVE '`' XK_grave +BX_KEY_HOME none XK_Home +BX_KEY_INSERT none XK_Insert +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_LEFT none XK_Left +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '{' XK_Scaron +BX_KEY_LEFT_BRACKET '[' XK_bracketleft +BX_KEY_MENU none XK_Menu +BX_KEY_MINUS '-' XK_minus +BX_KEY_MINUS+BX_KEY_SHIFT_L '_' XK_underscore +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_PAGE_DOWN none XK_Page_Down +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause +BX_KEY_COMMA ',' XK_comma +BX_KEY_PERIOD '.' XK_period +BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' XK_colon #more > +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_RIGHT none XK_Right +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '}' XK_Dstroke +BX_KEY_RIGHT_BRACKET ']' XK_bracketright +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon #less < +BX_KEY_SEMICOLON ';' XK_ccaron +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L ':' XK_Ccaron +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_SHIFT_R none XK_Shift_R +BX_KEY_SINGLE_QUOTE apostrophe XK_apostrophe +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '"' XK_quotedbl +BX_KEY_SLASH+BX_KEY_SHIFT_L '?' XK_question +BX_KEY_SPACE space XK_space +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_TAB tab XK_Tab +BX_KEY_UP none XK_Up +BX_KEY_WIN_L none XK_Super_L +BX_KEY_WIN_R none XK_Super_R diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-uk.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-uk.map new file mode 100644 index 0000000..05abbe4 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-uk.map @@ -0,0 +1,209 @@ +# Bochs Keymap file +# $Id: x11-pc-uk.map,v 1.1 2002/12/11 21:35:50 bdenney Exp $ +# Target: PC(x86) keyboard, UK keymap +# Author: Denis Lenihan +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. +# + +BX_KEY_0 '0' XK_0 +BX_KEY_0+BX_KEY_SHIFT_L ')' XK_parenright +BX_KEY_1 '1' XK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam +BX_KEY_2 '2' XK_2 +BX_KEY_2+BX_KEY_SHIFT_L '"' XK_quotedbl +BX_KEY_3 '3' XK_3 +BX_KEY_3+BX_KEY_SHIFT_L '' XK_sterling +BX_KEY_3+BX_KEY_ALT_R '|' XK_EuroSign +BX_KEY_4 '4' XK_4 +BX_KEY_4+BX_KEY_SHIFT_L '$' XK_dollar +BX_KEY_5 '5' XK_5 +BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent +BX_KEY_6 '6' XK_6 +BX_KEY_6+BX_KEY_SHIFT_L '^' XK_asciicircum +BX_KEY_7 '7' XK_7 +BX_KEY_7+BX_KEY_SHIFT_L '&' XK_ampersand +BX_KEY_8 '8' XK_8 +BX_KEY_8+BX_KEY_SHIFT_L '*' XK_asterisk +BX_KEY_9 '9' XK_9 +BX_KEY_9+BX_KEY_SHIFT_L '(' XK_parenleft +BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A +BX_KEY_A 'a' XK_a +BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B +BX_KEY_B 'b' XK_b +BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C +BX_KEY_C 'c' XK_c +BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D +BX_KEY_D 'd' XK_d +BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E +BX_KEY_E 'e' XK_e +BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F +BX_KEY_F 'f' XK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G +BX_KEY_G 'g' XK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H +BX_KEY_H 'h' XK_h +BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I +BX_KEY_I 'i' XK_i +BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J +BX_KEY_J 'j' XK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K +BX_KEY_K 'k' XK_k +BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L +BX_KEY_L 'l' XK_l +BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M +BX_KEY_M 'm' XK_m +BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N +BX_KEY_N 'n' XK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O +BX_KEY_O 'o' XK_o +BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P +BX_KEY_P 'p' XK_p +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q +BX_KEY_Q 'q' XK_q +BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R +BX_KEY_R 'r' XK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S +BX_KEY_S 's' XK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T +BX_KEY_T 't' XK_t +BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U +BX_KEY_U 'u' XK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V +BX_KEY_V 'v' XK_v +BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W +BX_KEY_W 'w' XK_w +BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X +BX_KEY_X 'x' XK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y +BX_KEY_Y 'y' XK_y +BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z +BX_KEY_Z 'z' XK_z +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_ALT_R none XK_Alt_R +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_LEFT_BACKSLASH '\' XK_backslash +BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '|' XK_bar +BX_KEY_BACKSLASH '~' XK_asciitilde +BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '#' XK_numbersign +BX_KEY_BACKSPACE none XK_BackSpace +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_COMMA ',' XK_comma +BX_KEY_COMMA+BX_KEY_SHIFT_L '<' XK_less +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_CTRL_R none XK_Control_R +BX_KEY_DELETE none XK_Delete +BX_KEY_DOWN none XK_Down +BX_KEY_END none XK_End +BX_KEY_ENTER return XK_Return +BX_KEY_EQUALS '=' XK_equal +BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' XK_plus +BX_KEY_ESC none XK_Escape +BX_KEY_GRAVE+BX_KEY_SHIFT_L '' XK_notsign +BX_KEY_GRAVE '`' XK_grave +BX_KEY_GRAVE+BX_KEY_ALT_R '|' XK_bar +BX_KEY_HOME none XK_Home +BX_KEY_INSERT none XK_Insert +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_LEFT none XK_Left +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '{' XK_braceleft +BX_KEY_LEFT_BRACKET '[' XK_bracketleft +BX_KEY_MENU none XK_Menu +BX_KEY_MINUS '-' XK_minus +BX_KEY_MINUS+BX_KEY_SHIFT_L '_' XK_underscore +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_PAGE_DOWN none XK_Page_Down +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause +BX_KEY_PERIOD+BX_KEY_SHIFT_L '>' XK_greater +BX_KEY_PERIOD '.' XK_period +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_RIGHT none XK_Right +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '}' XK_braceright +BX_KEY_RIGHT_BRACKET ']' XK_bracketright +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L ':' XK_colon +BX_KEY_SEMICOLON ';' XK_semicolon +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_SHIFT_R none XK_Shift_R +BX_KEY_SINGLE_QUOTE apostrophe XK_apostrophe +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '@' XK_at +BX_KEY_SLASH+BX_KEY_SHIFT_L '?' XK_question +BX_KEY_SLASH '/' XK_slash +BX_KEY_SPACE space XK_space +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_TAB tab XK_Tab +BX_KEY_UP none XK_Up +BX_KEY_WIN_L none XK_Super_L +BX_KEY_WIN_R none XK_Super_R diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-us.map b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-us.map new file mode 100644 index 0000000..8cda7a8 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/keymaps/x11-pc-us.map @@ -0,0 +1,205 @@ +# Bochs Keymap file +# $Id: x11-pc-us.map,v 1.3 2002/09/25 08:00:25 bdenney Exp $ +# Target: PC(x86) keyboard, US keymap +# Author: Christophe Bothamy, Bryce Denney +# +# The keymap file describes the layout of a keyboard, and how it translates +# into Bochs key codes. +# +# Format: +# BX_Keysym ASCII_equivalent Xwin_Keysym +# +# Or, for keys that require modifiers: +# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym +# +# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in +# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it +# could be any key. Presently a maximum of one modifier is supported, but this +# could be changed in keymap.h (structure def has only one slot for modifier), +# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1 +# modifier). +# +# The ASCII_equivalent must be either apostrophe + one character + apostrophe, +# or one of these keywords: space, return, tab, backslash, apostrophe, none. +# This format is designed to look like a char constant in C, but it's a very +# simple parser. There's no concept of backslash being an escape char. The +# backslash and apostrophe entries are provided for aesthetic purposes only: no +# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are +# ugly. +# +# Xwin_Keysym is the X windows equivalent of the key combination. These +# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h. +# If you're running X windows, Bochs will take each of these Xwin_Keysyms, +# pull off the XK_ in front, and use XStringToKeysym() to change them into +# numerical codes. If this lookup fails, you will get a panic and you need +# to edit the keymap file. +# + +BX_KEY_0 '0' XK_0 +BX_KEY_0+BX_KEY_SHIFT_L ')' XK_parenright +BX_KEY_1 '1' XK_1 +BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam +BX_KEY_2 '2' XK_2 +BX_KEY_2+BX_KEY_SHIFT_L '@' XK_at +BX_KEY_3 '3' XK_3 +BX_KEY_3+BX_KEY_SHIFT_L '#' XK_numbersign +BX_KEY_4 '4' XK_4 +BX_KEY_4+BX_KEY_SHIFT_L '$' XK_dollar +BX_KEY_5 '5' XK_5 +BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent +BX_KEY_6 '6' XK_6 +BX_KEY_6+BX_KEY_SHIFT_L '^' XK_asciicircum +BX_KEY_7 '7' XK_7 +BX_KEY_7+BX_KEY_SHIFT_L '&' XK_ampersand +BX_KEY_8 '8' XK_8 +BX_KEY_8+BX_KEY_SHIFT_L '*' XK_asterisk +BX_KEY_9 '9' XK_9 +BX_KEY_9+BX_KEY_SHIFT_L '(' XK_parenleft +BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A +BX_KEY_A 'a' XK_a +BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B +BX_KEY_B 'b' XK_b +BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C +BX_KEY_C 'c' XK_c +BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D +BX_KEY_D 'd' XK_d +BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E +BX_KEY_E 'e' XK_e +BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F +BX_KEY_F 'f' XK_f +BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G +BX_KEY_G 'g' XK_g +BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H +BX_KEY_H 'h' XK_h +BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I +BX_KEY_I 'i' XK_i +BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J +BX_KEY_J 'j' XK_j +BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K +BX_KEY_K 'k' XK_k +BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L +BX_KEY_L 'l' XK_l +BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M +BX_KEY_M 'm' XK_m +BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N +BX_KEY_N 'n' XK_n +BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O +BX_KEY_O 'o' XK_o +BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P +BX_KEY_P 'p' XK_p +BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q +BX_KEY_Q 'q' XK_q +BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R +BX_KEY_R 'r' XK_r +BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S +BX_KEY_S 's' XK_s +BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T +BX_KEY_T 't' XK_t +BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U +BX_KEY_U 'u' XK_u +BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V +BX_KEY_V 'v' XK_v +BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W +BX_KEY_W 'w' XK_w +BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X +BX_KEY_X 'x' XK_x +BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y +BX_KEY_Y 'y' XK_y +BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z +BX_KEY_Z 'z' XK_z +BX_KEY_F1 none XK_F1 +BX_KEY_F2 none XK_F2 +BX_KEY_F3 none XK_F3 +BX_KEY_F4 none XK_F4 +BX_KEY_F5 none XK_F5 +BX_KEY_F6 none XK_F6 +BX_KEY_F7 none XK_F7 +BX_KEY_F8 none XK_F8 +BX_KEY_F9 none XK_F9 +BX_KEY_F10 none XK_F10 +BX_KEY_F11 none XK_F11 +BX_KEY_F12 none XK_F12 +BX_KEY_ALT_L none XK_Alt_L +BX_KEY_ALT_L none XK_Meta_L +BX_KEY_ALT_R none XK_Alt_R +BX_KEY_ALT_R none XK_Mode_switch +BX_KEY_ALT_R none XK_Multi_key +BX_KEY_BACKSLASH backslash XK_backslash +BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '|' XK_bar +BX_KEY_BACKSPACE none XK_BackSpace +BX_KEY_CAPS_LOCK none XK_Caps_Lock +BX_KEY_COMMA ',' XK_comma +BX_KEY_COMMA+BX_KEY_SHIFT_L '<' XK_less +BX_KEY_CTRL_L none XK_Control_L +BX_KEY_CTRL_R none XK_Control_R +BX_KEY_DELETE none XK_Delete +BX_KEY_DOWN none XK_Down +BX_KEY_END none XK_End +BX_KEY_ENTER return XK_Return +BX_KEY_EQUALS '=' XK_equal +BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' XK_plus +BX_KEY_ESC none XK_Escape +BX_KEY_GRAVE+BX_KEY_SHIFT_L '~' XK_asciitilde +BX_KEY_GRAVE '`' XK_grave +BX_KEY_HOME none XK_Home +BX_KEY_INSERT none XK_Insert +BX_KEY_KP_5 none XK_KP_5 +BX_KEY_KP_5 none XK_KP_Begin +BX_KEY_KP_ADD none XK_KP_Add +BX_KEY_KP_DELETE none XK_KP_Decimal +BX_KEY_KP_DELETE none XK_KP_Delete +BX_KEY_KP_DIVIDE none XK_KP_Divide +BX_KEY_KP_DOWN none XK_KP_2 +BX_KEY_KP_DOWN none XK_KP_Down +BX_KEY_KP_END none XK_KP_1 +BX_KEY_KP_END none XK_KP_End +BX_KEY_KP_ENTER none XK_KP_Enter +BX_KEY_KP_HOME none XK_KP_7 +BX_KEY_KP_HOME none XK_KP_Home +BX_KEY_KP_INSERT none XK_KP_0 +BX_KEY_KP_INSERT none XK_KP_Insert +BX_KEY_KP_LEFT none XK_KP_4 +BX_KEY_KP_LEFT none XK_KP_Left +BX_KEY_KP_MULTIPLY none XK_KP_Multiply +BX_KEY_KP_PAGE_DOWN none XK_KP_3 +BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down +BX_KEY_KP_PAGE_UP none XK_KP_9 +BX_KEY_KP_PAGE_UP none XK_KP_Page_Up +BX_KEY_KP_RIGHT none XK_KP_6 +BX_KEY_KP_RIGHT none XK_KP_Right +BX_KEY_KP_SUBTRACT none XK_KP_Subtract +BX_KEY_KP_UP none XK_KP_8 +BX_KEY_KP_UP none XK_KP_Up +BX_KEY_LEFT none XK_Left +BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '{' XK_braceleft +BX_KEY_LEFT_BRACKET '[' XK_bracketleft +BX_KEY_MENU none XK_Menu +BX_KEY_MINUS '-' XK_minus +BX_KEY_MINUS+BX_KEY_SHIFT_L '_' XK_underscore +BX_KEY_NUM_LOCK none XK_Num_Lock +BX_KEY_PAGE_DOWN none XK_Page_Down +BX_KEY_PAGE_UP none XK_Page_Up +BX_KEY_PAUSE none XK_Break +BX_KEY_PAUSE none XK_Pause +BX_KEY_PERIOD+BX_KEY_SHIFT_L '>' XK_greater +BX_KEY_PERIOD '.' XK_period +BX_KEY_PRINT none XK_Print +BX_KEY_PRINT none XK_Sys_Req +BX_KEY_RIGHT none XK_Right +BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '}' XK_braceright +BX_KEY_RIGHT_BRACKET ']' XK_bracketright +BX_KEY_SCRL_LOCK none XK_Scroll_Lock +BX_KEY_SEMICOLON+BX_KEY_SHIFT_L ':' XK_colon +BX_KEY_SEMICOLON ';' XK_semicolon +BX_KEY_SHIFT_L none XK_Shift_L +BX_KEY_SHIFT_R none XK_Shift_R +BX_KEY_SINGLE_QUOTE apostrophe XK_apostrophe +BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '"' XK_quotedbl +BX_KEY_SLASH+BX_KEY_SHIFT_L '?' XK_question +BX_KEY_SLASH '/' XK_slash +BX_KEY_SPACE space XK_space +BX_KEY_TAB none XK_ISO_Left_Tab +BX_KEY_TAB tab XK_Tab +BX_KEY_UP none XK_Up +BX_KEY_WIN_L none XK_Super_L +BX_KEY_WIN_R none XK_Super_R diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/lgban.ico b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/lgban.ico new file mode 100644 index 0000000..f4bbdd4 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/lgban.ico differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/logo.ico b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/logo.ico new file mode 100644 index 0000000..34e66cd Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/logo.ico differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/niclist.exe b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/niclist.exe new file mode 100644 index 0000000..59e9a6b Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/niclist.exe differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/penguin.ico b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/penguin.ico new file mode 100644 index 0000000..a320260 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/penguin.ico differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/sb16ctrl.exe b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/sb16ctrl.exe new file mode 100644 index 0000000..efef980 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/sb16ctrl.exe differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/sb16ctrl.txt b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/sb16ctrl.txt new file mode 100644 index 0000000..cc3ff0a --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/sb16ctrl.txt @@ -0,0 +1,36 @@ +# +# example for an sb16ctrl file +# +# comments start with hash character '#' (obviously...) +# Numbers can be octal (0...) or hex (0x...) or decimal. +# +# +# first, reset the translation table with command 'r' +r + +# then load a few translations. +# The format is: +# t OldBankMSB OldBankLSB OldProgram NewBankMSB NewBankLSB NewProgram +# +# All values are in the range of 0-127 or 255. +# For old values, 255 means "match any". +# For new values, 255 means "don't change". +# +# When deciding whether a program change is to be remapped, these +# remappings are checked first to last, and the first applicable remap +# is used. + +# This would map all bank changes to bank 0/0 +# t 255 255 255 0 0 255 +# it's commented out, otherwise none of the below changes would +# be checked, as this one matches anything. + +t 255 255 0 0 0 19 # remap piano to church organ +t 255 255 255 0 0 0 # everything remaining -> piano + +# now show the number of translations that have been loaded +i 3 + +# and enable GS/GM mode +m 0xF0,0x41,0x10,0x42,0x12,0x40,0x00,0x7F,0x00,0x41,0xF7 + diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/slirp.conf b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/slirp.conf new file mode 100644 index 0000000..6a90070 --- /dev/null +++ b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/slirp.conf @@ -0,0 +1,38 @@ +# slirp config +# The line above is mandatory + +# Supported options: +# +# RESTRICTED if set to 1, only built-in services are available +# NET base IP address of the virtual network +# MASK netmask of the virtual network +# HOST IP address of the DHCP and TFTP server +# HOSTNAME DHCP client hostname +# DHCPSTART start address of DHCP pool +# DNS IP address of the virtual DNS server +# BOOTFILE boot filename returned by DHCP +# DNSSEARCH comma-separated list of DNS suffixes to search (DHCP extension) +# SMB_EXPORT absolute path to the shared folder (non-Windows SMB support) +# SMB_SRV alternative IP address of the SMB server (default is 10.0.2.4) +# HOSTFWD map guest port to host port for host-to-guest access +# (format: protocol:hostaddr:hostport-guestaddr:guestport) + +# This is the default (classic slirp) setup +# restricted = 0 +# net = 10.0.2.0 +# mask = 255.255.255.0 +# host = 10.0.2.2 +# dhcpstart = 10.0.2.15 +# dns = 10.0.2.3 + +# This is the vnet setup +# restricted = 1 +# net = 192.168.10.0 +# mask = 255.255.255.0 +# host = 192.168.10.1 +# dhcpstart = 192.168.10.2 +# dns = 0.0.0.0 +# bootfile = pxelinux.0 + +# Host forwarding example (access guest SSH server from host port 12345) +# hostfwd = tcp::12345-:22 diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/unbochs.ico b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/unbochs.ico new file mode 100644 index 0000000..4031cde Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/unbochs.ico differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/vgabios-cirrus.bin-1.13.0 b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/vgabios-cirrus.bin-1.13.0 new file mode 100644 index 0000000..c1a7206 Binary files /dev/null and b/一些非必要的资料/linux-0.11-quickstart/Bochs-2.3.6/vgabios-cirrus.bin-1.13.0 differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/Boot.img b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/Boot.img deleted file mode 100644 index 289da87..0000000 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/Boot.img and /dev/null differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/Makefile b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/Makefile deleted file mode 100644 index 8509edf..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/Makefile +++ /dev/null @@ -1,184 +0,0 @@ -# -# if you want the ram-disk device, define this to be the -# size in blocks. -# -RAMDISK = #-DRAMDISK=512 - -#AS86 =as86 -0 -a -#LD86 =ld86 -0 - -INC=boot -AS86 = nasm -DASM = ndisasm - -AS =as -LD =ld -#LDFLAGS = -m elf_i386 -Ttext 0 -e startup_32 -LDFLAGS = -m i386pe -Ttext 0 -e startup_32 -s -M --image-base 0x0000 -CC =gcc -march=i386 $(RAMDISK) -CFLAGS =-Wall -O2 -fomit-frame-pointer -fno-builtin - - - -CPP =cpp -nostdinc -Iinclude - -# -# ROOT_DEV specifies the default root-device when making the image. -# This can be either FLOPPY, /dev/xxxx or empty, in which case the -# default of /dev/hd6 is used by 'build'. -# -ROOT_DEV= #FLOPPY - -BLK_DRV_SRC = kernel/blk_drv/ll_rw_blk.c kernel/blk_drv/floppy.c \ - kernel/blk_drv/hd.c kernel/blk_drv/ramdisk.c - -CHR_DRV_SRC = kernel/chr_drv/tty_io.c kernel/chr_drv/console.c kernel/chr_drv/keyboard.s \ - kernel/chr_drv/serial.c kernel/chr_drv/rs_io.s \ - kernel/chr_drv/tty_ioctl.s - -KERNEL_SRC = kernel/sched.c kernel/system_call.s kernel/traps.s kernel/asm.s kernel/fork.c \ - kernel/panic.c kernel/printk.c kernel/vsprintf.c kernel/sys.c kernel/exit.c \ - kernel/signal.c kernel/mktime.c - -MM_SRC = mm/memory.c mm/page.s - -FS_SRC= fs/open.c fs/read_write.c fs/inode.c fs/file_table.c fs/buffer.c fs/super.c \ - fs/block_dev.c fs/char_dev.c fs/file_dev.c fs/stat.c fs/exec.c fs/pipe.c fs/namei.c \ - fs/bitmap.c fs/fcntl.c fs/ioctl.c fs/truncate.c - -LIB_SRC = lib/ctype.c lib/_exit.c lib/open.c lib/close.c lib/errno.c lib/write.c lib/dup.c lib/setsid.c \ - lib/execve.c lib/wait.c lib/string.c lib/malloc.c - -ARCHIVES=kernel/kernel.o mm/mm.o fs/fs.o -#ARCHIVES=$(KERNEL_OBJS) mm/mm.o fs/fs.o - -DRIVERS =kernel/blk_drv/blk_drv.a kernel/chr_drv/chr_drv.a - -MATH =kernel/math/math.a -LIBS =lib/lib.a - -.c.s: - $(CC) $(CFLAGS) \ - -nostdinc -Iinclude -S -o $*.s $< -.s.o: - $(AS) -o $*.o $< -.c.o: - $(CC) $(CFLAGS) \ - -nostdinc -Iinclude -c -o $*.o $< - -all: Boot.img - -KERNEL_FILE = tools/system.exe - -tools/system.bin : tools/system.exe - tools/Trans.exe tools/System.exe tools/system.bin - -Boot.img: boot/bootsect.bin boot/setup.bin $(KERNEL_FILE) tools/build.exe Makefile -# objcopy -O binary -R .note -R .comment tools/system tools/kernel - tools\build.exe boot/bootsect.bin boot/setup.bin $(KERNEL_FILE) $(ROOT_DEV) -# rm tools/kernel -f -# sync -# del tools\kernel - -disk: Image - dd bs=8192 if=Image of=/dev/fd0 - -tools/build.exe: tools/build.c - $(CC) $(CFLAGS) -o tools/build tools/build.c - -boot/head.o: boot/head.s - gcc -I./include -traditional -c boot/head.s -o boot/head.o -# move head.o boot/ - -tools/system.exe: boot/head.o init/main.o \ - $(ARCHIVES) $(DRIVERS) $(MATH) $(LIBS) - $(LD) $(LDFLAGS) boot/head.o init/main.o \ - $(ARCHIVES) \ - $(DRIVERS) \ - $(MATH) \ - $(LIBS) \ - -o tools/system.exe >system.map -# nm tools/system | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)'| sort > System.map - -kernel/math/math.a:kernel/math/math_emulate.o -# (cd kernel/math ; make) - (cd kernel/math & make) - -kernel/blk_drv/blk_drv.a:$(BLK_DRV_SRC) -# (cd kernel/blk_drv ; make) - (cd kernel/blk_drv & make) - -kernel/chr_drv/chr_drv.a:$(CHR_DRV_SRC) -# (cd kernel/chr_drv ; make) - (cd kernel/chr_drv & make) - -kernel/kernel.o:$(KERNEL_SRC) -# (cd kernel; make) - (cd kernel & make) - -mm/mm.o:$(MM_SRC) -# (cd mm; make) - (cd mm & make) - -fs/fs.o:$(FS_SRC) -# (cd fs; make) - (cd fs & make) - -lib/lib.a:$(LIB_SRC) - (cd lib & make) - -boot/setup.bin: boot/setup.asm - $(AS86) -I"$(INC)"\ -o boot/setup.bin boot/setup.asm - $(DASM) -b 16 boot/setup.bin >boot/setup.disasm -# $(LD86) -s -o boot/setup boot/setup.o - -boot/bootsect.bin: boot/bootsect.asm - $(AS86) -I"$(INC)"\ -o boot/bootsect.bin boot/bootsect.asm - $(DASM) -b 16 boot/bootsect.bin >boot/bootsect.disasm -# $(LD86) -s -o boot/bootsect boot/bootsect.o - -tmp.s: boot/bootsect.s tools/system -# (echo -n "SYSSIZE = (";ls -l tools/system | grep system \ -# | cut -c25-31 | tr '\012' ' '; echo "+ 15 ) / 16") > tmp.s - cat boot/bootsect.s >> tmp.s - -clean: -# rm -f Image System.map tmp_make core boot/bootsect boot/setup -# rm -f init/*.o tools/system tools/build boot/*.o -# (cd mm;make clean) -# (cd fs;make clean) -# (cd kernel;make clean) -# (cd lib;make clean) - @del /S /Q *.a *.o system.map tools\system.exe -# del Image System.map tmp_make core boot\bootsect boot\setup -# del init\*.o tools\system tools\build boot\*.o -# (cd mm & make clean) -# (cd fs & make clean) -# (cd kernel & make clean) -# (cd lib &make clean) - - -backup: clean - (cd .. ; tar cf - linux | compress16 - > backup.Z) - sync - -dep: - sed '/\#\#\# Dependencies/q' < Makefile > tmp_make - (for i in init/*.c;do echo -n "init/";$(CPP) -M $$i;done) >> tmp_make -# cp tmp_make Makefile -# (cd fs; make dep) -# (cd kernel; make dep) -# (cd mm; make dep) - - copy tmp_make Makefile - (cd fs & make dep) - (cd kernel & make dep) - (cd mm & make dep) - -### Dependencies: -init/main.o: init/main.c include/unistd.h include/sys/stat.h \ - include/sys/types.h include/sys/times.h include/sys/utsname.h \ - include/utime.h include/time.h include/linux/tty.h include/termios.h \ - include/linux/sched.h include/linux/head.h include/linux/fs.h \ - include/linux/mm.h include/signal.h include/asm/system.h \ - include/asm/io.h include/stddef.h include/stdarg.h include/fcntl.h diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/MinGW32.bat.lnk b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/MinGW32.bat.lnk deleted file mode 100644 index e16f2bc..0000000 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/MinGW32.bat.lnk and /dev/null differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/bochsout.txt b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/bochsout.txt deleted file mode 100644 index b8b60ec..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/bochsout.txt +++ /dev/null @@ -1,92 +0,0 @@ -00000000000i[ ] Bochs x86 Emulator 2.1.1 -00000000000i[ ] February 08, 2004 -00000000000i[ ] System configuration -00000000000i[ ] processors: 1 -00000000000i[ ] A20 line support: yes -00000000000i[ ] APIC support: no -00000000000i[ ] CPU configuration -00000000000i[ ] level: 5 -00000000000i[ ] fpu support: yes -00000000000i[ ] paging support: yes, tlb enabled: yes -00000000000i[ ] mmx support: yes -00000000000i[ ] sse support: no -00000000000i[ ] v8086 mode support: yes -00000000000i[ ] 3dnow! support: no -00000000000i[ ] PAE support: no -00000000000i[ ] PGE support: no -00000000000i[ ] PSE support: no -00000000000i[ ] x86-64 support: no -00000000000i[ ] SEP support: no -00000000000i[ ] Optimization configuration -00000000000i[ ] Guest2HostTLB support: yes -00000000000i[ ] RepeatSpeedups support: yes -00000000000i[ ] Icache support: yes -00000000000i[ ] Host Asm support: yes -00000000000i[MEM0 ] allocated memory at 00CC0020. after alignment, vector=00CC1000 -00000000000i[MEM0 ] 32.00MB -00000000000i[MEM0 ] rom at 0xf0000/65536 ('C:\Program Files\Bochs-2.1.1/BIOS-bochs-latest') -00000000000i[MEM0 ] rom at 0xc0000/32768 ('C:\Program Files\Bochs-2.1.1/VGABIOS-elpin-2.40') -00000000000i[CMOS ] Using local time for initial clock -00000000000i[CMOS ] Setting initial clock to: Sat Sep 01 16:44:40 2012 (time0=1346489080) -00000000000i[DMA ] channel 4 used by cascade -00000000000i[DMA ] channel 2 used by Floppy Drive -00000000000i[FDD ] fd0: 'boot.img' ro=0, h=2,t=80,spt=18 -00000000000i[WGUI ] IME disabled -00000000000i[KMAP ] Loading keymap from 'C:\Program Files\Bochs-2.1.1/keymaps/x11-pc-us.map' -00000000000i[KMAP ] Loaded 168 symbols -00000000000i[VGA ] interval=30000 -00000000000i[VGA ] VBE Bochs Display Extension Enabled -00000000000i[ ] init_mem of 'harddrv' plugin device by virtual method -00000000000i[ ] init_mem of 'keyboard' plugin device by virtual method -00000000000i[ ] init_mem of 'serial' plugin device by virtual method -00000000000i[ ] init_mem of 'parallel' plugin device by virtual method -00000000000i[ ] init_mem of 'extfpuirq' plugin device by virtual method -00000000000i[ ] init_mem of 'gameport' plugin device by virtual method -00000000000i[ ] init_dev of 'harddrv' plugin device by virtual method -00000000000i[HD ] Boot device will be 'a' -00000000000i[HD ] Floppy boot signature check is enabled -00000000000i[ ] init_dev of 'keyboard' plugin device by virtual method -00000000000i[KBD ] will paste characters every 1000 keyboard ticks -00000000000i[ ] init_dev of 'serial' plugin device by virtual method -00000000000i[SER ] com1 at 0x03f8 irq 4 -00000000000i[ ] init_dev of 'parallel' plugin device by virtual method -00000000000i[PAR ] parallel port 1 at 0x378 irq 7 -00000000000i[ ] init_dev of 'extfpuirq' plugin device by virtual method -00000000000i[ ] init_dev of 'gameport' plugin device by virtual method -00000000000i[ ] reset of 'harddrv' plugin device by virtual method -00000000000i[ ] reset of 'keyboard' plugin device by virtual method -00000000000i[ ] reset of 'serial' plugin device by virtual method -00000000000i[ ] reset of 'parallel' plugin device by virtual method -00000000000i[ ] reset of 'extfpuirq' plugin device by virtual method -00000000000i[ ] reset of 'gameport' plugin device by virtual method -00000004325i[BIOS ] rombios.c,v 1.103.2.2 2004/02/02 22:39:22 cbothamy Exp $ -00000330074i[KBD ] reset-disable command received -00000390000i[WGUI ] dimension update x=720 y=400 fontheight=16 fontwidth=9 bpp=8 -00002359908e[HD ] device set to 0 which does not exist -00002360201e[HD ] device set to 1 which does not exist -00002625206e[DEV ] write to port 0x03f2 with len 2 ignored -00002629787i[BIOS ] int13_harddisk: function 15, unmapped device for DL=81 -00016270000i[FDD ] fd0: 'boot.img' ro=0, h=2,t=80,spt=18 -00016270000i[FDD ] fd0: 'D:\linux-0.11\Linux-0.11-With-PE-Loader\rootimage-0.11.img' ro=0, h=2,t=80,spt=18 -00016270000i[FDD ] fd0: 'D:\linux-0.11\Linux-0.11-With-PE-Loader\rootimage-0.11.img' ro=0, h=2,t=80,spt=18 -00159822000p[WGUI ] >>PANIC<< POWER button turned off. -00159822000i[SYS ] Last time is 1346489399 -00159822000i[CPU ] protected mode -00159822000i[CPU ] CS.d_b = 32 bit -00159822000i[CPU ] SS.d_b = 32 bit -00159822000i[CPU ] | EAX=00000000 EBX=ffffffff ECX=0001a248 EDX=00000036 -00159822000i[CPU ] | ESP=0001a108 EBP=0000013b ESI=00000000 EDI=0001fca0 -00159822000i[CPU ] | IOPL=0 NV UP EI PL ZR NA PE NC -00159822000i[CPU ] | SEG selector base limit G D -00159822000i[CPU ] | SEG sltr(index|ti|rpl) base limit G D -00159822000i[CPU ] | DS:0010( 0002| 0| 0) 00000000 00000fff 1 1 -00159822000i[CPU ] | ES:0010( 0002| 0| 0) 00000000 00000fff 1 1 -00159822000i[CPU ] | FS:0017( 0002| 1| 3) 00000000 0000009f 1 1 -00159822000i[CPU ] | GS:0017( 0002| 1| 3) 00000000 0000009f 1 1 -00159822000i[CPU ] | SS:0010( 0002| 0| 0) 00000000 00000fff 1 1 -00159822000i[CPU ] | CS:0008( 0001| 0| 0) 00000000 00000fff 1 1 -00159822000i[CPU ] | EIP=00006afb (00006afb) -00159822000i[CPU ] | CR0=0x8000001b CR1=0x00000000 CR2=0x080424cc -00159822000i[CPU ] | CR3=0x00000000 CR4=0x00000000 -00159822000i[ ] restoring default signal behavior -00159822000i[CTRL ] quit_sim called with exit code 1 diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/bochsrc.bxrc b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/bochsrc.bxrc deleted file mode 100644 index c977d97..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/bochsrc.bxrc +++ /dev/null @@ -1,26 +0,0 @@ -############################################################### -# bochsrc.bxrc file for Tinix. -############################################################### - -# how much memory the emulated machine will have -megs: 32 - -# filename of ROM images -romimage: file=$BXSHARE/BIOS-bochs-latest, address=0xf0000 -vgaromimage: $BXSHARE/VGABIOS-elpin-2.40 - -# what disk images will be used -floppya: 1_44=boot.img, status=inserted -#floppyb: 1_44=rootimage-0.11.img, status=inserted - -# choose the boot disk. -boot: a - -# where do we send log messages? -log: bochsout.txt - -# disable the mouse, since Tinix is text only -mouse: enabled=0 - -# enable key mapping, using US layout as default. -keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-us.map diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.asm b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.asm deleted file mode 100644 index b8ad580..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.asm +++ /dev/null @@ -1,246 +0,0 @@ -; -; SYS_SIZE is the number of clicks (16 bytes) to be loaded. -; 0x3000 is 0x30000 bytes = 196kB, more than enough for current -; versions of linux -; -SYSSIZE equ 0x3000 -; -; bootsect.s (C) 1991 Linus Torvalds -; -; bootsect.s is loaded at 0x7c00 by the bios-startup routines, and moves -; iself out of the way to address 0x90000, and jumps there. -; -; It then loads 'setup' directly after itself (0x90200), and the system -; at 0x10000, using BIOS interrupts. -; -; NOTE! currently system is at most 8*65536 bytes long. This should be no -; problem, even in the future. I want to keep it simple. This 512 kB -; kernel size should be enough, especially as this doesn't contain the -; buffer cache as in minix -; -; The loader has been made as simple as possible, and continuos -; read errors will result in a unbreakable loop. Reboot by hand. It -; loads pretty fast by getting whole sectors at a time whenever possible. - - -SETUPLEN equ 4 ; nr of setup-sectors -BOOTSEG equ 0x07c0 ; original address of boot-sector -INITSEG equ 0x9000 ; we move boot here - out of the way -SETUPSEG equ 0x9020 ; setup starts here -SYSSEG equ 0x1000 ; system loaded at 0x10000 (65536). -ENDSEG equ SYSSEG + SYSSIZE ; where to stop loading - -; ROOT_DEV: 0x000 - same type of floppy as boot. -; 0x301 - first partition on first drive etc -ROOT_DEV equ 0x306 -[section .s16] -[BITS 16] -_start: - mov ax,BOOTSEG - mov ds,ax - mov ax,INITSEG - mov es,ax - mov cx,256 - sub si,si - sub di,di - rep - movsw - jmp INITSEG:go -go: mov ax,cs - mov ds,ax - mov es,ax -; put stack at 0x9ff00. - mov ss,ax - mov sp,0xFF00 ; arbitrary value >>512 - -; load the setup-sectors directly after the bootblock. -; Note that 'es' is already set up. - -load_setup: - mov dx,0x0000 ; drive 0, head 0 - mov cx,0x0002 ; sector 2, track 0 - mov bx,0x0200 ; address = 512, in INITSEG - mov ax,0x0200+SETUPLEN ; service 2, nr of sectors - int 0x13 ; read it - jnc ok_load_setup ; ok - continue - mov dx,0x0000 - mov ax,0x0000 ; reset the diskette - int 0x13 - jmp load_setup - -ok_load_setup: - -; Get disk drive parameters, specifically nr of sectors/track - - mov dl,0x00 - mov ax,0x0800 ; AH=8 is get drive parameters - int 0x13 - mov ch,0x00 -; seg cs - mov [sectors],cx - mov ax,INITSEG - mov es,ax - -; Print some inane message - - mov ah,0x03 ; read cursor pos - xor bh,bh - int 0x10 - - mov cx,24 - mov bx,0x0007 ; page 0, attribute 7 (normal) - mov bp,msg1 - mov ax,0x1301 ; write string, move cursor - int 0x10 - -; ok, we've written the message, now -; we want to load the system (at 0x10000) - - mov ax,SYSSEG - mov es,ax ; segment of 0x010000 - call read_it - call kill_motor - -; After that we check which root-device to use. If the device is -; defined (;= 0), nothing is done and the given device is used. -; Otherwise, either /dev/PS0 (2,28) or /dev/at0 (2,8), depending -; on the number of sectors that the BIOS reports currently. - -; seg cs - mov ax,[root_dev] - cmp ax,0 - jne root_defined -; seg cs - mov bx,[sectors] - mov ax,0x0208 ; /dev/ps0 - 1.2Mb - cmp bx,15 - je root_defined - mov ax,0x021c ; /dev/PS0 - 1.44Mb - cmp bx,18 - je root_defined -undef_root: - jmp undef_root -root_defined: -; seg cs - mov [root_dev],ax - -; after that (everyting loaded), we jump to -; the setup-routine loaded directly after -; the bootblock: - - jmp SETUPSEG:0 - -; This routine loads the system at address 0x10000, making sure -; no 64kB boundaries are crossed. We try to load it as fast as -; possible, loading whole tracks whenever we can. -; -; in: es - starting address segment (normally 0x1000) -; -sread: dw 1+SETUPLEN ; sectors read of current track -head: dw 0 ; current head -track: dw 0 ; current track - -read_it: - mov ax,es - test ax,0x0fff -die: jne die ; es must be at 64kB boundary - xor bx,bx ; bx is starting address within segment -rp_read: - mov ax,es - cmp ax,ENDSEG ; have we loaded all yet? - jb ok1_read - ret -ok1_read: -; seg cs - mov ax,[sectors] - sub ax,[sread] - mov cx,ax - shl cx,9 - add cx,bx - jnc ok2_read - je ok2_read - xor ax,ax - sub ax,bx - shr ax,9 -ok2_read: - call read_track - mov cx,ax - add ax,[sread] -; seg cs - cmp ax,[sectors] - jne ok3_read - mov ax,1 - sub ax,[head] - jne ok4_read - inc word [track] -ok4_read: - mov [head],ax - xor ax,ax -ok3_read: - mov [sread],ax - shl cx,9 - add bx,cx - jnc rp_read - mov ax,es - add ax,0x1000 - mov es,ax - xor bx,bx - jmp rp_read - -read_track: - push ax - push bx - push cx - push dx - mov dx,[track] - mov cx,[sread] - inc cx - mov ch,dl - mov dx,[head] - mov dh,dl - mov dl,0 - and dx,0x0100 - mov ah,2 - int 0x13 - jc bad_rt - pop dx - pop cx - pop bx - pop ax - ret -bad_rt: mov ax,0 - mov dx,0 - int 0x13 - pop dx - pop cx - pop bx - pop ax - jmp read_track - -;/* -; * This procedure turns off the floppy drive motor, so -; * that we enter the kernel in a known state, and -; * don't have to worry about it later. -; */ -kill_motor: - push dx - mov dx,0x3f2 - mov al,0 - out dx,ax - pop dx - ret - -sectors: - dw 0 - -msg1: - db 13,10 - db "Loading System ..." - db 13,10,13,10 - -times 508-($-$$) db 0 -root_dev: - dw ROOT_DEV -boot_flag: - dw 0xAA55 - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.asm.bak b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.asm.bak deleted file mode 100644 index 5d88e06..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.asm.bak +++ /dev/null @@ -1,246 +0,0 @@ -; -; SYS_SIZE is the number of clicks (16 bytes) to be loaded. -; 0x3000 is 0x30000 bytes = 196kB, more than enough for current -; versions of linux -; -SYSSIZE equ 0x3000 -; -; bootsect.s (C) 1991 Linus Torvalds -; -; bootsect.s is loaded at 0x7c00 by the bios-startup routines, and moves -; iself out of the way to address 0x90000, and jumps there. -; -; It then loads 'setup' directly after itself (0x90200), and the system -; at 0x10000, using BIOS interrupts. -; -; NOTE! currently system is at most 8*65536 bytes long. This should be no -; problem, even in the future. I want to keep it simple. This 512 kB -; kernel size should be enough, especially as this doesn't contain the -; buffer cache as in minix -; -; The loader has been made as simple as possible, and continuos -; read errors will result in a unbreakable loop. Reboot by hand. It -; loads pretty fast by getting whole sectors at a time whenever possible. - - -SETUPLEN equ 4 ; nr of setup-sectors -BOOTSEG equ 0x07c0 ; original address of boot-sector -INITSEG equ 0x9000 ; we move boot here - out of the way -SETUPSEG equ 0x9020 ; setup starts here -SYSSEG equ 0x1000 ; system loaded at 0x10000 (65536). -ENDSEG equ SYSSEG + SYSSIZE ; where to stop loading - -; ROOT_DEV: 0x000 - same type of floppy as boot. -; 0x301 - first partition on first drive etc -ROOT_DEV equ 0x306 -[section .s16] -[BITS 16] -_start: - mov ax,BOOTSEG - mov ds,ax - mov ax,INITSEG - mov es,ax - mov cx,256 - sub si,si - sub di,di - rep - movsw - jmp INITSEG:go -go: mov ax,cs - mov ds,ax - mov es,ax -; put stack at 0x9ff00. - mov ss,ax - mov sp,0xFF00 ; arbitrary value >>512 - -; load the setup-sectors directly after the bootblock. -; Note that 'es' is already set up. - -load_setup: - mov dx,0x0000 ; drive 0, head 0 - mov cx,0x0002 ; sector 2, track 0 - mov bx,0x0200 ; address = 512, in INITSEG - mov ax,0x0200+SETUPLEN ; service 2, nr of sectors - int 0x13 ; read it - jnc ok_load_setup ; ok - continue - mov dx,0x0000 - mov ax,0x0000 ; reset the diskette - int 0x13 - jmp load_setup - -ok_load_setup: - -; Get disk drive parameters, specifically nr of sectors/track - - mov dl,0x00 - mov ax,0x0800 ; AH=8 is get drive parameters - int 0x13 - mov ch,0x00 -; seg cs - mov [sectors],cx - mov ax,INITSEG - mov es,ax - -; Print some inane message - - mov ah,0x03 ; read cursor pos - xor bh,bh - int 0x10 - - mov cx,24 - mov bx,0x0007 ; page 0, attribute 7 (normal) - mov bp,msg1 - mov ax,0x1301 ; write string, move cursor - int 0x10 - -; ok, we've written the message, now -; we want to load the system (at 0x10000) - - mov ax,SYSSEG - mov es,ax ; segment of 0x010000 - call read_it - call kill_motor - -; After that we check which root-device to use. If the device is -; defined (;= 0), nothing is done and the given device is used. -; Otherwise, either /dev/PS0 (2,28) or /dev/at0 (2,8), depending -; on the number of sectors that the BIOS reports currently. - -; seg cs - mov ax,[root_dev] - cmp ax,0 - jne root_defined -; seg cs - mov bx,[sectors] - mov ax,0x0208 ; /dev/ps0 - 1.2Mb - cmp bx,15 - je root_defined - mov ax,0x021c ; /dev/PS0 - 1.44Mb - cmp bx,18 - je root_defined -undef_root: - jmp undef_root -root_defined: -; seg cs - mov [root_dev],ax - -; after that (everyting loaded), we jump to -; the setup-routine loaded directly after -; the bootblock: - - jmp SETUPSEG:0 - -; This routine loads the system at address 0x10000, making sure -; no 64kB boundaries are crossed. We try to load it as fast as -; possible, loading whole tracks whenever we can. -; -; in: es - starting address segment (normally 0x1000) -; -sread: dw 1+SETUPLEN ; sectors read of current track -head: dw 0 ; current head -track: dw 0 ; current track - -read_it: - mov ax,es - test ax,0x0fff -die: jne die ; es must be at 64kB boundary - xor bx,bx ; bx is starting address within segment -rp_read: - mov ax,es - cmp ax,ENDSEG ; have we loaded all yet? - jb ok1_read - ret -ok1_read: -; seg cs - mov ax,[sectors] - sub ax,[sread] - mov cx,ax - shl cx,9 - add cx,bx - jnc ok2_read - je ok2_read - xor ax,ax - sub ax,bx - shr ax,9 -ok2_read: - call read_track - mov cx,ax - add ax,[sread] -; seg cs - cmp ax,[sectors] - jne ok3_read - mov ax,1 - sub ax,[head] - jne ok4_read - inc word [track] -ok4_read: - mov [head],ax - xor ax,ax -ok3_read: - mov [sread],ax - shl cx,9 - add bx,cx - jnc rp_read - mov ax,es - add ax,0x1000 - mov es,ax - xor bx,bx - jmp rp_read - -read_track: - push ax - push bx - push cx - push dx - mov dx,[track] - mov cx,[sread] - inc cx - mov ch,dl - mov dx,[head] - mov dh,dl - mov dl,0 - and dx,0x0100 - mov ah,2 - int 0x13 - jc bad_rt - pop dx - pop cx - pop bx - pop ax - ret -bad_rt: mov ax,0 - mov dx,0 - int 0x13 - pop dx - pop cx - pop bx - pop ax - jmp read_track - -;/* -; * This procedure turns off the floppy drive motor, so -; * that we enter the kernel in a known state, and -; * don't have to worry about it later. -; */ -kill_motor: - push dx - mov dx,0x3f2 - mov al,0 - out dx,ax - pop dx - ret - -sectors: - dw 0 - -msg1: - db 13,10 - db "Loading system ..." - db 13,10,13,10 - -times 508-($-$$) db 0 -root_dev: - dw ROOT_DEV -boot_flag: - dw 0xAA55 - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.bin b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.bin deleted file mode 100644 index 4961e58..0000000 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.bin and /dev/null differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.disasm b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.disasm deleted file mode 100644 index bf81a4f..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/bootsect.disasm +++ /dev/null @@ -1,227 +0,0 @@ -00000000 B8C007 mov ax,0x7c0 -00000003 8ED8 mov ds,ax -00000005 B80090 mov ax,0x9000 -00000008 8EC0 mov es,ax -0000000A B90001 mov cx,0x100 -0000000D 29F6 sub si,si -0000000F 29FF sub di,di -00000011 F3A5 rep movsw -00000013 EA18000090 jmp word 0x9000:0x18 -00000018 8CC8 mov ax,cs -0000001A 8ED8 mov ds,ax -0000001C 8EC0 mov es,ax -0000001E 8ED0 mov ss,ax -00000020 BC00FF mov sp,0xff00 -00000023 BA0000 mov dx,0x0 -00000026 B90200 mov cx,0x2 -00000029 BB0002 mov bx,0x200 -0000002C B80402 mov ax,0x204 -0000002F CD13 int 0x13 -00000031 730A jnc 0x3d -00000033 BA0000 mov dx,0x0 -00000036 B80000 mov ax,0x0 -00000039 CD13 int 0x13 -0000003B EBE6 jmp short 0x23 -0000003D B200 mov dl,0x0 -0000003F B80008 mov ax,0x800 -00000042 CD13 int 0x13 -00000044 B500 mov ch,0x0 -00000046 890E3901 mov [0x139],cx -0000004A B80090 mov ax,0x9000 -0000004D 8EC0 mov es,ax -0000004F B403 mov ah,0x3 -00000051 30FF xor bh,bh -00000053 CD10 int 0x10 -00000055 B91800 mov cx,0x18 -00000058 BB0700 mov bx,0x7 -0000005B BD3B01 mov bp,0x13b -0000005E B80113 mov ax,0x1301 -00000061 CD10 int 0x10 -00000063 B80010 mov ax,0x1000 -00000066 8EC0 mov es,ax -00000068 E83100 call word 0x9c -0000006B E8C200 call word 0x130 -0000006E A1FC01 mov ax,[0x1fc] -00000071 3D0000 cmp ax,0x0 -00000074 7518 jnz 0x8e -00000076 8B1E3901 mov bx,[0x139] -0000007A B80802 mov ax,0x208 -0000007D 81FB0F00 cmp bx,0xf -00000081 740B jz 0x8e -00000083 B81C02 mov ax,0x21c -00000086 81FB1200 cmp bx,0x12 -0000008A 7402 jz 0x8e -0000008C EBFE jmp short 0x8c -0000008E A3FC01 mov [0x1fc],ax -00000091 EA00002090 jmp word 0x9020:0x0 -00000096 050000 add ax,0x0 -00000099 0000 add [bx+si],al -0000009B 008CC0A9 add [si-0x5640],cl -0000009F FF0F dec word [bx] -000000A1 75FE jnz 0xa1 -000000A3 31DB xor bx,bx -000000A5 8CC0 mov ax,es -000000A7 3D0040 cmp ax,0x4000 -000000AA 7201 jc 0xad -000000AC C3 ret -000000AD A13901 mov ax,[0x139] -000000B0 2B069600 sub ax,[0x96] -000000B4 89C1 mov cx,ax -000000B6 C1E109 shl cx,0x9 -000000B9 01D9 add cx,bx -000000BB 7309 jnc 0xc6 -000000BD 7407 jz 0xc6 -000000BF 31C0 xor ax,ax -000000C1 29D8 sub ax,bx -000000C3 C1E809 shr ax,0x9 -000000C6 E83300 call word 0xfc -000000C9 89C1 mov cx,ax -000000CB 03069600 add ax,[0x96] -000000CF 3B063901 cmp ax,[0x139] -000000D3 7512 jnz 0xe7 -000000D5 B80100 mov ax,0x1 -000000D8 2B069800 sub ax,[0x98] -000000DC 7504 jnz 0xe2 -000000DE FF069A00 inc word [0x9a] -000000E2 A39800 mov [0x98],ax -000000E5 31C0 xor ax,ax -000000E7 A39600 mov [0x96],ax -000000EA C1E109 shl cx,0x9 -000000ED 01CB add bx,cx -000000EF 73B4 jnc 0xa5 -000000F1 8CC0 mov ax,es -000000F3 050010 add ax,0x1000 -000000F6 8EC0 mov es,ax -000000F8 31DB xor bx,bx -000000FA EBA9 jmp short 0xa5 -000000FC 50 push ax -000000FD 53 push bx -000000FE 51 push cx -000000FF 52 push dx -00000100 8B169A00 mov dx,[0x9a] -00000104 8B0E9600 mov cx,[0x96] -00000108 41 inc cx -00000109 88D5 mov ch,dl -0000010B 8B169800 mov dx,[0x98] -0000010F 88D6 mov dh,dl -00000111 B200 mov dl,0x0 -00000113 81E20001 and dx,0x100 -00000117 B402 mov ah,0x2 -00000119 CD13 int 0x13 -0000011B 7205 jc 0x122 -0000011D 5A pop dx -0000011E 59 pop cx -0000011F 5B pop bx -00000120 58 pop ax -00000121 C3 ret -00000122 B80000 mov ax,0x0 -00000125 BA0000 mov dx,0x0 -00000128 CD13 int 0x13 -0000012A 5A pop dx -0000012B 59 pop cx -0000012C 5B pop bx -0000012D 58 pop ax -0000012E EBCC jmp short 0xfc -00000130 52 push dx -00000131 BAF203 mov dx,0x3f2 -00000134 B000 mov al,0x0 -00000136 EF out dx,ax -00000137 5A pop dx -00000138 C3 ret -00000139 0000 add [bx+si],al -0000013B 0D0A4C or ax,0x4c0a -0000013E 6F outsw -0000013F 61 popaw -00000140 64696E672053 imul bp,[fs:bp+0x67],word 0x5320 -00000146 7973 jns 0x1bb -00000148 7465 jz 0x1af -0000014A 6D insw -0000014B 202E2E2E and [0x2e2e],ch -0000014F 0D0A0D or ax,0xd0a -00000152 0A00 or al,[bx+si] -00000154 0000 add [bx+si],al -00000156 0000 add [bx+si],al -00000158 0000 add [bx+si],al -0000015A 0000 add [bx+si],al -0000015C 0000 add [bx+si],al -0000015E 0000 add [bx+si],al -00000160 0000 add [bx+si],al -00000162 0000 add [bx+si],al -00000164 0000 add [bx+si],al -00000166 0000 add [bx+si],al -00000168 0000 add [bx+si],al -0000016A 0000 add [bx+si],al -0000016C 0000 add [bx+si],al -0000016E 0000 add [bx+si],al -00000170 0000 add [bx+si],al -00000172 0000 add [bx+si],al -00000174 0000 add [bx+si],al -00000176 0000 add [bx+si],al -00000178 0000 add [bx+si],al -0000017A 0000 add [bx+si],al -0000017C 0000 add [bx+si],al -0000017E 0000 add [bx+si],al -00000180 0000 add [bx+si],al -00000182 0000 add [bx+si],al -00000184 0000 add [bx+si],al -00000186 0000 add [bx+si],al -00000188 0000 add [bx+si],al -0000018A 0000 add [bx+si],al -0000018C 0000 add [bx+si],al -0000018E 0000 add [bx+si],al -00000190 0000 add [bx+si],al -00000192 0000 add [bx+si],al -00000194 0000 add [bx+si],al -00000196 0000 add [bx+si],al -00000198 0000 add [bx+si],al -0000019A 0000 add [bx+si],al -0000019C 0000 add [bx+si],al -0000019E 0000 add [bx+si],al -000001A0 0000 add [bx+si],al -000001A2 0000 add [bx+si],al -000001A4 0000 add [bx+si],al -000001A6 0000 add [bx+si],al -000001A8 0000 add [bx+si],al -000001AA 0000 add [bx+si],al -000001AC 0000 add [bx+si],al -000001AE 0000 add [bx+si],al -000001B0 0000 add [bx+si],al -000001B2 0000 add [bx+si],al -000001B4 0000 add [bx+si],al -000001B6 0000 add [bx+si],al -000001B8 0000 add [bx+si],al -000001BA 0000 add [bx+si],al -000001BC 0000 add [bx+si],al -000001BE 0000 add [bx+si],al -000001C0 0000 add [bx+si],al -000001C2 0000 add [bx+si],al -000001C4 0000 add [bx+si],al -000001C6 0000 add [bx+si],al -000001C8 0000 add [bx+si],al -000001CA 0000 add [bx+si],al -000001CC 0000 add [bx+si],al -000001CE 0000 add [bx+si],al -000001D0 0000 add [bx+si],al -000001D2 0000 add [bx+si],al -000001D4 0000 add [bx+si],al -000001D6 0000 add [bx+si],al -000001D8 0000 add [bx+si],al -000001DA 0000 add [bx+si],al -000001DC 0000 add [bx+si],al -000001DE 0000 add [bx+si],al -000001E0 0000 add [bx+si],al -000001E2 0000 add [bx+si],al -000001E4 0000 add [bx+si],al -000001E6 0000 add [bx+si],al -000001E8 0000 add [bx+si],al -000001EA 0000 add [bx+si],al -000001EC 0000 add [bx+si],al -000001EE 0000 add [bx+si],al -000001F0 0000 add [bx+si],al -000001F2 0000 add [bx+si],al -000001F4 0000 add [bx+si],al -000001F6 0000 add [bx+si],al -000001F8 0000 add [bx+si],al -000001FA 0000 add [bx+si],al -000001FC 06 push es -000001FD 0355AA add dx,[di-0x56] diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/head.s b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/head.s deleted file mode 100644 index 7c534d8..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/head.s +++ /dev/null @@ -1,240 +0,0 @@ -/* - * linux/boot/head.s - * - * (C) 1991 Linus Torvalds - */ - -/* - * head.s contains the 32-bit startup code. - * - * NOTE!!! Startup happens at absolute address 0x00000000, which is also where - * the page directory will exist. The startup code will be overwritten by - * the page directory. - */ -.text -.globl _idt,_gdt,_pg_dir,_tmp_floppy_area -_pg_dir: -.globl startup_32 -startup_32: - movl $0x10,%eax - mov %ax,%ds - mov %ax,%es - mov %ax,%fs - mov %ax,%gs - lss _stack_start,%esp - call _setup_idt - call _setup_gdt - movl $0x10,%eax # reload all the segment registers - mov %ax,%ds # after changing gdt. CS was already - mov %ax,%es # reloaded in 'setup_gdt' - mov %ax,%fs - mov %ax,%gs - lss _stack_start,%esp - xorl %eax,%eax -1: incl %eax # check that A20 really IS enabled - movl %eax,0x000000 # loop forever if it isn't - cmpl %eax,0x100000 - je 1b - -/* - * NOTE! 486 should set bit 16, to check for write-protect in supervisor - * mode. Then it would be unnecessary with the "verify_area()"-calls. - * 486 users probably want to set the NE (#5) bit also, so as to use - * int 16 for math errors. - */ - movl %cr0,%eax # check math chip - andl $0x80000011,%eax # Save PG,PE,ET -/* "orl $0x10020,%eax" here for 486 might be good */ - orl $2,%eax # set MP - movl %eax,%cr0 - call check_x87 - jmp after_page_tables - -/* - * We depend on ET to be correct. This checks for 287/387. - */ -check_x87: - fninit - fstsw %ax - cmpb $0,%al - je 1f /* no coprocessor: have to set bits */ - movl %cr0,%eax - xorl $6,%eax /* reset MP, set EM */ - movl %eax,%cr0 - ret -.align 2 -1: .byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */ - ret - -/* - * setup_idt - * - * sets up a idt with 256 entries pointing to - * ignore_int, interrupt gates. It then loads - * idt. Everything that wants to install itself - * in the idt-table may do so themselves. Interrupts - * are enabled elsewhere, when we can be relatively - * sure everything is ok. This routine will be over- - * written by the page tables. - */ -_setup_idt: - lea ignore_int,%edx - movl $0x00080000,%eax - movw %dx,%ax /* selector = 0x0008 = cs */ - movw $0x8E00,%dx /* interrupt gate - dpl=0, present */ - - lea _idt,%edi - mov $256,%ecx -rp_sidt: - movl %eax,(%edi) - movl %edx,4(%edi) - addl $8,%edi - dec %ecx - jne rp_sidt - lidt idt_descr - ret - -/* - * setup_gdt - * - * This routines sets up a new gdt and loads it. - * Only two entries are currently built, the same - * ones that were built in init.s. The routine - * is VERY complicated at two whole lines, so this - * rather long comment is certainly needed :-). - * This routine will beoverwritten by the page tables. - */ -_setup_gdt: - lgdt gdt_descr - ret - -/* - * I put the kernel page tables right after the page directory, - * using 4 of them to span 16 Mb of physical memory. People with - * more than 16MB will have to expand this. - */ -.org 0x1000 -pg0: - -.org 0x2000 -pg1: - -.org 0x3000 -pg2: - -.org 0x4000 -pg3: - -.org 0x5000 -/* - * tmp_floppy_area is used by the floppy-driver when DMA cannot - * reach to a buffer-block. It needs to be aligned, so that it isn't - * on a 64kB border. - */ -_tmp_floppy_area: - .fill 1024,1,0 - -after_page_tables: - pushl $0 # These are the parameters to main :-) - pushl $0 - pushl $0 - pushl $L6 # return address for main, if it decides to. - pushl $_start - jmp setup_paging -L6: - jmp L6 # main should never return here, but - # just in case, we know what happens. - -/* This is the default interrupt "handler" :-) */ -int_msg: - .asciz "Unknown interrupt\n\r" -.align 2 -ignore_int: - pushl %eax - pushl %ecx - pushl %edx - push %ds - push %es - push %fs - movl $0x10,%eax - mov %ax,%ds - mov %ax,%es - mov %ax,%fs - pushl $int_msg - call _printk - popl %eax - pop %fs - pop %es - pop %ds - popl %edx - popl %ecx - popl %eax - iret - - -/* - * Setup_paging - * - * This routine sets up paging by setting the page bit - * in cr0. The page tables are set up, identity-mapping - * the first 16MB. The pager assumes that no illegal - * addresses are produced (ie >4Mb on a 4Mb machine). - * - * NOTE! Although all physical memory should be identity - * mapped by this routine, only the kernel page functions - * use the >1Mb addresses directly. All "normal" functions - * use just the lower 1Mb, or the local data space, which - * will be mapped to some other place - mm keeps track of - * that. - * - * For those with more memory than 16 Mb - tough luck. I've - * not got it, why should you :-) The source is here. Change - * it. (Seriously - it shouldn't be too difficult. Mostly - * change some constants etc. I left it at 16Mb, as my machine - * even cannot be extended past that (ok, but it was cheap :-) - * I've tried to show which constants to change by having - * some kind of marker at them (search for "16Mb"), but I - * won't guarantee that's all :-( ) - */ -.align 2 -setup_paging: - movl $1024*5,%ecx /* 5 pages - pg_dir+4 page tables */ - xorl %eax,%eax - xorl %edi,%edi /* pg_dir is at 0x000 */ - cld;rep;stosl - movl $pg0+7,_pg_dir /* set present bit/user r/w */ - movl $pg1+7,_pg_dir+4 /* --------- " " --------- */ - movl $pg2+7,_pg_dir+8 /* --------- " " --------- */ - movl $pg3+7,_pg_dir+12 /* --------- " " --------- */ - movl $pg3+4092,%edi - movl $0xfff007,%eax /* 16Mb - 4096 + 7 (r/w user,p) */ - std -1: stosl /* fill pages backwards - more efficient :-) */ - subl $0x1000,%eax - jge 1b - xorl %eax,%eax /* pg_dir is at 0x0000 */ - movl %eax,%cr3 /* cr3 - page directory start */ - movl %cr0,%eax - orl $0x80000000,%eax - movl %eax,%cr0 /* set paging (PG) bit */ - ret /* this also flushes prefetch-queue */ - -.align 2 -.word 0 -idt_descr: - .word 256*8-1 # idt contains 256 entries - .long _idt -.align 2 -.word 0 -gdt_descr: - .word 256*8-1 # so does gdt (not that that's any - .long _gdt # magic number, but it works for me :^) - - .align 8 -_idt: .fill 256,8,0 # idt is uninitialized - -_gdt: .quad 0x0000000000000000 /* NULL descriptor */ - .quad 0x00c09a0000000fff /* 16Mb */ - .quad 0x00c0920000000fff /* 16Mb */ - .quad 0x0000000000000000 /* TEMPORARY - don't use */ - .fill 252,8,0 /* space for LDT's and TSS's etc */ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/pestruc.inc b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/pestruc.inc deleted file mode 100644 index 2961e1b..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/pestruc.inc +++ /dev/null @@ -1,93 +0,0 @@ -IMAGE_NUMBEROF_DIRECTORY_ENTRIES equ 16 -IMAGE_SIZEOF_SHORT_NAME equ 8 - - -STRUC IMAGE_FILE_HEADER -.Machine RESW 1 -.NumberOfSections RESW 1 -.TimeDateStamp RESD 1 -.PointerToSymbolTable RESD 1 -.NumberOfSymbols RESD 1 -.SizeOfOptionalHeader RESW 1 -.Characteristics RESW 1 -ENDSTRUC - -STRUC IMAGE_DATA_DIRECTORY -.VirtualAddress RESD 1 -.isize RESD 1 -ENDSTRUC - -STRUC IMAGE_OPTIONAL_HEADER32 - .Magic RESW 1 - .MajorLinkerVersion RESB 1 - .MinorLinkerVersion RESB 1 - .SizeOfCode RESD 1 - .SizeOfInitializedData RESD 1 - .SizeOfUninitializedData RESD 1 - .AddressOfEntryPoint RESD 1 - .BaseOfCode RESD 1 - .BaseOfData RESD 1 - .ImageBase RESD 1 - .SectionAlignment RESD 1 - .FileAlignment RESD 1 - .MajorOperatingSystemVersion RESW 1 - .MinorOperatingSystemVersion RESW 1 - .MajorImageVersion RESW 1 - .MinorImageVersion RESW 1 - .MajorSubsystemVersion RESW 1 - .MinorSubsystemVersion RESW 1 - .Win32VersionValue RESD 1 - .SizeOfImage RESD 1 - .SizeOfHeaders RESD 1 - .CheckSum RESD 1 - .Subsystem RESW 1 - .DllCharacteristics RESW 1 - .SizeOfStackReserve RESD 1 - .SizeOfStackCommit RESD 1 - .SizeOfHeapReserve RESD 1 - .SizeOfHeapCommit RESD 1 - .LoaderFlags RESD 1 - .NumberOfRvaAndSizes RESD 1 - .DataDirectory RESB IMAGE_DATA_DIRECTORY_size*16 - ENDSTRUC - -STRUC IMAGE_SECTION_HEADER - .Name1 RESB 8 - .VirtualSize RESD 1 - .VirtualAddress RESD 1 - .SizeOfRawData RESD 1 - .PointerToRawData RESD 1 - .PointerToRelocations RESD 1 - .PointerToLinenumbers RESD 1 - .NumberOfRelocations RESW 1 - .NumberOfLinenumbers RESW 1 - .Characteristics RESD 1 -ENDSTRUC - -STRUC IMAGE_NT_HEADERS - .Signature RESD 1 - .FileHeader RESB IMAGE_FILE_HEADER_size - .OptionalHeader RESB IMAGE_OPTIONAL_HEADER32_size -ENDSTRUC - -STRUC IMAGE_DOS_HEADER - .e_magic RESW 1 - .e_cblp RESW 1 - .e_cp RESW 1 - .e_crlc RESW 1 - .e_cparhdr RESW 1 - .e_minalloc RESW 1 - .e_maxalloc RESW 1 - .e_ss RESW 1 - .e_sp RESW 1 - .e_csum RESW 1 - .e_ip RESW 1 - .e_cs RESW 1 - .e_lfarlc RESW 1 - .e_ovno RESW 1 - .e_res4 RESW 4 - .e_oemid RESW 1 - .e_oeminfo RESW 1 - .e_res2 RESW 10 - .e_lfanew RESD 1 -ENDSTRUC \ No newline at end of file diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/pm.inc b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/pm.inc deleted file mode 100644 index 672a244..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/pm.inc +++ /dev/null @@ -1,250 +0,0 @@ - - -; ͼʾ - -; ߵַ͵ַ - -; | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | -; |7654321076543210765432107654321076543210765432107654321076543210| <- 8 ֽ -; |--------========--------========--------========--------========| -; ששש -; 31..24 (ͼ) λַ(23..0) ν(15..0) -; -; ַ2۩ک ٩ַ1b ַ1a ν1 -; ǩ贈ש贈贈 -; %6 %5 %4 %3 %2 %1 -; ߩߩߩߩߩ -; \_________ -; \__________________ -; \________________________________________________ -; \ -; ששששששששששששששש -; 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 -; ǩ贈贈贈贈ߩߩߩ贈贈ߩ贈贈ߩߩߩ -; G D 0 AVL ν 2 (19..16) P DPL S TYPE -; ǩߩߩߩ贈贈ߩߩߩ -; : 2 : ν 2 : 1 -; ߩߩ -; ߵַ ͵ַ -; -; - -; ˵: -; -; (1) P: (Present)λ -; P=1 ʾԵַתЧģ˵ĶδڣڴУ -; P=0 ʾԵַתЧöβڡʹøڴʱ쳣 -; -; (2) DPL: ʾȨ(Descriptor Privilege level)2λ涨εȨȨ飬ԾԸöܷʡ -; -; (3) S: ˵͡ -; ڴ洢ԣS=1ϵͳ(S=0) -; -; (4) TYPE: ˵洢Ĵ洢εľԡ -; -; -; ݶ ֵ ˵ -; ---------------------------------- -; 0 ֻ -; 1 ֻѷ -; 2 /д -; 3 /дѷ -; 4 ֻչ -; 5 ֻչѷ -; 6 /дչ -; 7 /дչѷ -; -; -; ֵ ˵ -; ---------------------------------- -; 8 ִֻ -; 9 ִֻСѷ -; A ִ/ -; B ִ/ѷ -; C ִֻСһ -; D ִֻСһΡѷ -; E ִ/һ -; F ִ/һΡѷ -; -; -; ϵͳ ͱ ˵ -; ---------------------------------- -; 0 <δ> -; 1 286TSS -; 2 LDT -; 3 æ286TSS -; 4 286 -; 5 -; 6 286ж -; 7 286 -; 8 δ -; 9 386TSS -; A <δ> -; B æ386TSS -; C 386 -; D <δ> -; E 386ж -; F 386 -; -; (5) G: ν(Granularity)λ -; G=0 ʾΪֽڣ -; G=1 ʾΪ4K ֽڡ -; ע⣬ֻԶνЧԶλַЧλַֽΪλ -; -; (6) D: DλһλִжΡչݶλSSĴѰַĶ(ͨǶջ)еͬ -; ִжεУDλָʹõĵַĬϵĴС -; D=1ʾĬָʹ32λַ32λ8λĴҲΪ32λΣ -; D=0 ʾĬ£ʹ16λַ16λ8λĴҲΪ16λΣ80286ݡʹõַСǰ׺ͲСǰ׺ֱıĬϵĵַĴС -; չݶεУDλεϲ߽硣 -; D=1ʾεϲΪ4G -; D=0ʾεϲΪ64KΪ80286ݡ -; SSĴѰַĶУDλʽĶջָ(PUSHPOPָ)ʹúֶջָĴ -; D=1ʾʹ32λջָĴESP -; D=0ʾʹ16λջָĴSP80286ݡ -; -; (7) AVL: λ80386Ըλʹδ涨Intel˾Ҳ֤󿪷ĴֻҪ80386ݣͲԸλʹκζ涨 -; - - -;---------------------------------------------------------------------------- -; ֵ˵ -; : -; DA_ : Descriptor Attribute -; D : ݶ -; C : -; S : ϵͳ -; R : ֻ -; RW : д -; A : ѷ -; : ɰ˼ -;---------------------------------------------------------------------------- -DA_32 EQU 4000h ; 32 λ -DA_LIMIT_4K EQU 8000h ; νΪ 4K ֽ - -DA_DPL0 EQU 00h ; DPL = 0 -DA_DPL1 EQU 20h ; DPL = 1 -DA_DPL2 EQU 40h ; DPL = 2 -DA_DPL3 EQU 60h ; DPL = 3 -;---------------------------------------------------------------------------- -; 洢ֵ˵ -;---------------------------------------------------------------------------- -DA_DR EQU 90h ; ڵֻݶֵ -DA_DRW EQU 92h ; ڵĿɶдݶֵ -DA_DRWA EQU 93h ; ڵѷʿɶдݶֵ -DA_C EQU 98h ; ڵִֻдֵ -DA_CR EQU 9Ah ; ڵĿִпɶֵ -DA_CCO EQU 9Ch ; ڵִֻһ´ֵ -DA_CCOR EQU 9Eh ; ڵĿִпɶһ´ֵ -;---------------------------------------------------------------------------- -; ϵͳֵ˵ -;---------------------------------------------------------------------------- -DA_LDT EQU 82h ; ֲֵ -DA_TaskGate EQU 85h ; ֵ -DA_386TSS EQU 89h ; 386 ״ֵ̬ -DA_386CGate EQU 8Ch ; 386 ֵ -DA_386IGate EQU 8Eh ; 386 жֵ -DA_386TGate EQU 8Fh ; 386 ֵ -;---------------------------------------------------------------------------- - - -; ѡͼʾ: -; ששששששששששששששש -; 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 -; ǩߩߩߩߩߩߩߩߩߩߩߩߩ贈贈ߩ -; TI RPL -; ߩߩ -; -; RPL(Requested Privilege Level): ȨȨ顣 -; -; TI(Table Indicator): ָʾλ -; TI=0 ָʾȫGDTжȡ -; TI=1 ָʾӾֲLDTжȡ -; - -;---------------------------------------------------------------------------- -; ѡֵ˵ -; : -; SA_ : Selector Attribute - -SA_RPL0 EQU 0 ; -SA_RPL1 EQU 1 ; RPL -SA_RPL2 EQU 2 ; -SA_RPL3 EQU 3 ; - -SA_TIG EQU 0 ; TI -SA_TIL EQU 4 ; -;---------------------------------------------------------------------------- - - -;---------------------------------------------------------------------------- -; ҳʹõij˵ -;---------------------------------------------------------------------------- -PG_P EQU 1 ; ҳλ -PG_RWR EQU 0 ; R/W λֵ, /ִ -PG_RWW EQU 2 ; R/W λֵ, /д/ִ -PG_USS EQU 0 ; U/S λֵ, ϵͳ -PG_USU EQU 4 ; U/S λֵ, û -;---------------------------------------------------------------------------- - - - - -; ========================================= -; FLAGS - Intel 8086 Family Flags Register -; ========================================= -; -; |11|10|F|E|D|C|B|A|9|8|7|6|5|4|3|2|1|0| -; | | | | | | | | | | | | | | | | | '--- CFCarry Flag -; | | | | | | | | | | | | | | | | '--- 1 -; | | | | | | | | | | | | | | | '--- PFParity Flag -; | | | | | | | | | | | | | | '--- 0 -; | | | | | | | | | | | | | '--- AFAuxiliary Flag -; | | | | | | | | | | | | '--- 0 -; | | | | | | | | | | | '--- ZFZero Flag -; | | | | | | | | | | '--- SFSign Flag -; | | | | | | | | | '--- TFTrap Flag (Single Step) -; | | | | | | | | '--- IFInterrupt Flag -; | | | | | | | '--- DFDirection Flag -; | | | | | | '--- OFOverflow flag -; | | | | '----- IOPLI/O Privilege Level (286+ only) -; | | | '----- NTNested Task Flag (286+ only) -; | | '----- 0 -; | '----- RFResume Flag (386+ only) -; '------ VMVirtual Mode Flag (386+ only) -; -; ע: see PUSHF POPF STI CLI STD CLD -; - - -; ------------------------------------------------------------------------------------------------------ -; -; -; usage: Descriptor Base, Limit, Attr -; Base: dd -; Limit: dd (low 20 bits available) -; Attr: dw (lower 4 bits of higher byte are always 0) -%macro Descriptor 3 - dw %2 & 0FFFFh ; ν 0--15 (2 ֽ) - dw %1 & 0FFFFh ; λַ 0--15 (2 ֽ) - db (%1 >> 16) & 0FFh ; λַ 16--23 (1 ֽ) - db %3 & 0xFF ;Եĵ8λ 0--7 - db ((%2 >> 16) & 0Fh) | (%3 >> 8) ; ν16--19λ 1 + ν 2 + 2 (2 ֽ) - db (%1 >> 24) & 0FFh ; λַ 3 (1 ֽ) -%endmacro ; 8 ֽ - -; -; -; usage: Gate Selector, Offset, DCount, Attr -; Selector: dw -; Offset: dd -; DCount: db -; Attr: db -%macro Gate 4 - dw (%2 & 0FFFFh) ; ƫ 1 (2 ֽ) - dw %1 ; ѡ (2 ֽ) - dw (%3 & 1Fh) | ((%4 << 8) & 0FF00h) ; (2 ֽ) - dw ((%2 >> 16) & 0FFFFh) ; ƫ 2 (2 ֽ) -%endmacro ; 8 ֽ - - -; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/protect.inc b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/protect.inc deleted file mode 100644 index e593723..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/protect.inc +++ /dev/null @@ -1,50 +0,0 @@ - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -struc SegmentDescriptor - .wLimitLow RESW 1 ;ν޵16λ - .wBaseLow RESW 1 ;ַ16λ - .bBaseMiddle RESB 1 ;ַм8λ - .bAttrib RESB 1 ; - .bLimitHight4Bit_AttribHight4Bit RESB 1 ;ν޵ĸ4λͶԵĸ4λ - .bBaseHigh RESB 1 ;ַĸ8λ -endstruc - -; varaible ,offset,Base -%macro SetDescriptor_Base_Offset 3 - xor eax, eax - mov ax, %3 - shl eax, 4 - add eax, %2 - mov word [%1 + SegmentDescriptor.wBaseLow], ax - shr eax, 16 - mov byte [%1 + SegmentDescriptor.bBaseMiddle], al - mov byte [%1 + SegmentDescriptor.bBaseHigh], ah -%endmacro - -; varaible , Base -%macro SetDescriptor_Base 2 - mov eax,%2 - mov word [%1 + SegmentDescriptor.wBaseLow], ax - shr eax, 16 - mov byte [%1 + SegmentDescriptor.bBaseMiddle], al - mov byte [%1 + SegmentDescriptor.bBaseHigh], ah -%endmacro - -; %1 new descriptor name -; %2 base : 32 bit -; %3 limit : 20 bit -; %4 attribute ; 12 bit -%macro NewDescriptor 4 -%1: - istruc SegmentDescriptor - at SegmentDescriptor.wLimitLow , dw %3 & 0xffff - at SegmentDescriptor.wBaseLow , dw %2 & 0xffff - at SegmentDescriptor.bBaseMiddle, db (%2>>16) & 0xff - at SegmentDescriptor.bAttrib , db %4 & 0xff - at SegmentDescriptor.bLimitHight4Bit_AttribHight4Bit, db ( (%3>>16) & 0x0F) | (%4 >> 8) - at SegmentDescriptor.bBaseHigh , db (%2 >> 24) & 0xff - iend -%endmacro - - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/setup.asm b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/setup.asm deleted file mode 100644 index 96d0f86..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/setup.asm +++ /dev/null @@ -1,373 +0,0 @@ -; -; setup.s (C) 1991 Linus Torvalds -; -; setup.s is responsible for getting the system data from the BIOS, -; and putting them into the appropriate places in system memory. -; both setup.s and system has been loaded by the bootblock. -; -; This code asks the bios for memory/disk/other parameters, and -; puts them in a "safe" place: 0x90000-0x901FF, ie where the -; boot-block used to be. It is then up to the protected mode -; system to read them from there before the area is overwritten -; for buffer-blocks. -; - -; NOTE; These had better be the same as in bootsect.s; - -INITSEG equ 0x9000 ; we move boot here - out of the way -SYSSEG equ 0x1000 ; system loaded at 0x10000 (65536). -SETUPSEG equ 0x9020 ; this is the current segment - -SYSTEM_ADDRESS equ 0x50000 -DESTINATION_ADDRESS equ 0x0000 - - -%include "pm.inc" -%include "protect.inc" -%include "pestruc.inc" - -start: -; ok, the read went well so we get current cursor position and save it for -; posterity. - mov ax,INITSEG ; this is done in bootsect already, but... - mov ds,ax - mov ah,0x03 ; read cursor pos - xor bh,bh - int 0x10 ; save it in known place, con_init fetches - mov [0],dx ; it from 0x90000. -; Get memory size (extended mem, kB) - - mov ah,0x88 - int 0x15 - mov [2],ax - -; Get video-card data: - - mov ah,0x0f - int 0x10 - mov [4],bx ; bh = display page - mov [6],ax ; al = video mode, ah = window width - -; check for EGA/VGA and some config parameters - - mov ah,0x12 - mov bl,0x10 - int 0x10 - mov [8],ax - mov [10],bx - mov [12],cx - -; Get hd0 data - - mov ax,0x0000 - mov ds,ax - lds si,[4*0x41] - mov ax,INITSEG - mov es,ax - mov di,0x0080 - mov cx,0x10 - rep - movsb - -; Get hd1 data - - mov ax,0x0000 - mov ds,ax - lds si,[4*0x46] - mov ax,INITSEG - mov es,ax - mov di,0x0090 - mov cx,0x10 - rep - movsb - -; Check that there IS a hd1 :-) - - mov ax,0x01500 - mov dl,0x81 - int 0x13 - jc no_disk1 - cmp ah,3 - je is_disk1 -no_disk1: - mov ax,INITSEG - mov es,ax - mov di,0x0090 - mov cx,0x10 - mov ax,0x00 - rep - stosb -is_disk1: - -; now we want to move to protected mode ... - - cli ; no interrupts allowed ; - -; first we move the system to it's rightful place - -;--System ģ0x10000Ƶ0x50000λ,ĬSystemģ鲻ᳬ256KB -;--ΪPEʽSystemģнеĴݿܻḲǵ0x10000Ĵ,ʹʹݻûȫVirtual Addressź -;--ԭݾѾƻ - mov ax,0x1000 - mov ds,ax - mov ax,0x5000 - mov es,ax - cld ; 'direction'=0, movs moves forward -do_move: - sub di,di - sub si,si - mov cx,0x8000 - rep - movsw - - mov ax,ds - add ax,0x1000 - cmp ax,0x5000 - jz end_move - - mov ds,ax - - mov ax,es - add ax,0x1000 - mov es,ax - jmp do_move - -; then we load the segment descriptors - -end_move: - mov ax,SETUPSEG ; right, forgot this at first. didn't work :-) - mov ds,ax - - mov eax,0x9000 - mov es,ax - - mov ax,0x800 - mov [es:gdt_48_offset],ax - mov eax,0x90200 +gdt - mov dword [es:gdt_48_offset+2],0x90200+gdt - - xor eax,eax - mov word [es:idt_48_offset],ax - mov dword [idt_48_offset+2],eax - -; lidt [idt_48] ; load idt with 0,0 -; lgdt [gdt_48] ; load gdt with whatever appropriate - lgdt [gdt_ptr] -; that was painless, now we enable A20 - - call empty_8042 - mov al,0xD1 ; command write - out 0x64,al - call empty_8042 - mov al,0xDF ; A20 on - out 0x60,al - call empty_8042 - -; well, that went ok, I hope. Now we have to reprogram the interrupts :-( -; we put them right after the intel-reserved hardware interrupts, at -; int 0x20-0x2F. There they won't mess up anything. Sadly IBM really -; messed this up with the original PC, and they haven't been able to -; rectify it afterwards. Thus the bios puts interrupts at 0x08-0x0f, -; which is used for the internal hardware interrupts as well. We just -; have to reprogram the 8259's, and it isn't fun. - - mov al,0x11 ; initialization sequence - out 0x20,al ; send it to 8259A-1 - dw 0x00eb,0x00eb ; jmp $+2, jmp $+2 - out 0xA0,al ; and to 8259A-2 - dw 0x00eb,0x00eb - mov al,0x20 ; start of hardware int's (0x20) - out 0x21,al - dw 0x00eb,0x00eb - mov al,0x28 ; start of hardware int's 2 (0x28) - out 0xA1,al - dw 0x00eb,0x00eb - mov al,0x04 ; 8259-1 is master - out 0x21,al - dw 0x00eb,0x00eb - mov al,0x02 ; 8259-2 is slave - out 0xA1,al - dw 0x00eb,0x00eb - mov al,0x01 ; 8086 mode for both - out 0x21,al - dw 0x00eb,0x00eb - out 0xA1,al - dw 0x00eb,0x00eb - mov al,0xFF ; mask off all interrupts for now - out 0x21,al - dw 0x00eb,0x00eb - out 0xA1,al - -; well, that certainly wasn't fun :-(. Hopefully it works, and we don't -; need no steenking BIOS anyway (except for the initial loading :-). -; The BIOS-routine wants lots of unnecessary data, and it's less -; "interesting" anyway. This is how REAL programmers do it. -; -; Well, now's the time to actually move into protected mode. To make -; things as simple as possible, we do no register set-up or anything, -; we let the gnu-compiled 32-bit programs do that. We just jump to -; absolute address 0x00000, in 32-bit protected mode. - - - -; mov ax,0x0001 ; protected mode (PE) bit -; lmsw ax ; This is it; -; jmp 8:0 ; jmp offset 0 of segment 8 (cs) - - -;--ôĻַ - SetDescriptor_Base Code32Desc ,InitKernel + SETUPSEG * 16 - -;-- 򿪵ַA20 - in al, 92h - or al, 00000010b - out 92h, al - - ; ׼лģʽ - mov eax, cr0 - or eax, 1 - mov cr0, eax -;--뱣ģʽ,ʼڱģʽִInitKernel - jmp dword SelectorCode:0 - -; This routine checks that the keyboard command queue is empty -; No timeout is used - if this hangs there is something wrong with -; the machine, and we probably couldn't proceed anyway. -empty_8042: - dw 0x00eb,0x00eb - in al,0x64 ; 8042 status port - test al,2 ; is input buffer full? - jnz empty_8042 ; yes - loop - ret - -gdt: - dw 0,0,0,0 ; dummy - - dw 0x07FF ; 8Mb - limit=2047 (2048*4096=8Mb) - dw 0x0000 ; base address=0 - dw 0x9A00 ; code read/exec - dw 0x00C0 ; granularity=4096, 386 - - dw 0x07FF ; 8Mb - limit=2047 (2048*4096=8Mb) - dw 0x0000 ; base address=0 - dw 0x9200 ; data read/write - dw 0x00C0 ; granularity=4096, 386 -_idt_48: - dw 0 ; idt limit=0 - dw 0,0 ; idt base=0L -_gdt_48: - dw 0x800 ; gdt limit=2048, 256 GDT entries - dw 512+gdt,0x9 ; gdt base = 0X9xxxx - - -[SECTION .s32] -ALIGN 32 -[BITS 32] -InitKernel: - mov ax, SelectorVideo - mov gs, ax - mov ax, SelectorSystemData - mov ds, ax - mov es, ax - mov fs, ax - -;--ں˳ʼ - xor eax,eax - mov [sectionHeader],eax - mov [counter],eax - mov [numberOfSection],eax - - mov eax, SYSTEM_ADDRESS - add eax, [eax+IMAGE_DOS_HEADER.e_lfanew] ;-- õIMAGE_NT_HEADERSṹĻַ - -;--IMAGE_NT_HEADER.FileHeader.NumberOfSections - movzx edx,WORD [eax+IMAGE_NT_HEADERS.FileHeader+IMAGE_FILE_HEADER.NumberOfSections] - mov [numberOfSection],edx - -;--ȡַ - mov edx,[eax+IMAGE_NT_HEADERS.OptionalHeader + IMAGE_OPTIONAL_HEADER32.ImageBase]; - mov [imageBase],edx - - ;--ȡڵַ,ڵַ=imageBase + EntryPoint,ѾһԵַ - mov edx,[eax+IMAGE_NT_HEADERS.OptionalHeader + IMAGE_OPTIONAL_HEADER32.AddressOfEntryPoint]; - add edx,[imageBase] - mov [addressOfEntryPoint],edx - - add eax,IMAGE_NT_HEADERS_size ; - mov [sectionHeader],eax ;IMAGE_SECTION_HEADERĻַ - -LoadData: - mov eax,[counter] - cmp eax, [numberOfSection] - jge SHORT finish - - mov edx,[sectionHeader] - -;--ƶֽ - mov eax,[edx+IMAGE_SECTION_HEADER.SizeOfRawData] - jz next - mov ecx,eax - add [systemSize],ecx - -;--Դַ - mov eax,[edx+IMAGE_SECTION_HEADER.PointerToRawData] - add eax,SYSTEM_ADDRESS - mov esi,eax -;--Ŀַ - mov eax,[edx+IMAGE_SECTION_HEADER.VirtualAddress] - add eax,[imageBase] - mov edi,eax - rep movsb - - mov eax,[sectionHeader] - add eax,IMAGE_SECTION_HEADER_size - mov [sectionHeader],eax - -next: - mov eax, [counter] - inc eax - mov [counter],eax - jmp SHORT LoadData - -finish: - - lgdt [gdt_48]; - lidt [idt_48] - -;--ں!!Ѿ,ʣµľͽLinux-0.11ȥ:) - jmp 8:0 - -SEG_CODE_LEN equ $-InitKernel -[SECTION .data] -[BITS 32] -; λַ , ν , -GDT_TABEL: - dw 0,0,0,0 -NewDescriptor Code32Desc, 0, SEG_CODE_LEN - 1, DA_CR | DA_32 ; -NewDescriptor SystemDesc, 0, 0x90200, DA_DRW | DA_32 ;ݶ -NewDescriptor VideoDesc , 0xB8000, 0x0ffff, DA_DRW | DA_DPL3 ; Դ׵ַ - -gdt_ptr dw gdt_len - 1 ; ν - dd 0x90200 + GDT_TABEL ; ַ - -SelectorCode equ Code32Desc - GDT_TABEL -SelectorSystemData equ SystemDesc - GDT_TABEL -SelectorVideo equ VideoDesc - GDT_TABEL -gdt_len equ $ - GDT_TABEL - -;======================================================== -;ں˳ʼҪõı -numberOfSection equ 0x90100 ;SECTION -sectionHeader equ 0x90104 ;IMAGE_SECTION_HEADER ָ -counter equ 0x90108 ; -addressOfEntryPoint equ 0x9010C ;ں˿ʼִеڵַ -imageBase equ 0x90110 ;ں˼صĻַ -systemSize equ 0x90114 ;ں˼صĻַ - - -gdt_48_offset equ 0x118 -idt_48_offset equ 0x120 - -gdt_48 equ 0x90118 -idt_48 equ 0x90120 - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/setup.bin b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/setup.bin deleted file mode 100644 index 5f7b796..0000000 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/setup.bin and /dev/null differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/setup.disasm b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/setup.disasm deleted file mode 100644 index 8bb7f86..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/boot/setup.disasm +++ /dev/null @@ -1,253 +0,0 @@ -00000000 B80090 mov ax,0x9000 -00000003 8ED8 mov ds,ax -00000005 B403 mov ah,0x3 -00000007 30FF xor bh,bh -00000009 CD10 int 0x10 -0000000B 89160000 mov [0x0],dx -0000000F B488 mov ah,0x88 -00000011 CD15 int 0x15 -00000013 A30200 mov [0x2],ax -00000016 B40F mov ah,0xf -00000018 CD10 int 0x10 -0000001A 891E0400 mov [0x4],bx -0000001E A30600 mov [0x6],ax -00000021 B412 mov ah,0x12 -00000023 B310 mov bl,0x10 -00000025 CD10 int 0x10 -00000027 A30800 mov [0x8],ax -0000002A 891E0A00 mov [0xa],bx -0000002E 890E0C00 mov [0xc],cx -00000032 B80000 mov ax,0x0 -00000035 8ED8 mov ds,ax -00000037 C5360401 lds si,[0x104] -0000003B B80090 mov ax,0x9000 -0000003E 8EC0 mov es,ax -00000040 BF8000 mov di,0x80 -00000043 B91000 mov cx,0x10 -00000046 F3A4 rep movsb -00000048 B80000 mov ax,0x0 -0000004B 8ED8 mov ds,ax -0000004D C5361801 lds si,[0x118] -00000051 B80090 mov ax,0x9000 -00000054 8EC0 mov es,ax -00000056 BF9000 mov di,0x90 -00000059 B91000 mov cx,0x10 -0000005C F3A4 rep movsb -0000005E B80015 mov ax,0x1500 -00000061 B281 mov dl,0x81 -00000063 CD13 int 0x13 -00000065 7205 jc 0x6c -00000067 80FC03 cmp ah,0x3 -0000006A 7410 jz 0x7c -0000006C B80090 mov ax,0x9000 -0000006F 8EC0 mov es,ax -00000071 BF9000 mov di,0x90 -00000074 B91000 mov cx,0x10 -00000077 B80000 mov ax,0x0 -0000007A F3AA rep stosb -0000007C FA cli -0000007D B80010 mov ax,0x1000 -00000080 8ED8 mov ds,ax -00000082 B80050 mov ax,0x5000 -00000085 8EC0 mov es,ax -00000087 FC cld -00000088 29FF sub di,di -0000008A 29F6 sub si,si -0000008C B90080 mov cx,0x8000 -0000008F F3A5 rep movsw -00000091 8CD8 mov ax,ds -00000093 050010 add ax,0x1000 -00000096 3D0050 cmp ax,0x5000 -00000099 740B jz 0xa6 -0000009B 8ED8 mov ds,ax -0000009D 8CC0 mov ax,es -0000009F 050010 add ax,0x1000 -000000A2 8EC0 mov es,ax -000000A4 EBE2 jmp short 0x88 -000000A6 B82090 mov ax,0x9020 -000000A9 8ED8 mov ds,ax -000000AB 66B800900000 mov eax,0x9000 -000000B1 8EC0 mov es,ax -000000B3 B80008 mov ax,0x800 -000000B6 26A31801 mov [es:0x118],ax -000000BA 66B86A030900 mov eax,0x9036a -000000C0 2666C7061A016A03 mov dword [es:0x11a],0x9036a - -0900 -000000CA 6631C0 xor eax,eax -000000CD 26A32001 mov [es:0x120],ax -000000D1 66A32201 mov [0x122],eax -000000D5 0F01167002 lgdt [0x270] -000000DA E88200 call word 0x15f -000000DD B0D1 mov al,0xd1 -000000DF E664 out 0x64,al -000000E1 E87B00 call word 0x15f -000000E4 B0DF mov al,0xdf -000000E6 E660 out 0x60,al -000000E8 E87400 call word 0x15f -000000EB B011 mov al,0x11 -000000ED E620 out 0x20,al -000000EF EB00 jmp short 0xf1 -000000F1 EB00 jmp short 0xf3 -000000F3 E6A0 out 0xa0,al -000000F5 EB00 jmp short 0xf7 -000000F7 EB00 jmp short 0xf9 -000000F9 B020 mov al,0x20 -000000FB E621 out 0x21,al -000000FD EB00 jmp short 0xff -000000FF EB00 jmp short 0x101 -00000101 B028 mov al,0x28 -00000103 E6A1 out 0xa1,al -00000105 EB00 jmp short 0x107 -00000107 EB00 jmp short 0x109 -00000109 B004 mov al,0x4 -0000010B E621 out 0x21,al -0000010D EB00 jmp short 0x10f -0000010F EB00 jmp short 0x111 -00000111 B002 mov al,0x2 -00000113 E6A1 out 0xa1,al -00000115 EB00 jmp short 0x117 -00000117 EB00 jmp short 0x119 -00000119 B001 mov al,0x1 -0000011B E621 out 0x21,al -0000011D EB00 jmp short 0x11f -0000011F EB00 jmp short 0x121 -00000121 E6A1 out 0xa1,al -00000123 EB00 jmp short 0x125 -00000125 EB00 jmp short 0x127 -00000127 B0FF mov al,0xff -00000129 E621 out 0x21,al -0000012B EB00 jmp short 0x12d -0000012D EB00 jmp short 0x12f -0000012F E6A1 out 0xa1,al -00000131 66B890030900 mov eax,0x90390 -00000137 A35A02 mov [0x25a],ax -0000013A 66C1E810 shr eax,0x10 -0000013E A25C02 mov [0x25c],al -00000141 88265F02 mov [0x25f],ah -00000145 E492 in al,0x92 -00000147 0C02 or al,0x2 -00000149 E692 out 0x92,al -0000014B 0F20C0 mov eax,cr0 -0000014E 660D01000000 or eax,0x1 -00000154 0F22C0 mov cr0,eax -00000157 66EA000000000800 jmp dword 0x8:0x0 -0000015F EB00 jmp short 0x161 -00000161 EB00 jmp short 0x163 -00000163 E464 in al,0x64 -00000165 A802 test al,0x2 -00000167 75F6 jnz 0x15f -00000169 C3 ret -0000016A 0000 add [bx+si],al -0000016C 0000 add [bx+si],al -0000016E 0000 add [bx+si],al -00000170 0000 add [bx+si],al -00000172 FF07 inc word [bx] -00000174 0000 add [bx+si],al -00000176 009AC000 add [bp+si+0xc0],bl -0000017A FF07 inc word [bx] -0000017C 0000 add [bx+si],al -0000017E 0092C000 add [bp+si+0xc0],dl -00000182 0000 add [bx+si],al -00000184 0000 add [bx+si],al -00000186 0000 add [bx+si],al -00000188 0008 add [bx+si],cl -0000018A 6A03 push byte +0x3 -0000018C 0900 or [bx+si],ax -0000018E 0000 add [bx+si],al -00000190 66B818008EE8 mov eax,0xe88e0018 -00000196 66B810008ED8 mov eax,0xd88e0010 -0000019C 8EC0 mov es,ax -0000019E 8EE0 mov fs,ax -000001A0 31C0 xor ax,ax -000001A2 A30401 mov [0x104],ax -000001A5 0900 or [bx+si],ax -000001A7 A30801 mov [0x108],ax -000001AA 0900 or [bx+si],ax -000001AC A30001 mov [0x100],ax -000001AF 0900 or [bx+si],ax -000001B1 B80000 mov ax,0x0 -000001B4 050003 add ax,0x300 -000001B7 40 inc ax -000001B8 3C0F cmp al,0xf -000001BA B750 mov bh,0x50 -000001BC 06 push es -000001BD 8915 mov [di],dx -000001BF 0001 add [bx+di],al -000001C1 0900 or [bx+si],ax -000001C3 8B5034 mov dx,[bx+si+0x34] -000001C6 8915 mov [di],dx -000001C8 1001 adc [bx+di],al -000001CA 0900 or [bx+si],ax -000001CC 8B5028 mov dx,[bx+si+0x28] -000001CF 0315 add dx,[di] -000001D1 1001 adc [bx+di],al -000001D3 0900 or [bx+si],ax -000001D5 8915 mov [di],dx -000001D7 0C01 or al,0x1 -000001D9 0900 or [bx+si],ax -000001DB 05F800 add ax,0xf8 -000001DE 0000 add [bx+si],al -000001E0 A30401 mov [0x104],ax -000001E3 0900 or [bx+si],ax -000001E5 A10801 mov ax,[0x108] -000001E8 0900 or [bx+si],ax -000001EA 3B05 cmp ax,[di] -000001EC 0001 add [bx+di],al -000001EE 0900 or [bx+si],ax -000001F0 7D46 jnl 0x238 -000001F2 8B15 mov dx,[di] -000001F4 0401 add al,0x1 -000001F6 0900 or [bx+si],ax -000001F8 8B4210 mov ax,[bp+si+0x10] -000001FB 742E jz 0x22b -000001FD 89C1 mov cx,ax -000001FF 010D add [di],cx -00000201 1401 adc al,0x1 -00000203 0900 or [bx+si],ax -00000205 8B4214 mov ax,[bp+si+0x14] -00000208 050000 add ax,0x0 -0000020B 050089 add ax,0x8900 -0000020E C6 db 0xC6 -0000020F 8B420C mov ax,[bp+si+0xc] -00000212 0305 add ax,[di] -00000214 1001 adc [bx+di],al -00000216 0900 or [bx+si],ax -00000218 89C7 mov di,ax -0000021A F3A4 rep movsb -0000021C A10401 mov ax,[0x104] -0000021F 0900 or [bx+si],ax -00000221 052800 add ax,0x28 -00000224 0000 add [bx+si],al -00000226 A30401 mov [0x104],ax -00000229 0900 or [bx+si],ax -0000022B A10801 mov ax,[0x108] -0000022E 0900 or [bx+si],ax -00000230 40 inc ax -00000231 A30801 mov [0x108],ax -00000234 0900 or [bx+si],ax -00000236 EBAD jmp short 0x1e5 -00000238 0F0115 lgdt [di] -0000023B 1801 sbb [bx+di],al -0000023D 0900 or [bx+si],ax -0000023F 0F011D lidt [di] -00000242 2001 and [bx+di],al -00000244 0900 or [bx+si],ax -00000246 EA00000000 jmp word 0x0:0x0 -0000024B 0800 or [bx+si],al -0000024D 0000 add [bx+si],al -0000024F 0000 add [bx+si],al -00000251 0000 add [bx+si],al -00000253 0000 add [bx+si],al -00000255 0000 add [bx+si],al -00000257 00BC0000 add [si+0x0],bh -0000025B 0000 add [bx+si],al -0000025D 9ADA000002 call word 0x200:0xda -00000262 0000 add [bx+si],al -00000264 0092DB00 add [bp+si+0xdb],dl -00000268 FF db 0xFF -00000269 FF00 inc word [bx+si] -0000026B 800BF2 or byte [bp+di],0xf2 -0000026E 92 xchg ax,dx -0000026F 0025 add [di],ah -00000271 005004 add [bx+si+0x4],dl -00000274 0900 or [bx+si],ax diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/Makefile b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/Makefile deleted file mode 100644 index 593a922..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/Makefile +++ /dev/null @@ -1,100 +0,0 @@ -AR =ar -AS =as -CC =gcc -mcpu=i386 -LD =ld -CFLAGS =-Wall -fstrength-reduce -fomit-frame-pointer \ - -nostdinc -I../include -CPP =gcc -E -nostdinc -I../include - -.c.s: - $(CC) $(CFLAGS) \ - -S -o $*.s $< -.c.o: - $(CC) $(CFLAGS) \ - -c -o $*.o $< -.s.o: - $(AS) -o $*.o $< - -OBJS= open.o read_write.o inode.o file_table.o buffer.o super.o \ - block_dev.o char_dev.o file_dev.o stat.o exec.o pipe.o namei.o \ - bitmap.o fcntl.o ioctl.o truncate.o - -fs.o: $(OBJS) - $(LD) -r -o fs.o $(OBJS) - -clean: - rm -f core *.o *.a tmp_make - for i in *.c;do rm -f `basename $$i .c`.s;done - -dep: - sed '/\#\#\# Dependencies/q' < Makefile > tmp_make - (for i in *.c;do $(CPP) -M $$i;done) >> tmp_make - cp tmp_make Makefile - -### Dependencies: -bitmap.o: bitmap.c ../include/string.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/fs.h ../include/sys/types.h \ - ../include/linux/mm.h ../include/signal.h ../include/linux/kernel.h -block_dev.o: block_dev.c ../include/errno.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/fs.h ../include/sys/types.h \ - ../include/linux/mm.h ../include/signal.h ../include/linux/kernel.h \ - ../include/asm/segment.h ../include/asm/system.h -buffer.o: buffer.c ../include/stdarg.h ../include/linux/config.h \ - ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \ - ../include/sys/types.h ../include/linux/mm.h ../include/signal.h \ - ../include/linux/kernel.h ../include/asm/system.h ../include/asm/io.h -char_dev.o: char_dev.c ../include/errno.h ../include/sys/types.h \ - ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \ - ../include/linux/mm.h ../include/signal.h ../include/linux/kernel.h \ - ../include/asm/segment.h ../include/asm/io.h -exec.o: exec.c ../include/errno.h ../include/string.h \ - ../include/sys/stat.h ../include/sys/types.h ../include/a.out.h \ - ../include/linux/fs.h ../include/linux/sched.h ../include/linux/head.h \ - ../include/linux/mm.h ../include/signal.h ../include/linux/kernel.h \ - ../include/asm/segment.h -fcntl.o: fcntl.c ../include/string.h ../include/errno.h \ - ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \ - ../include/sys/types.h ../include/linux/mm.h ../include/signal.h \ - ../include/linux/kernel.h ../include/asm/segment.h ../include/fcntl.h \ - ../include/sys/stat.h -file_dev.o: file_dev.c ../include/errno.h ../include/fcntl.h \ - ../include/sys/types.h ../include/linux/sched.h ../include/linux/head.h \ - ../include/linux/fs.h ../include/linux/mm.h ../include/signal.h \ - ../include/linux/kernel.h ../include/asm/segment.h -file_table.o: file_table.c ../include/linux/fs.h ../include/sys/types.h -inode.o: inode.c ../include/string.h ../include/sys/stat.h \ - ../include/sys/types.h ../include/linux/sched.h ../include/linux/head.h \ - ../include/linux/fs.h ../include/linux/mm.h ../include/signal.h \ - ../include/linux/kernel.h ../include/asm/system.h -ioctl.o: ioctl.c ../include/string.h ../include/errno.h \ - ../include/sys/stat.h ../include/sys/types.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/fs.h ../include/linux/mm.h \ - ../include/signal.h -namei.o: namei.c ../include/linux/sched.h ../include/linux/head.h \ - ../include/linux/fs.h ../include/sys/types.h ../include/linux/mm.h \ - ../include/signal.h ../include/linux/kernel.h ../include/asm/segment.h \ - ../include/string.h ../include/fcntl.h ../include/errno.h \ - ../include/const.h ../include/sys/stat.h -open.o: open.c ../include/string.h ../include/errno.h ../include/fcntl.h \ - ../include/sys/types.h ../include/utime.h ../include/sys/stat.h \ - ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \ - ../include/linux/mm.h ../include/signal.h ../include/linux/tty.h \ - ../include/termios.h ../include/linux/kernel.h ../include/asm/segment.h -pipe.o: pipe.c ../include/signal.h ../include/sys/types.h \ - ../include/linux/sched.h ../include/linux/head.h ../include/linux/fs.h \ - ../include/linux/mm.h ../include/asm/segment.h -read_write.o: read_write.c ../include/sys/stat.h ../include/sys/types.h \ - ../include/errno.h ../include/linux/kernel.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/fs.h ../include/linux/mm.h \ - ../include/signal.h ../include/asm/segment.h -stat.o: stat.c ../include/errno.h ../include/sys/stat.h \ - ../include/sys/types.h ../include/linux/fs.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/mm.h ../include/signal.h \ - ../include/linux/kernel.h ../include/asm/segment.h -super.o: super.c ../include/linux/config.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/fs.h ../include/sys/types.h \ - ../include/linux/mm.h ../include/signal.h ../include/linux/kernel.h \ - ../include/asm/system.h ../include/errno.h ../include/sys/stat.h -truncate.o: truncate.c ../include/linux/sched.h ../include/linux/head.h \ - ../include/linux/fs.h ../include/sys/types.h ../include/linux/mm.h \ - ../include/signal.h ../include/sys/stat.h diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/bitmap.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/bitmap.c deleted file mode 100644 index fb0741d..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/bitmap.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - * linux/fs/bitmap.c - * - * (C) 1991 Linus Torvalds - */ - -/* bitmap.c contains the code that handles the inode and block bitmaps */ -#include - -#include -#include - -#define clear_block(addr) \ -__asm__ __volatile__ ("cld\n\t" \ - "rep\n\t" \ - "stosl" \ - ::"a" (0),"c" (BLOCK_SIZE/4),"D" ((long) (addr))) - -#define set_bit(nr,addr) ({\ -register int res ; \ -__asm__ __volatile__("btsl %2,%3\n\tsetb %%al": \ -"=a" (res):"0" (0),"r" (nr),"m" (*(addr))); \ -res;}) - -#define clear_bit(nr,addr) ({\ -register int res ; \ -__asm__ __volatile__("btrl %2,%3\n\tsetnb %%al": \ -"=a" (res):"0" (0),"r" (nr),"m" (*(addr))); \ -res;}) - -#define find_first_zero(addr) ({ \ -int __res; \ -__asm__ __volatile__ ("cld\n" \ - "1:\tlodsl\n\t" \ - "notl %%eax\n\t" \ - "bsfl %%eax,%%edx\n\t" \ - "je 2f\n\t" \ - "addl %%edx,%%ecx\n\t" \ - "jmp 3f\n" \ - "2:\taddl $32,%%ecx\n\t" \ - "cmpl $8192,%%ecx\n\t" \ - "jl 1b\n" \ - "3:" \ - :"=c" (__res):"c" (0),"S" (addr)); \ -__res;}) - -void free_block(int dev, int block) -{ - struct super_block * sb; - struct buffer_head * bh; - - if (!(sb = get_super(dev))) - panic("trying to free block on nonexistent device"); - if (block < sb->s_firstdatazone || block >= sb->s_nzones) - panic("trying to free block not in datazone"); - bh = get_hash_table(dev,block); - if (bh) { - if (bh->b_count != 1) { - printk("trying to free block (%04x:%d), count=%d\n", - dev,block,bh->b_count); - return; - } - bh->b_dirt=0; - bh->b_uptodate=0; - brelse(bh); - } - block -= sb->s_firstdatazone - 1 ; - if (clear_bit(block&8191,sb->s_zmap[block/8192]->b_data)) { - printk("block (%04x:%d) ",dev,block+sb->s_firstdatazone-1); - panic("free_block: bit already cleared"); - } - sb->s_zmap[block/8192]->b_dirt = 1; -} - -int new_block(int dev) -{ - struct buffer_head * bh; - struct super_block * sb; - int i,j; - - if (!(sb = get_super(dev))) - panic("trying to get new block from nonexistant device"); - j = 8192; - for (i=0 ; i<8 ; i++) - if ((bh=sb->s_zmap[i])) - if ((j=find_first_zero(bh->b_data))<8192) - break; - if (i>=8 || !bh || j>=8192) - return 0; - if (set_bit(j,bh->b_data)) - panic("new_block: bit already set"); - bh->b_dirt = 1; - j += i*8192 + sb->s_firstdatazone-1; - if (j >= sb->s_nzones) - return 0; - if (!(bh=getblk(dev,j))) - panic("new_block: cannot get block"); - if (bh->b_count != 1) - panic("new block: count is != 1"); - clear_block(bh->b_data); - bh->b_uptodate = 1; - bh->b_dirt = 1; - brelse(bh); - return j; -} - -void free_inode(struct m_inode * inode) -{ - struct super_block * sb; - struct buffer_head * bh; - - if (!inode) - return; - if (!inode->i_dev) { - memset(inode,0,sizeof(*inode)); - return; - } - if (inode->i_count>1) { - printk("trying to free inode with count=%d\n",inode->i_count); - panic("free_inode"); - } - if (inode->i_nlinks) - panic("trying to free inode with links"); - if (!(sb = get_super(inode->i_dev))) - panic("trying to free inode on nonexistent device"); - if (inode->i_num < 1 || inode->i_num > sb->s_ninodes) - panic("trying to free inode 0 or nonexistant inode"); - if (!(bh=sb->s_imap[inode->i_num>>13])) - panic("nonexistent imap in superblock"); - if (clear_bit(inode->i_num&8191,bh->b_data)) - printk("free_inode: bit already cleared.\n\r"); - bh->b_dirt = 1; - memset(inode,0,sizeof(*inode)); -} - -struct m_inode * new_inode(int dev) -{ - struct m_inode * inode; - struct super_block * sb; - struct buffer_head * bh; - int i,j; - - if (!(inode=get_empty_inode())) - return NULL; - if (!(sb = get_super(dev))) - panic("new_inode with unknown device"); - j = 8192; - for (i=0 ; i<8 ; i++) - if ((bh=sb->s_imap[i])) - if ((j=find_first_zero(bh->b_data))<8192) - break; - if (!bh || j >= 8192 || j+i*8192 > sb->s_ninodes) { - iput(inode); - return NULL; - } - if (set_bit(j,bh->b_data)) - panic("new_inode: bit already set"); - bh->b_dirt = 1; - inode->i_count=1; - inode->i_nlinks=1; - inode->i_dev=dev; - inode->i_uid=current->euid; - inode->i_gid=current->egid; - inode->i_dirt=1; - inode->i_num = j + i*8192; - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; - return inode; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/block_dev.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/block_dev.c deleted file mode 100644 index a50ae3f..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/block_dev.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * linux/fs/block_dev.c - * - * (C) 1991 Linus Torvalds - */ - -#include - -#include -#include -#include -#include - -int block_write(int dev, long * pos, char * buf, int count) -{ - int block = *pos >> BLOCK_SIZE_BITS; - int offset = *pos & (BLOCK_SIZE-1); - int chars; - int written = 0; - struct buffer_head * bh; - register char * p; - - while (count>0) { - chars = BLOCK_SIZE - offset; - if (chars > count) - chars=count; - if (chars == BLOCK_SIZE) - bh = getblk(dev,block); - else - bh = breada(dev,block,block+1,block+2,-1); - block++; - if (!bh) - return written?written:-EIO; - p = offset + bh->b_data; - offset = 0; - *pos += chars; - written += chars; - count -= chars; - while (chars-->0) - *(p++) = get_fs_byte(buf++); - bh->b_dirt = 1; - brelse(bh); - } - return written; -} - -int block_read(int dev, unsigned long * pos, char * buf, int count) -{ - int block = *pos >> BLOCK_SIZE_BITS; - int offset = *pos & (BLOCK_SIZE-1); - int chars; - int read = 0; - struct buffer_head * bh; - register char * p; - - while (count>0) { - chars = BLOCK_SIZE-offset; - if (chars > count) - chars = count; - if (!(bh = breada(dev,block,block+1,block+2,-1))) - return read?read:-EIO; - block++; - p = offset + bh->b_data; - offset = 0; - *pos += chars; - read += chars; - count -= chars; - while (chars-->0) - put_fs_byte(*(p++),buf++); - brelse(bh); - } - return read; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/buffer.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/buffer.c deleted file mode 100644 index 47c5a4d..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/buffer.c +++ /dev/null @@ -1,384 +0,0 @@ -/* - * linux/fs/buffer.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * 'buffer.c' implements the buffer-cache functions. Race-conditions have - * been avoided by NEVER letting a interrupt change a buffer (except for the - * data, of course), but instead letting the caller do it. NOTE! As interrupts - * can wake up a caller, some cli-sti sequences are needed to check for - * sleep-on-calls. These should be extremely quick, though (I hope). - */ - -/* - * NOTE! There is one discordant note here: checking floppies for - * disk change. This is where it fits best, I think, as it should - * invalidate changed floppy-disk-caches. - */ - -#include - -#include -#include -#include -#include -#include - -extern int end; -extern void put_super(int); -extern void invalidate_inodes(int); - -struct buffer_head * start_buffer = (struct buffer_head *) &end; -struct buffer_head * hash_table[NR_HASH]; -static struct buffer_head * free_list; -static struct task_struct * buffer_wait = NULL; -int NR_BUFFERS = 0; - -static inline void wait_on_buffer(struct buffer_head * bh) -{ - cli(); - while (bh->b_lock) - sleep_on(&bh->b_wait); - sti(); -} - -int sys_sync(void) -{ - int i; - struct buffer_head * bh; - - sync_inodes(); /* write out inodes into buffers */ - bh = start_buffer; - for (i=0 ; ib_dirt) - ll_rw_block(WRITE,bh); - } - return 0; -} - -int sync_dev(int dev) -{ - int i; - struct buffer_head * bh; - - bh = start_buffer; - for (i=0 ; ib_dev != dev) - continue; - wait_on_buffer(bh); - if (bh->b_dev == dev && bh->b_dirt) - ll_rw_block(WRITE,bh); - } - sync_inodes(); - bh = start_buffer; - for (i=0 ; ib_dev != dev) - continue; - wait_on_buffer(bh); - if (bh->b_dev == dev && bh->b_dirt) - ll_rw_block(WRITE,bh); - } - return 0; -} - -void inline invalidate_buffers(int dev) -{ - int i; - struct buffer_head * bh; - - bh = start_buffer; - for (i=0 ; ib_dev != dev) - continue; - wait_on_buffer(bh); - if (bh->b_dev == dev) - bh->b_uptodate = bh->b_dirt = 0; - } -} - -/* - * This routine checks whether a floppy has been changed, and - * invalidates all buffer-cache-entries in that case. This - * is a relatively slow routine, so we have to try to minimize using - * it. Thus it is called only upon a 'mount' or 'open'. This - * is the best way of combining speed and utility, I think. - * People changing diskettes in the middle of an operation deserve - * to loose :-) - * - * NOTE! Although currently this is only for floppies, the idea is - * that any additional removable block-device will use this routine, - * and that mount/open needn't know that floppies/whatever are - * special. - */ -void check_disk_change(int dev) -{ - int i; - - if (MAJOR(dev) != 2) - return; - if (!floppy_change(dev & 0x03)) - return; - for (i=0 ; ib_next) - bh->b_next->b_prev = bh->b_prev; - if (bh->b_prev) - bh->b_prev->b_next = bh->b_next; - if (hash(bh->b_dev,bh->b_blocknr) == bh) - hash(bh->b_dev,bh->b_blocknr) = bh->b_next; -/* remove from free list */ - if (!(bh->b_prev_free) || !(bh->b_next_free)) - panic("Free block list corrupted"); - bh->b_prev_free->b_next_free = bh->b_next_free; - bh->b_next_free->b_prev_free = bh->b_prev_free; - if (free_list == bh) - free_list = bh->b_next_free; -} - -static inline void insert_into_queues(struct buffer_head * bh) -{ -/* put at end of free list */ - bh->b_next_free = free_list; - bh->b_prev_free = free_list->b_prev_free; - free_list->b_prev_free->b_next_free = bh; - free_list->b_prev_free = bh; -/* put the buffer in new hash-queue if it has a device */ - bh->b_prev = NULL; - bh->b_next = NULL; - if (!bh->b_dev) - return; - bh->b_next = hash(bh->b_dev,bh->b_blocknr); - hash(bh->b_dev,bh->b_blocknr) = bh; - bh->b_next->b_prev = bh; -} - -static struct buffer_head * find_buffer(int dev, int block) -{ - struct buffer_head * tmp; - - for (tmp = hash(dev,block) ; tmp != NULL ; tmp = tmp->b_next) - if (tmp->b_dev==dev && tmp->b_blocknr==block) - return tmp; - return NULL; -} - -/* - * Why like this, I hear you say... The reason is race-conditions. - * As we don't lock buffers (unless we are readint them, that is), - * something might happen to it while we sleep (ie a read-error - * will force it bad). This shouldn't really happen currently, but - * the code is ready. - */ -struct buffer_head * get_hash_table(int dev, int block) -{ - struct buffer_head * bh; - - for (;;) { - if (!(bh=find_buffer(dev,block))) - return NULL; - bh->b_count++; - wait_on_buffer(bh); - if (bh->b_dev == dev && bh->b_blocknr == block) - return bh; - bh->b_count--; - } -} - -/* - * Ok, this is getblk, and it isn't very clear, again to hinder - * race-conditions. Most of the code is seldom used, (ie repeating), - * so it should be much more efficient than it looks. - * - * The algoritm is changed: hopefully better, and an elusive bug removed. - */ -#define BADNESS(bh) (((bh)->b_dirt<<1)+(bh)->b_lock) -struct buffer_head * getblk(int dev,int block) -{ - struct buffer_head * tmp, * bh; - -repeat: - if ((bh = get_hash_table(dev,block))) - return bh; - tmp = free_list; - do { - if (tmp->b_count) - continue; - if (!bh || BADNESS(tmp)b_next_free) != free_list); - if (!bh) { - sleep_on(&buffer_wait); - goto repeat; - } - wait_on_buffer(bh); - if (bh->b_count) - goto repeat; - while (bh->b_dirt) { - sync_dev(bh->b_dev); - wait_on_buffer(bh); - if (bh->b_count) - goto repeat; - } -/* NOTE!! While we slept waiting for this block, somebody else might */ -/* already have added "this" block to the cache. check it */ - if (find_buffer(dev,block)) - goto repeat; -/* OK, FINALLY we know that this buffer is the only one of it's kind, */ -/* and that it's unused (b_count=0), unlocked (b_lock=0), and clean */ - bh->b_count=1; - bh->b_dirt=0; - bh->b_uptodate=0; - remove_from_queues(bh); - bh->b_dev=dev; - bh->b_blocknr=block; - insert_into_queues(bh); - return bh; -} - -void brelse(struct buffer_head * buf) -{ - if (!buf) - return; - wait_on_buffer(buf); - if (!(buf->b_count--)) - panic("Trying to free free buffer"); - wake_up(&buffer_wait); -} - -/* - * bread() reads a specified block and returns the buffer that contains - * it. It returns NULL if the block was unreadable. - */ -struct buffer_head * bread(int dev,int block) -{ - struct buffer_head * bh; - - if (!(bh=getblk(dev,block))) - panic("bread: getblk returned NULL\n"); - if (bh->b_uptodate) - return bh; - ll_rw_block(READ,bh); - wait_on_buffer(bh); - if (bh->b_uptodate) - return bh; - brelse(bh); - return NULL; -} - -#define COPYBLK(from,to) \ -__asm__("cld\n\t" \ - "rep\n\t" \ - "movsl\n\t" \ - ::"c" (BLOCK_SIZE/4),"S" (from),"D" (to) \ - ) - -/* - * bread_page reads four buffers into memory at the desired address. It's - * a function of its own, as there is some speed to be got by reading them - * all at the same time, not waiting for one to be read, and then another - * etc. - */ -void bread_page(unsigned long address,int dev,int b[4]) -{ - struct buffer_head * bh[4]; - int i; - - for (i=0 ; i<4 ; i++) - if (b[i]) { - if ((bh[i] = getblk(dev,b[i]))) - if (!bh[i]->b_uptodate) - ll_rw_block(READ,bh[i]); - } else - bh[i] = NULL; - for (i=0 ; i<4 ; i++,address += BLOCK_SIZE) - if (bh[i]) { - wait_on_buffer(bh[i]); - if (bh[i]->b_uptodate) - COPYBLK((unsigned long) bh[i]->b_data,address); - brelse(bh[i]); - } -} - -/* - * Ok, breada can be used as bread, but additionally to mark other - * blocks for reading as well. End the argument list with a negative - * number. - */ -struct buffer_head * breada(int dev,int first, ...) -{ - va_list args; - struct buffer_head * bh, *tmp; - - va_start(args,first); - if (!(bh=getblk(dev,first))) - panic("bread: getblk returned NULL\n"); - if (!bh->b_uptodate) - ll_rw_block(READ,bh); - while ((first=va_arg(args,int))>=0) { - tmp=getblk(dev,first); - if (tmp) { - if (!tmp->b_uptodate) - ll_rw_block(READA,bh); - tmp->b_count--; - } - } - va_end(args); - wait_on_buffer(bh); - if (bh->b_uptodate) - return bh; - brelse(bh); - return (NULL); -} - -void buffer_init(long buffer_end) -{ - struct buffer_head * h = start_buffer; - void * b; - int i; - - if (buffer_end == 1<<20) - b = (void *) (640*1024); - else - b = (void *) buffer_end; - while ( (b -= BLOCK_SIZE) >= ((void *) (h+1)) ) { - h->b_dev = 0; - h->b_dirt = 0; - h->b_count = 0; - h->b_lock = 0; - h->b_uptodate = 0; - h->b_wait = NULL; - h->b_next = NULL; - h->b_prev = NULL; - h->b_data = (char *) b; - h->b_prev_free = h-1; - h->b_next_free = h+1; - h++; - NR_BUFFERS++; - if (b == (void *) 0x100000) - b = (void *) 0xA0000; - } - h--; - free_list = start_buffer; - free_list->b_prev_free = h; - h->b_next_free = free_list; - for (i=0;i -#include - -#include -#include - -#include -#include - -extern int tty_read(unsigned minor,char * buf,int count); -extern int tty_write(unsigned minor,char * buf,int count); - -typedef int (*crw_ptr)(int rw,unsigned minor,char * buf,int count,off_t * pos); - -static int rw_ttyx(int rw,unsigned minor,char * buf,int count,off_t * pos) -{ - return ((rw==READ)?tty_read(minor,buf,count): - tty_write(minor,buf,count)); -} - -static int rw_tty(int rw,unsigned minor,char * buf,int count, off_t * pos) -{ - if (current->tty<0) - return -EPERM; - return rw_ttyx(rw,current->tty,buf,count,pos); -} - -static int rw_ram(int rw,char * buf, int count, off_t *pos) -{ - return -EIO; -} - -static int rw_mem(int rw,char * buf, int count, off_t * pos) -{ - return -EIO; -} - -static int rw_kmem(int rw,char * buf, int count, off_t * pos) -{ - return -EIO; -} - -static int rw_port(int rw,char * buf, int count, off_t * pos) -{ - int i=*pos; - - while (count-->0 && i<65536) { - if (rw==READ) - put_fs_byte(inb(i),buf++); - else - outb(get_fs_byte(buf++),i); - i++; - } - i -= *pos; - *pos += i; - return i; -} - -static int rw_memory(int rw, unsigned minor, char * buf, int count, off_t * pos) -{ - switch(minor) { - case 0: - return rw_ram(rw,buf,count,pos); - case 1: - return rw_mem(rw,buf,count,pos); - case 2: - return rw_kmem(rw,buf,count,pos); - case 3: - return (rw==READ)?0:count; /* rw_null */ - case 4: - return rw_port(rw,buf,count,pos); - default: - return -EIO; - } -} - -#define NRDEVS ((sizeof (crw_table))/(sizeof (crw_ptr))) - -static crw_ptr crw_table[]={ - NULL, /* nodev */ - rw_memory, /* /dev/mem etc */ - NULL, /* /dev/fd */ - NULL, /* /dev/hd */ - rw_ttyx, /* /dev/ttyx */ - rw_tty, /* /dev/tty */ - NULL, /* /dev/lp */ - NULL}; /* unnamed pipes */ - -int rw_char(int rw,int dev, char * buf, int count, off_t * pos) -{ - crw_ptr call_addr; - - if (MAJOR(dev)>=NRDEVS) - return -ENODEV; - if (!(call_addr=crw_table[MAJOR(dev)])) - return -ENODEV; - return call_addr(rw,MINOR(dev),buf,count,pos); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/exec.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/exec.c deleted file mode 100644 index c1b6a29..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/exec.c +++ /dev/null @@ -1,353 +0,0 @@ -/* - * linux/fs/exec.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * #!-checking implemented by tytso. - */ - -/* - * Demand-loading implemented 01.12.91 - no need to read anything but - * the header into memory. The inode of the executable is put into - * "current->executable", and page faults do the actual loading. Clean. - * - * Once more I can proudly say that linux stood up to being changed: it - * was less than 2 hours work to get demand-loading completely implemented. - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -extern int sys_exit(int exit_code); -extern int sys_close(int fd); - -/* - * MAX_ARG_PAGES defines the number of pages allocated for arguments - * and envelope for the new program. 32 should suffice, this gives - * a maximum env+arg of 128kB ! - */ -#define MAX_ARG_PAGES 32 - -/* - * create_tables() parses the env- and arg-strings in new user - * memory and creates the pointer tables from them, and puts their - * addresses on the "stack", returning the new stack pointer value. - */ -static unsigned long * create_tables(char * p,int argc,int envc) -{ - unsigned long *argv,*envp; - unsigned long * sp; - - sp = (unsigned long *) (0xfffffffc & (unsigned long) p); - sp -= envc+1; - envp = sp; - sp -= argc+1; - argv = sp; - put_fs_long((unsigned long)envp,--sp); - put_fs_long((unsigned long)argv,--sp); - put_fs_long((unsigned long)argc,--sp); - while (argc-->0) { - put_fs_long((unsigned long) p,argv++); - while (get_fs_byte(p++)) /* nothing */ ; - } - put_fs_long(0,argv); - while (envc-->0) { - put_fs_long((unsigned long) p,envp++); - while (get_fs_byte(p++)) /* nothing */ ; - } - put_fs_long(0,envp); - return sp; -} - -/* - * count() counts the number of arguments/envelopes - */ -static int count(char ** argv) -{ - int i=0; - char ** tmp; - - if ((tmp = argv)) - while (get_fs_long((unsigned long *) (tmp++))) - i++; - - return i; -} - -/* - * 'copy_string()' copies argument/envelope strings from user - * memory to free pages in kernel mem. These are in a format ready - * to be put directly into the top of new user memory. - * - * Modified by TYT, 11/24/91 to add the from_kmem argument, which specifies - * whether the string and the string array are from user or kernel segments: - * - * from_kmem argv * argv ** - * 0 user space user space - * 1 kernel space user space - * 2 kernel space kernel space - * - * We do this by playing games with the fs segment register. Since it - * it is expensive to load a segment register, we try to avoid calling - * set_fs() unless we absolutely have to. - */ -static unsigned long copy_strings(int argc,char ** argv,unsigned long *page, - unsigned long p, int from_kmem) -{ - char *tmp, *pag=NULL; - int len, offset = 0; - unsigned long old_fs, new_fs; - - if (!p) - return 0; /* bullet-proofing */ - new_fs = get_ds(); - old_fs = get_fs(); - if (from_kmem==2) - set_fs(new_fs); - while (argc-- > 0) { - if (from_kmem == 1) - set_fs(new_fs); - if (!(tmp = (char *)get_fs_long(((unsigned long *)argv)+argc))) - panic("argc is wrong"); - if (from_kmem == 1) - set_fs(old_fs); - len=0; /* remember zero-padding */ - do { - len++; - } while (get_fs_byte(tmp++)); - if (p-len < 0) { /* this shouldn't happen - 128kB */ - set_fs(old_fs); - return 0; - } - while (len) { - --p; --tmp; --len; - if (--offset < 0) { - offset = p % PAGE_SIZE; - if (from_kmem==2) - set_fs(old_fs); - if (!(pag = (char *) page[p/PAGE_SIZE]) && - !(pag = (char *) page[p/PAGE_SIZE] = - (unsigned long *) get_free_page())) - return 0; - if (from_kmem==2) - set_fs(new_fs); - - } - *(pag + offset) = get_fs_byte(tmp); - } - } - if (from_kmem==2) - set_fs(old_fs); - return p; -} - -static unsigned long change_ldt(unsigned long text_size,unsigned long * page) -{ - unsigned long code_limit,data_limit,code_base,data_base; - int i; - - code_limit = text_size+PAGE_SIZE -1; - code_limit &= 0xFFFFF000; - data_limit = 0x4000000; - code_base = get_base(current->ldt[1]); - data_base = code_base; - set_base(current->ldt[1],code_base); - set_limit(current->ldt[1],code_limit); - set_base(current->ldt[2],data_base); - set_limit(current->ldt[2],data_limit); -/* make sure fs points to the NEW data segment */ - __asm__("pushl $0x17\n\tpop %%fs"::); - data_base += data_limit; - for (i=MAX_ARG_PAGES-1 ; i>=0 ; i--) { - data_base -= PAGE_SIZE; - if (page[i]) - put_page(page[i],data_base); - } - return data_limit; -} - -/* - * 'do_execve()' executes a new program. - */ -int do_execve(unsigned long * eip,long tmp,char * filename, - char ** argv, char ** envp) -{ - struct m_inode * inode; - struct buffer_head * bh; - struct exec ex; - unsigned long page[MAX_ARG_PAGES]; - int i,argc,envc; - int e_uid, e_gid; - int retval; - int sh_bang = 0; - unsigned long p=PAGE_SIZE*MAX_ARG_PAGES-4; - - if ((0xffff & eip[1]) != 0x000f) - panic("execve called from supervisor mode"); - for (i=0 ; ii_mode)) { /* must be regular file */ - retval = -EACCES; - goto exec_error2; - } - i = inode->i_mode; - e_uid = (i & S_ISUID) ? inode->i_uid : current->euid; - e_gid = (i & S_ISGID) ? inode->i_gid : current->egid; - if (current->euid == inode->i_uid) - i >>= 6; - else if (current->egid == inode->i_gid) - i >>= 3; - if (!(i & 1) && - !((inode->i_mode & 0111) && suser())) { - retval = -ENOEXEC; - goto exec_error2; - } - if (!(bh = bread(inode->i_dev,inode->i_zone[0]))) { - retval = -EACCES; - goto exec_error2; - } - ex = *((struct exec *) bh->b_data); /* read exec-header */ - if ((bh->b_data[0] == '#') && (bh->b_data[1] == '!') && (!sh_bang)) { - /* - * This section does the #! interpretation. - * Sorta complicated, but hopefully it will work. -TYT - */ - - char buf[1023], *cp, *interp, *i_name, *i_arg; - unsigned long old_fs; - - strncpy(buf, bh->b_data+2, 1022); - brelse(bh); - iput(inode); - buf[1022] = '\0'; - if ((cp = strchr(buf, '\n'))) { - *cp = '\0'; - for (cp = buf; (*cp == ' ') || (*cp == '\t'); cp++); - } - if (!cp || *cp == '\0') { - retval = -ENOEXEC; /* No interpreter name found */ - goto exec_error1; - } - interp = i_name = cp; - i_arg = 0; - for ( ; *cp && (*cp != ' ') && (*cp != '\t'); cp++) { - if (*cp == '/') - i_name = cp+1; - } - if (*cp) { - *cp++ = '\0'; - i_arg = cp; - } - /* - * OK, we've parsed out the interpreter name and - * (optional) argument. - */ - if (sh_bang++ == 0) { - p = copy_strings(envc, envp, page, p, 0); - p = copy_strings(--argc, argv+1, page, p, 0); - } - /* - * Splice in (1) the interpreter's name for argv[0] - * (2) (optional) argument to interpreter - * (3) filename of shell script - * - * This is done in reverse order, because of how the - * user environment and arguments are stored. - */ - p = copy_strings(1, &filename, page, p, 1); - argc++; - if (i_arg) { - p = copy_strings(1, &i_arg, page, p, 2); - argc++; - } - p = copy_strings(1, &i_name, page, p, 2); - argc++; - if (!p) { - retval = -ENOMEM; - goto exec_error1; - } - /* - * OK, now restart the process with the interpreter's inode. - */ - old_fs = get_fs(); - set_fs(get_ds()); - if (!(inode=namei(interp))) { /* get executables inode */ - set_fs(old_fs); - retval = -ENOENT; - goto exec_error1; - } - set_fs(old_fs); - goto restart_interp; - } - brelse(bh); - if (N_MAGIC(ex) != ZMAGIC || ex.a_trsize || ex.a_drsize || - ex.a_text+ex.a_data+ex.a_bss>0x3000000 || - inode->i_size < ex.a_text+ex.a_data+ex.a_syms+N_TXTOFF(ex)) { - retval = -ENOEXEC; - goto exec_error2; - } - if (N_TXTOFF(ex) != BLOCK_SIZE) { - printk("%s: N_TXTOFF != BLOCK_SIZE. See a.out.h.", filename); - retval = -ENOEXEC; - goto exec_error2; - } - if (!sh_bang) { - p = copy_strings(envc,envp,page,p,0); - p = copy_strings(argc,argv,page,p,0); - if (!p) { - retval = -ENOMEM; - goto exec_error2; - } - } -/* OK, This is the point of no return */ - if (current->executable) - iput(current->executable); - current->executable = inode; - for (i=0 ; i<32 ; i++) - current->sigaction[i].sa_handler = NULL; - for (i=0 ; iclose_on_exec>>i)&1) - sys_close(i); - current->close_on_exec = 0; - free_page_tables(get_base(current->ldt[1]),get_limit(0x0f)); - free_page_tables(get_base(current->ldt[2]),get_limit(0x17)); - if (last_task_used_math == current) - last_task_used_math = NULL; - current->used_math = 0; - p += change_ldt(ex.a_text,page)-MAX_ARG_PAGES*PAGE_SIZE; - p = (unsigned long) create_tables((char *)p,argc,envc); - current->brk = ex.a_bss + - (current->end_data = ex.a_data + - (current->end_code = ex.a_text)); - current->start_stack = p & 0xfffff000; - current->euid = e_uid; - current->egid = e_gid; - i = ex.a_text+ex.a_data; - while (i&0xfff) - put_fs_byte(0,(char *) (i++)); - eip[0] = ex.a_entry; /* eip, magic happens :-) */ - eip[3] = p; /* stack pointer */ - return 0; -exec_error2: - iput(inode); -exec_error1: - for (i=0 ; i */ -#include -#include -#include -#include - -#include -#include - -extern int sys_close(int fd); - -static int dupfd(unsigned int fd, unsigned int arg) -{ - if (fd >= NR_OPEN || !current->filp[fd]) - return -EBADF; - if (arg >= NR_OPEN) - return -EINVAL; - while (arg < NR_OPEN) - if (current->filp[arg]) - arg++; - else - break; - if (arg >= NR_OPEN) - return -EMFILE; - current->close_on_exec &= ~(1<filp[arg] = current->filp[fd])->f_count++; - return arg; -} - -int sys_dup2(unsigned int oldfd, unsigned int newfd) -{ - sys_close(newfd); - return dupfd(oldfd,newfd); -} - -int sys_dup(unsigned int fildes) -{ - return dupfd(fildes,0); -} - -int sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - struct file * filp; - - if (fd >= NR_OPEN || !(filp = current->filp[fd])) - return -EBADF; - switch (cmd) { - case F_DUPFD: - return dupfd(fd,arg); - case F_GETFD: - return (current->close_on_exec>>fd)&1; - case F_SETFD: - if (arg&1) - current->close_on_exec |= (1<close_on_exec &= ~(1<f_flags; - case F_SETFL: - filp->f_flags &= ~(O_APPEND | O_NONBLOCK); - filp->f_flags |= arg & (O_APPEND | O_NONBLOCK); - return 0; - case F_GETLK: case F_SETLK: case F_SETLKW: - return -1; - default: - return -1; - } -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/file_dev.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/file_dev.c deleted file mode 100644 index 4661b6f..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/file_dev.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * linux/fs/file_dev.c - * - * (C) 1991 Linus Torvalds - */ - -#include -#include - -#include -#include -#include - -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define MAX(a,b) (((a)>(b))?(a):(b)) - -int file_read(struct m_inode * inode, struct file * filp, char * buf, int count) -{ - int left,chars,nr; - struct buffer_head * bh; - - if ((left=count)<=0) - return 0; - while (left) { - if ((nr = bmap(inode,(filp->f_pos)/BLOCK_SIZE))) { - if (!(bh=bread(inode->i_dev,nr))) - break; - } else - bh = NULL; - nr = filp->f_pos % BLOCK_SIZE; - chars = MIN( BLOCK_SIZE-nr , left ); - filp->f_pos += chars; - left -= chars; - if (bh) { - char * p = nr + bh->b_data; - while (chars-->0) - put_fs_byte(*(p++),buf++); - brelse(bh); - } else { - while (chars-->0) - put_fs_byte(0,buf++); - } - } - inode->i_atime = CURRENT_TIME; - return (count-left)?(count-left):-ERROR; -} - -int file_write(struct m_inode * inode, struct file * filp, char * buf, int count) -{ - off_t pos; - int block,c; - struct buffer_head * bh; - char * p; - int i=0; - -/* - * ok, append may not work when many processes are writing at the same time - * but so what. That way leads to madness anyway. - */ - if (filp->f_flags & O_APPEND) - pos = inode->i_size; - else - pos = filp->f_pos; - while (ii_dev,block))) - break; - c = pos % BLOCK_SIZE; - p = c + bh->b_data; - bh->b_dirt = 1; - c = BLOCK_SIZE-c; - if (c > count-i) c = count-i; - pos += c; - if (pos > inode->i_size) { - inode->i_size = pos; - inode->i_dirt = 1; - } - i += c; - while (c-->0) - *(p++) = get_fs_byte(buf++); - brelse(bh); - } - inode->i_mtime = CURRENT_TIME; - if (!(filp->f_flags & O_APPEND)) { - filp->f_pos = pos; - inode->i_ctime = CURRENT_TIME; - } - return (i?i:-1); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/file_table.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/file_table.c deleted file mode 100644 index e0589ac..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/file_table.c +++ /dev/null @@ -1,9 +0,0 @@ -/* - * linux/fs/file_table.c - * - * (C) 1991 Linus Torvalds - */ - -#include - -struct file file_table[NR_FILE]; diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/inode.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/inode.c deleted file mode 100644 index d0b1c32..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/inode.c +++ /dev/null @@ -1,338 +0,0 @@ -/* - * linux/fs/inode.c - * - * (C) 1991 Linus Torvalds - */ - -#include -#include - -#include -#include -#include -#include - -struct m_inode inode_table[NR_INODE]={{0,},}; - -static void read_inode(struct m_inode * inode); -static void write_inode(struct m_inode * inode); - -static inline void wait_on_inode(struct m_inode * inode) -{ - cli(); - while (inode->i_lock) - sleep_on(&inode->i_wait); - sti(); -} - -static inline void lock_inode(struct m_inode * inode) -{ - cli(); - while (inode->i_lock) - sleep_on(&inode->i_wait); - inode->i_lock=1; - sti(); -} - -static inline void unlock_inode(struct m_inode * inode) -{ - inode->i_lock=0; - wake_up(&inode->i_wait); -} - -void invalidate_inodes(int dev) -{ - int i; - struct m_inode * inode; - - inode = 0+inode_table; - for(i=0 ; ii_dev == dev) { - if (inode->i_count) - printk("inode in use on removed disk\n\r"); - inode->i_dev = inode->i_dirt = 0; - } - } -} - -void sync_inodes(void) -{ - int i; - struct m_inode * inode; - - inode = 0+inode_table; - for(i=0 ; ii_dirt && !inode->i_pipe) - write_inode(inode); - } -} - -static int _bmap(struct m_inode * inode,int block,int create) -{ - struct buffer_head * bh; - int i; - - if (block<0) - panic("_bmap: block<0"); - if (block >= 7+512+512*512) - panic("_bmap: block>big"); - if (block<7) { - if (create && !inode->i_zone[block]) - if ((inode->i_zone[block]=new_block(inode->i_dev))) { - inode->i_ctime=CURRENT_TIME; - inode->i_dirt=1; - } - return inode->i_zone[block]; - } - block -= 7; - if (block<512) { - if (create && !inode->i_zone[7]) - if ((inode->i_zone[7]=new_block(inode->i_dev))) { - inode->i_dirt=1; - inode->i_ctime=CURRENT_TIME; - } - if (!inode->i_zone[7]) - return 0; - if (!(bh = bread(inode->i_dev,inode->i_zone[7]))) - return 0; - i = ((unsigned short *) (bh->b_data))[block]; - if (create && !i) - if ((i=new_block(inode->i_dev))) { - ((unsigned short *) (bh->b_data))[block]=i; - bh->b_dirt=1; - } - brelse(bh); - return i; - } - block -= 512; - if (create && !inode->i_zone[8]) - if ((inode->i_zone[8]=new_block(inode->i_dev))) { - inode->i_dirt=1; - inode->i_ctime=CURRENT_TIME; - } - if (!inode->i_zone[8]) - return 0; - if (!(bh=bread(inode->i_dev,inode->i_zone[8]))) - return 0; - i = ((unsigned short *)bh->b_data)[block>>9]; - if (create && !i) - if ((i=new_block(inode->i_dev))) { - ((unsigned short *) (bh->b_data))[block>>9]=i; - bh->b_dirt=1; - } - brelse(bh); - if (!i) - return 0; - if (!(bh=bread(inode->i_dev,i))) - return 0; - i = ((unsigned short *)bh->b_data)[block&511]; - if (create && !i) - if ((i=new_block(inode->i_dev))) { - ((unsigned short *) (bh->b_data))[block&511]=i; - bh->b_dirt=1; - } - brelse(bh); - return i; -} - -int bmap(struct m_inode * inode,int block) -{ - return _bmap(inode,block,0); -} - -int create_block(struct m_inode * inode, int block) -{ - return _bmap(inode,block,1); -} - -void iput(struct m_inode * inode) -{ - if (!inode) - return; - wait_on_inode(inode); - if (!inode->i_count) - panic("iput: trying to free free inode"); - if (inode->i_pipe) { - wake_up(&inode->i_wait); - if (--inode->i_count) - return; - free_page(inode->i_size); - inode->i_count=0; - inode->i_dirt=0; - inode->i_pipe=0; - return; - } - if (!inode->i_dev) { - inode->i_count--; - return; - } - if (S_ISBLK(inode->i_mode)) { - sync_dev(inode->i_zone[0]); - wait_on_inode(inode); - } -repeat: - if (inode->i_count>1) { - inode->i_count--; - return; - } - if (!inode->i_nlinks) { - truncate(inode); - free_inode(inode); - return; - } - if (inode->i_dirt) { - write_inode(inode); /* we can sleep - so do again */ - wait_on_inode(inode); - goto repeat; - } - inode->i_count--; - return; -} - -struct m_inode * get_empty_inode(void) -{ - struct m_inode * inode; - static struct m_inode * last_inode = inode_table; - int i; - - do { - inode = NULL; - for (i = NR_INODE; i ; i--) { - if (++last_inode >= inode_table + NR_INODE) - last_inode = inode_table; - if (!last_inode->i_count) { - inode = last_inode; - if (!inode->i_dirt && !inode->i_lock) - break; - } - } - if (!inode) { - for (i=0 ; ii_dirt) { - write_inode(inode); - wait_on_inode(inode); - } - } while (inode->i_count); - memset(inode,0,sizeof(*inode)); - inode->i_count = 1; - return inode; -} - -struct m_inode * get_pipe_inode(void) -{ - struct m_inode * inode; - - if (!(inode = get_empty_inode())) - return NULL; - if (!(inode->i_size=get_free_page())) { - inode->i_count = 0; - return NULL; - } - inode->i_count = 2; /* sum of readers/writers */ - PIPE_HEAD(*inode) = PIPE_TAIL(*inode) = 0; - inode->i_pipe = 1; - return inode; -} - -struct m_inode * iget(int dev,int nr) -{ - struct m_inode * inode, * empty; - - if (!dev) - panic("iget with dev==0"); - empty = get_empty_inode(); - inode = inode_table; - while (inode < NR_INODE+inode_table) { - if (inode->i_dev != dev || inode->i_num != nr) { - inode++; - continue; - } - wait_on_inode(inode); - if (inode->i_dev != dev || inode->i_num != nr) { - inode = inode_table; - continue; - } - inode->i_count++; - if (inode->i_mount) { - int i; - - for (i = 0 ; i= NR_SUPER) { - printk("Mounted inode hasn't got sb\n"); - if (empty) - iput(empty); - return inode; - } - iput(inode); - dev = super_block[i].s_dev; - nr = ROOT_INO; - inode = inode_table; - continue; - } - if (empty) - iput(empty); - return inode; - } - if (!empty) - return (NULL); - inode=empty; - inode->i_dev = dev; - inode->i_num = nr; - read_inode(inode); - return inode; -} - -static void read_inode(struct m_inode * inode) -{ - struct super_block * sb; - struct buffer_head * bh; - int block; - - lock_inode(inode); - if (!(sb=get_super(inode->i_dev))) - panic("trying to read inode without dev"); - block = 2 + sb->s_imap_blocks + sb->s_zmap_blocks + - (inode->i_num-1)/INODES_PER_BLOCK; - if (!(bh=bread(inode->i_dev,block))) - panic("unable to read i-node block"); - *(struct d_inode *)inode = - ((struct d_inode *)bh->b_data) - [(inode->i_num-1)%INODES_PER_BLOCK]; - brelse(bh); - unlock_inode(inode); -} - -static void write_inode(struct m_inode * inode) -{ - struct super_block * sb; - struct buffer_head * bh; - int block; - - lock_inode(inode); - if (!inode->i_dirt || !inode->i_dev) { - unlock_inode(inode); - return; - } - if (!(sb=get_super(inode->i_dev))) - panic("trying to write inode without device"); - block = 2 + sb->s_imap_blocks + sb->s_zmap_blocks + - (inode->i_num-1)/INODES_PER_BLOCK; - if (!(bh=bread(inode->i_dev,block))) - panic("unable to read i-node block"); - ((struct d_inode *)bh->b_data) - [(inode->i_num-1)%INODES_PER_BLOCK] = - *(struct d_inode *)inode; - bh->b_dirt=1; - inode->i_dirt=0; - brelse(bh); - unlock_inode(inode); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/ioctl.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/ioctl.c deleted file mode 100644 index 47ce3cb..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/ioctl.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * linux/fs/ioctl.c - * - * (C) 1991 Linus Torvalds - */ - -/* #include */ -#include -#include - -#include - -extern int tty_ioctl(int dev, int cmd, int arg); - -typedef int (*ioctl_ptr)(int dev,int cmd,int arg); - -#define NRDEVS ((sizeof (ioctl_table))/(sizeof (ioctl_ptr))) - -static ioctl_ptr ioctl_table[]={ - NULL, /* nodev */ - NULL, /* /dev/mem */ - NULL, /* /dev/fd */ - NULL, /* /dev/hd */ - tty_ioctl, /* /dev/ttyx */ - tty_ioctl, /* /dev/tty */ - NULL, /* /dev/lp */ - NULL}; /* named pipes */ - - -int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) -{ - struct file * filp; - int dev,mode; - - if (fd >= NR_OPEN || !(filp = current->filp[fd])) - return -EBADF; - mode=filp->f_inode->i_mode; - if (!S_ISCHR(mode) && !S_ISBLK(mode)) - return -EINVAL; - dev = filp->f_inode->i_zone[0]; - if (MAJOR(dev) >= NRDEVS) - return -ENODEV; - if (!ioctl_table[MAJOR(dev)]) - return -ENOTTY; - return ioctl_table[MAJOR(dev)](dev,cmd,arg); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/namei.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/namei.c deleted file mode 100644 index 97d0de4..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/namei.c +++ /dev/null @@ -1,778 +0,0 @@ -/* - * linux/fs/namei.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * Some corrections by tytso. - */ - -#include -#include -#include - -#include -#include -#include -#include -#include - -#define ACC_MODE(x) ("\004\002\006\377"[(x)&O_ACCMODE]) - -/* - * comment out this line if you want names > NAME_LEN chars to be - * truncated. Else they will be disallowed. - */ -/* #define NO_TRUNCATE */ - -#define MAY_EXEC 1 -#define MAY_WRITE 2 -#define MAY_READ 4 - -/* - * permission() - * - * is used to check for read/write/execute permissions on a file. - * I don't know if we should look at just the euid or both euid and - * uid, but that should be easily changed. - */ -static int permission(struct m_inode * inode,int mask) -{ - int mode = inode->i_mode; - -/* special case: not even root can read/write a deleted file */ - if (inode->i_dev && !inode->i_nlinks) - return 0; - else if (current->euid==inode->i_uid) - mode >>= 6; - else if (current->egid==inode->i_gid) - mode >>= 3; - if (((mode & mask & 0007) == mask) || suser()) - return 1; - return 0; -} - -/* - * ok, we cannot use strncmp, as the name is not in our data space. - * Thus we'll have to use match. No big problem. Match also makes - * some sanity tests. - * - * NOTE! unlike strncmp, match returns 1 for success, 0 for failure. - */ -static int match(int len,const char * name,struct dir_entry * de) -{ - register int same ; - - if (!de || !de->inode || len > NAME_LEN) - return 0; - if (len < NAME_LEN && de->name[len]) - return 0; - __asm__("cld\n\t" - "fs ; repe ; cmpsb\n\t" - "setz %%al" - :"=a" (same) - :"0" (0),"S" ((long) name),"D" ((long) de->name),"c" (len) - ); - return same; -} - -/* - * find_entry() - * - * finds an entry in the specified directory with the wanted name. It - * returns the cache buffer in which the entry was found, and the entry - * itself (as a parameter - res_dir). It does NOT read the inode of the - * entry - you'll have to do that yourself if you want to. - * - * This also takes care of the few special cases due to '..'-traversal - * over a pseudo-root and a mount point. - */ -static struct buffer_head * find_entry(struct m_inode ** dir, - const char * name, int namelen, struct dir_entry ** res_dir) -{ - int entries; - int block,i; - struct buffer_head * bh; - struct dir_entry * de; - struct super_block * sb; - -#ifdef NO_TRUNCATE - if (namelen > NAME_LEN) - return NULL; -#else - if (namelen > NAME_LEN) - namelen = NAME_LEN; -#endif - entries = (*dir)->i_size / (sizeof (struct dir_entry)); - *res_dir = NULL; - if (!namelen) - return NULL; -/* check for '..', as we might have to do some "magic" for it */ - if (namelen==2 && get_fs_byte(name)=='.' && get_fs_byte(name+1)=='.') { -/* '..' in a pseudo-root results in a faked '.' (just change namelen) */ - if ((*dir) == current->root) - namelen=1; - else if ((*dir)->i_num == ROOT_INO) { -/* '..' over a mount-point results in 'dir' being exchanged for the mounted - directory-inode. NOTE! We set mounted, so that we can iput the new dir */ - sb=get_super((*dir)->i_dev); - if (sb->s_imount) { - iput(*dir); - (*dir)=sb->s_imount; - (*dir)->i_count++; - } - } - } - if (!(block = (*dir)->i_zone[0])) - return NULL; - if (!(bh = bread((*dir)->i_dev,block))) - return NULL; - i = 0; - de = (struct dir_entry *) bh->b_data; - while (i < entries) { - if ((char *)de >= BLOCK_SIZE+bh->b_data) { - brelse(bh); - bh = NULL; - if (!(block = bmap(*dir,i/DIR_ENTRIES_PER_BLOCK)) || - !(bh = bread((*dir)->i_dev,block))) { - i += DIR_ENTRIES_PER_BLOCK; - continue; - } - de = (struct dir_entry *) bh->b_data; - } - if (match(namelen,name,de)) { - *res_dir = de; - return bh; - } - de++; - i++; - } - brelse(bh); - return NULL; -} - -/* - * add_entry() - * - * adds a file entry to the specified directory, using the same - * semantics as find_entry(). It returns NULL if it failed. - * - * NOTE!! The inode part of 'de' is left at 0 - which means you - * may not sleep between calling this and putting something into - * the entry, as someone else might have used it while you slept. - */ -static struct buffer_head * add_entry(struct m_inode * dir, - const char * name, int namelen, struct dir_entry ** res_dir) -{ - int block,i; - struct buffer_head * bh; - struct dir_entry * de; - - *res_dir = NULL; -#ifdef NO_TRUNCATE - if (namelen > NAME_LEN) - return NULL; -#else - if (namelen > NAME_LEN) - namelen = NAME_LEN; -#endif - if (!namelen) - return NULL; - if (!(block = dir->i_zone[0])) - return NULL; - if (!(bh = bread(dir->i_dev,block))) - return NULL; - i = 0; - de = (struct dir_entry *) bh->b_data; - while (1) { - if ((char *)de >= BLOCK_SIZE+bh->b_data) { - brelse(bh); - bh = NULL; - block = create_block(dir,i/DIR_ENTRIES_PER_BLOCK); - if (!block) - return NULL; - if (!(bh = bread(dir->i_dev,block))) { - i += DIR_ENTRIES_PER_BLOCK; - continue; - } - de = (struct dir_entry *) bh->b_data; - } - if (i*sizeof(struct dir_entry) >= dir->i_size) { - de->inode=0; - dir->i_size = (i+1)*sizeof(struct dir_entry); - dir->i_dirt = 1; - dir->i_ctime = CURRENT_TIME; - } - if (!de->inode) { - dir->i_mtime = CURRENT_TIME; - for (i=0; i < NAME_LEN ; i++) - de->name[i]=(ib_dirt = 1; - *res_dir = de; - return bh; - } - de++; - i++; - } - brelse(bh); - return NULL; -} - -/* - * get_dir() - * - * Getdir traverses the pathname until it hits the topmost directory. - * It returns NULL on failure. - */ -static struct m_inode * get_dir(const char * pathname) -{ - char c; - const char * thisname; - struct m_inode * inode; - struct buffer_head * bh; - int namelen,inr,idev; - struct dir_entry * de; - - if (!current->root || !current->root->i_count) - panic("No root inode"); - if (!current->pwd || !current->pwd->i_count) - panic("No cwd inode"); - if ((c=get_fs_byte(pathname))=='/') { - inode = current->root; - pathname++; - } else if (c) - inode = current->pwd; - else - return NULL; /* empty name is bad */ - inode->i_count++; - while (1) { - thisname = pathname; - if (!S_ISDIR(inode->i_mode) || !permission(inode,MAY_EXEC)) { - iput(inode); - return NULL; - } - for(namelen=0;(c=get_fs_byte(pathname++))&&(c!='/');namelen++) - /* nothing */ ; - if (!c) - return inode; - if (!(bh = find_entry(&inode,thisname,namelen,&de))) { - iput(inode); - return NULL; - } - inr = de->inode; - idev = inode->i_dev; - brelse(bh); - iput(inode); - if (!(inode = iget(idev,inr))) - return NULL; - } -} - -/* - * dir_namei() - * - * dir_namei() returns the inode of the directory of the - * specified name, and the name within that directory. - */ -static struct m_inode * dir_namei(const char * pathname, - int * namelen, const char ** name) -{ - char c; - const char * basename; - struct m_inode * dir; - - if (!(dir = get_dir(pathname))) - return NULL; - basename = pathname; - while ((c=get_fs_byte(pathname++))) - if (c=='/') - basename=pathname; - *namelen = pathname-basename-1; - *name = basename; - return dir; -} - -/* - * namei() - * - * is used by most simple commands to get the inode of a specified name. - * Open, link etc use their own routines, but this is enough for things - * like 'chmod' etc. - */ -struct m_inode * namei(const char * pathname) -{ - const char * basename; - int inr,dev,namelen; - struct m_inode * dir; - struct buffer_head * bh; - struct dir_entry * de; - - if (!(dir = dir_namei(pathname,&namelen,&basename))) - return NULL; - if (!namelen) /* special case: '/usr/' etc */ - return dir; - bh = find_entry(&dir,basename,namelen,&de); - if (!bh) { - iput(dir); - return NULL; - } - inr = de->inode; - dev = dir->i_dev; - brelse(bh); - iput(dir); - dir=iget(dev,inr); - if (dir) { - dir->i_atime=CURRENT_TIME; - dir->i_dirt=1; - } - return dir; -} - -/* - * open_namei() - * - * namei for open - this is in fact almost the whole open-routine. - */ -int open_namei(const char * pathname, int flag, int mode, - struct m_inode ** res_inode) -{ - const char * basename; - int inr,dev,namelen; - struct m_inode * dir, *inode; - struct buffer_head * bh; - struct dir_entry * de; - - if ((flag & O_TRUNC) && !(flag & O_ACCMODE)) - flag |= O_WRONLY; - mode &= 0777 & ~current->umask; - mode |= I_REGULAR; - if (!(dir = dir_namei(pathname,&namelen,&basename))) - return -ENOENT; - if (!namelen) { /* special case: '/usr/' etc */ - if (!(flag & (O_ACCMODE|O_CREAT|O_TRUNC))) { - *res_inode=dir; - return 0; - } - iput(dir); - return -EISDIR; - } - bh = find_entry(&dir,basename,namelen,&de); - if (!bh) { - if (!(flag & O_CREAT)) { - iput(dir); - return -ENOENT; - } - if (!permission(dir,MAY_WRITE)) { - iput(dir); - return -EACCES; - } - inode = new_inode(dir->i_dev); - if (!inode) { - iput(dir); - return -ENOSPC; - } - inode->i_uid = current->euid; - inode->i_mode = mode; - inode->i_dirt = 1; - bh = add_entry(dir,basename,namelen,&de); - if (!bh) { - inode->i_nlinks--; - iput(inode); - iput(dir); - return -ENOSPC; - } - de->inode = inode->i_num; - bh->b_dirt = 1; - brelse(bh); - iput(dir); - *res_inode = inode; - return 0; - } - inr = de->inode; - dev = dir->i_dev; - brelse(bh); - iput(dir); - if (flag & O_EXCL) - return -EEXIST; - if (!(inode=iget(dev,inr))) - return -EACCES; - if ((S_ISDIR(inode->i_mode) && (flag & O_ACCMODE)) || - !permission(inode,ACC_MODE(flag))) { - iput(inode); - return -EPERM; - } - inode->i_atime = CURRENT_TIME; - if (flag & O_TRUNC) - truncate(inode); - *res_inode = inode; - return 0; -} - -int sys_mknod(const char * filename, int mode, int dev) -{ - const char * basename; - int namelen; - struct m_inode * dir, * inode; - struct buffer_head * bh; - struct dir_entry * de; - - if (!suser()) - return -EPERM; - if (!(dir = dir_namei(filename,&namelen,&basename))) - return -ENOENT; - if (!namelen) { - iput(dir); - return -ENOENT; - } - if (!permission(dir,MAY_WRITE)) { - iput(dir); - return -EPERM; - } - bh = find_entry(&dir,basename,namelen,&de); - if (bh) { - brelse(bh); - iput(dir); - return -EEXIST; - } - inode = new_inode(dir->i_dev); - if (!inode) { - iput(dir); - return -ENOSPC; - } - inode->i_mode = mode; - if (S_ISBLK(mode) || S_ISCHR(mode)) - inode->i_zone[0] = dev; - inode->i_mtime = inode->i_atime = CURRENT_TIME; - inode->i_dirt = 1; - bh = add_entry(dir,basename,namelen,&de); - if (!bh) { - iput(dir); - inode->i_nlinks=0; - iput(inode); - return -ENOSPC; - } - de->inode = inode->i_num; - bh->b_dirt = 1; - iput(dir); - iput(inode); - brelse(bh); - return 0; -} - -int sys_mkdir(const char * pathname, int mode) -{ - const char * basename; - int namelen; - struct m_inode * dir, * inode; - struct buffer_head * bh, *dir_block; - struct dir_entry * de; - - if (!suser()) - return -EPERM; - if (!(dir = dir_namei(pathname,&namelen,&basename))) - return -ENOENT; - if (!namelen) { - iput(dir); - return -ENOENT; - } - if (!permission(dir,MAY_WRITE)) { - iput(dir); - return -EPERM; - } - bh = find_entry(&dir,basename,namelen,&de); - if (bh) { - brelse(bh); - iput(dir); - return -EEXIST; - } - inode = new_inode(dir->i_dev); - if (!inode) { - iput(dir); - return -ENOSPC; - } - inode->i_size = 32; - inode->i_dirt = 1; - inode->i_mtime = inode->i_atime = CURRENT_TIME; - if (!(inode->i_zone[0]=new_block(inode->i_dev))) { - iput(dir); - inode->i_nlinks--; - iput(inode); - return -ENOSPC; - } - inode->i_dirt = 1; - if (!(dir_block=bread(inode->i_dev,inode->i_zone[0]))) { - iput(dir); - free_block(inode->i_dev,inode->i_zone[0]); - inode->i_nlinks--; - iput(inode); - return -ERROR; - } - de = (struct dir_entry *) dir_block->b_data; - de->inode=inode->i_num; - strcpy(de->name,"."); - de++; - de->inode = dir->i_num; - strcpy(de->name,".."); - inode->i_nlinks = 2; - dir_block->b_dirt = 1; - brelse(dir_block); - inode->i_mode = I_DIRECTORY | (mode & 0777 & ~current->umask); - inode->i_dirt = 1; - bh = add_entry(dir,basename,namelen,&de); - if (!bh) { - iput(dir); - free_block(inode->i_dev,inode->i_zone[0]); - inode->i_nlinks=0; - iput(inode); - return -ENOSPC; - } - de->inode = inode->i_num; - bh->b_dirt = 1; - dir->i_nlinks++; - dir->i_dirt = 1; - iput(dir); - iput(inode); - brelse(bh); - return 0; -} - -/* - * routine to check that the specified directory is empty (for rmdir) - */ -static int empty_dir(struct m_inode * inode) -{ - int nr,block; - int len; - struct buffer_head * bh; - struct dir_entry * de; - - len = inode->i_size / sizeof (struct dir_entry); - if (len<2 || !inode->i_zone[0] || - !(bh=bread(inode->i_dev,inode->i_zone[0]))) { - printk("warning - bad directory on dev %04x\n",inode->i_dev); - return 0; - } - de = (struct dir_entry *) bh->b_data; - if (de[0].inode != inode->i_num || !de[1].inode || - strcmp(".",de[0].name) || strcmp("..",de[1].name)) { - printk("warning - bad directory on dev %04x\n",inode->i_dev); - return 0; - } - nr = 2; - de += 2; - while (nr= (void *) (bh->b_data+BLOCK_SIZE)) { - brelse(bh); - block=bmap(inode,nr/DIR_ENTRIES_PER_BLOCK); - if (!block) { - nr += DIR_ENTRIES_PER_BLOCK; - continue; - } - if (!(bh=bread(inode->i_dev,block))) - return 0; - de = (struct dir_entry *) bh->b_data; - } - if (de->inode) { - brelse(bh); - return 0; - } - de++; - nr++; - } - brelse(bh); - return 1; -} - -int sys_rmdir(const char * name) -{ - const char * basename; - int namelen; - struct m_inode * dir, * inode; - struct buffer_head * bh; - struct dir_entry * de; - - if (!suser()) - return -EPERM; - if (!(dir = dir_namei(name,&namelen,&basename))) - return -ENOENT; - if (!namelen) { - iput(dir); - return -ENOENT; - } - if (!permission(dir,MAY_WRITE)) { - iput(dir); - return -EPERM; - } - bh = find_entry(&dir,basename,namelen,&de); - if (!bh) { - iput(dir); - return -ENOENT; - } - if (!(inode = iget(dir->i_dev, de->inode))) { - iput(dir); - brelse(bh); - return -EPERM; - } - if ((dir->i_mode & S_ISVTX) && current->euid && - inode->i_uid != current->euid) { - iput(dir); - iput(inode); - brelse(bh); - return -EPERM; - } - if (inode->i_dev != dir->i_dev || inode->i_count>1) { - iput(dir); - iput(inode); - brelse(bh); - return -EPERM; - } - if (inode == dir) { /* we may not delete ".", but "../dir" is ok */ - iput(inode); - iput(dir); - brelse(bh); - return -EPERM; - } - if (!S_ISDIR(inode->i_mode)) { - iput(inode); - iput(dir); - brelse(bh); - return -ENOTDIR; - } - if (!empty_dir(inode)) { - iput(inode); - iput(dir); - brelse(bh); - return -ENOTEMPTY; - } - if (inode->i_nlinks != 2) - printk("empty directory has nlink!=2 (%d)",inode->i_nlinks); - de->inode = 0; - bh->b_dirt = 1; - brelse(bh); - inode->i_nlinks=0; - inode->i_dirt=1; - dir->i_nlinks--; - dir->i_ctime = dir->i_mtime = CURRENT_TIME; - dir->i_dirt=1; - iput(dir); - iput(inode); - return 0; -} - -int sys_unlink(const char * name) -{ - const char * basename; - int namelen; - struct m_inode * dir, * inode; - struct buffer_head * bh; - struct dir_entry * de; - - if (!(dir = dir_namei(name,&namelen,&basename))) - return -ENOENT; - if (!namelen) { - iput(dir); - return -ENOENT; - } - if (!permission(dir,MAY_WRITE)) { - iput(dir); - return -EPERM; - } - bh = find_entry(&dir,basename,namelen,&de); - if (!bh) { - iput(dir); - return -ENOENT; - } - if (!(inode = iget(dir->i_dev, de->inode))) { - iput(dir); - brelse(bh); - return -ENOENT; - } - if ((dir->i_mode & S_ISVTX) && !suser() && - current->euid != inode->i_uid && - current->euid != dir->i_uid) { - iput(dir); - iput(inode); - brelse(bh); - return -EPERM; - } - if (S_ISDIR(inode->i_mode)) { - iput(inode); - iput(dir); - brelse(bh); - return -EPERM; - } - if (!inode->i_nlinks) { - printk("Deleting nonexistent file (%04x:%d), %d\n", - inode->i_dev,inode->i_num,inode->i_nlinks); - inode->i_nlinks=1; - } - de->inode = 0; - bh->b_dirt = 1; - brelse(bh); - inode->i_nlinks--; - inode->i_dirt = 1; - inode->i_ctime = CURRENT_TIME; - iput(inode); - iput(dir); - return 0; -} - -int sys_link(const char * oldname, const char * newname) -{ - struct dir_entry * de; - struct m_inode * oldinode, * dir; - struct buffer_head * bh; - const char * basename; - int namelen; - - oldinode=namei(oldname); - if (!oldinode) - return -ENOENT; - if (S_ISDIR(oldinode->i_mode)) { - iput(oldinode); - return -EPERM; - } - dir = dir_namei(newname,&namelen,&basename); - if (!dir) { - iput(oldinode); - return -EACCES; - } - if (!namelen) { - iput(oldinode); - iput(dir); - return -EPERM; - } - if (dir->i_dev != oldinode->i_dev) { - iput(dir); - iput(oldinode); - return -EXDEV; - } - if (!permission(dir,MAY_WRITE)) { - iput(dir); - iput(oldinode); - return -EACCES; - } - bh = find_entry(&dir,basename,namelen,&de); - if (bh) { - brelse(bh); - iput(dir); - iput(oldinode); - return -EEXIST; - } - bh = add_entry(dir,basename,namelen,&de); - if (!bh) { - iput(dir); - iput(oldinode); - return -ENOSPC; - } - de->inode = oldinode->i_num; - bh->b_dirt = 1; - brelse(bh); - iput(dir); - oldinode->i_nlinks++; - oldinode->i_ctime = CURRENT_TIME; - oldinode->i_dirt = 1; - iput(oldinode); - return 0; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/open.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/open.c deleted file mode 100644 index cac0082..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/open.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - * linux/fs/open.c - * - * (C) 1991 Linus Torvalds - */ - -/* #include */ -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -int sys_ustat(int dev, struct ustat * ubuf) -{ - return -ENOSYS; -} - -int sys_utime(char * filename, struct utimbuf * times) -{ - struct m_inode * inode; - long actime,modtime; - - if (!(inode=namei(filename))) - return -ENOENT; - if (times) { - actime = get_fs_long((unsigned long *) ×->actime); - modtime = get_fs_long((unsigned long *) ×->modtime); - } else - actime = modtime = CURRENT_TIME; - inode->i_atime = actime; - inode->i_mtime = modtime; - inode->i_dirt = 1; - iput(inode); - return 0; -} - -/* - * XXX should we use the real or effective uid? BSD uses the real uid, - * so as to make this call useful to setuid programs. - */ -int sys_access(const char * filename,int mode) -{ - struct m_inode * inode; - int res, i_mode; - - mode &= 0007; - if (!(inode=namei(filename))) - return -EACCES; - i_mode = res = inode->i_mode & 0777; - iput(inode); - if (current->uid == inode->i_uid) - res >>= 6; - else if (current->gid == inode->i_gid) - res >>= 6; - if ((res & 0007 & mode) == mode) - return 0; - /* - * XXX we are doing this test last because we really should be - * swapping the effective with the real user id (temporarily), - * and then calling suser() routine. If we do call the - * suser() routine, it needs to be called last. - */ - if ((!current->uid) && - (!(mode & 1) || (i_mode & 0111))) - return 0; - return -EACCES; -} - -int sys_chdir(const char * filename) -{ - struct m_inode * inode; - - if (!(inode = namei(filename))) - return -ENOENT; - if (!S_ISDIR(inode->i_mode)) { - iput(inode); - return -ENOTDIR; - } - iput(current->pwd); - current->pwd = inode; - return (0); -} - -int sys_chroot(const char * filename) -{ - struct m_inode * inode; - - if (!(inode=namei(filename))) - return -ENOENT; - if (!S_ISDIR(inode->i_mode)) { - iput(inode); - return -ENOTDIR; - } - iput(current->root); - current->root = inode; - return (0); -} - -int sys_chmod(const char * filename,int mode) -{ - struct m_inode * inode; - - if (!(inode=namei(filename))) - return -ENOENT; - if ((current->euid != inode->i_uid) && !suser()) { - iput(inode); - return -EACCES; - } - inode->i_mode = (mode & 07777) | (inode->i_mode & ~07777); - inode->i_dirt = 1; - iput(inode); - return 0; -} - -int sys_chown(const char * filename,int uid,int gid) -{ - struct m_inode * inode; - - if (!(inode=namei(filename))) - return -ENOENT; - if (!suser()) { - iput(inode); - return -EACCES; - } - inode->i_uid=uid; - inode->i_gid=gid; - inode->i_dirt=1; - iput(inode); - return 0; -} - -int sys_open(const char * filename,int flag,int mode) -{ - struct m_inode * inode; - struct file * f; - int i,fd; - - mode &= 0777 & ~current->umask; - for(fd=0 ; fdfilp[fd]) - break; - if (fd>=NR_OPEN) - return -EINVAL; - current->close_on_exec &= ~(1<f_count) break; - if (i>=NR_FILE) - return -EINVAL; - (current->filp[fd]=f)->f_count++; - if ((i=open_namei(filename,flag,mode,&inode))<0) { - current->filp[fd]=NULL; - f->f_count=0; - return i; - } -/* ttys are somewhat special (ttyxx major==4, tty major==5) */ - if (S_ISCHR(inode->i_mode)) { - if (MAJOR(inode->i_zone[0])==4) { - if (current->leader && current->tty<0) { - current->tty = MINOR(inode->i_zone[0]); - tty_table[current->tty].pgrp = current->pgrp; - } - } else if (MAJOR(inode->i_zone[0])==5) - if (current->tty<0) { - iput(inode); - current->filp[fd]=NULL; - f->f_count=0; - return -EPERM; - } - } -/* Likewise with block-devices: check for floppy_change */ - if (S_ISBLK(inode->i_mode)) - check_disk_change(inode->i_zone[0]); - f->f_mode = inode->i_mode; - f->f_flags = flag; - f->f_count = 1; - f->f_inode = inode; - f->f_pos = 0; - return (fd); -} - -int sys_creat(const char * pathname, int mode) -{ - return sys_open(pathname, O_CREAT | O_TRUNC, mode); -} - -int sys_close(unsigned int fd) -{ - struct file * filp; - - if (fd >= NR_OPEN) - return -EINVAL; - current->close_on_exec &= ~(1<filp[fd])) - return -EINVAL; - current->filp[fd] = NULL; - if (filp->f_count == 0) - panic("Close: file count is 0"); - if (--filp->f_count) - return (0); - iput(filp->f_inode); - return (0); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/pipe.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/pipe.c deleted file mode 100644 index dfc4480..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/pipe.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * linux/fs/pipe.c - * - * (C) 1991 Linus Torvalds - */ - -#include - -#include -#include /* for get_free_page */ -#include - -int read_pipe(struct m_inode * inode, char * buf, int count) -{ - int chars, size, read = 0; - - while (count>0) { - while (!(size=PIPE_SIZE(*inode))) { - wake_up(&inode->i_wait); - if (inode->i_count != 2) /* are there any writers? */ - return read; - sleep_on(&inode->i_wait); - } - chars = PAGE_SIZE-PIPE_TAIL(*inode); - if (chars > count) - chars = count; - if (chars > size) - chars = size; - count -= chars; - read += chars; - size = PIPE_TAIL(*inode); - PIPE_TAIL(*inode) += chars; - PIPE_TAIL(*inode) &= (PAGE_SIZE-1); - while (chars-->0) - put_fs_byte(((char *)inode->i_size)[size++],buf++); - } - wake_up(&inode->i_wait); - return read; -} - -int write_pipe(struct m_inode * inode, char * buf, int count) -{ - int chars, size, written = 0; - - while (count>0) { - while (!(size=(PAGE_SIZE-1)-PIPE_SIZE(*inode))) { - wake_up(&inode->i_wait); - if (inode->i_count != 2) { /* no readers */ - current->signal |= (1<<(SIGPIPE-1)); - return written?written:-1; - } - sleep_on(&inode->i_wait); - } - chars = PAGE_SIZE-PIPE_HEAD(*inode); - if (chars > count) - chars = count; - if (chars > size) - chars = size; - count -= chars; - written += chars; - size = PIPE_HEAD(*inode); - PIPE_HEAD(*inode) += chars; - PIPE_HEAD(*inode) &= (PAGE_SIZE-1); - while (chars-->0) - ((char *)inode->i_size)[size++]=get_fs_byte(buf++); - } - wake_up(&inode->i_wait); - return written; -} - -int sys_pipe(unsigned long * fildes) -{ - struct m_inode * inode; - struct file * f[2]; - int fd[2]; - int i,j; - - j=0; - for(i=0;j<2 && if_count++; - if (j==1) - f[0]->f_count=0; - if (j<2) - return -1; - j=0; - for(i=0;j<2 && ifilp[i]) { - current->filp[ fd[j]=i ] = f[j]; - j++; - } - if (j==1) - current->filp[fd[0]]=NULL; - if (j<2) { - f[0]->f_count=f[1]->f_count=0; - return -1; - } - if (!(inode=get_pipe_inode())) { - current->filp[fd[0]] = - current->filp[fd[1]] = NULL; - f[0]->f_count = f[1]->f_count = 0; - return -1; - } - f[0]->f_inode = f[1]->f_inode = inode; - f[0]->f_pos = f[1]->f_pos = 0; - f[0]->f_mode = 1; /* read */ - f[1]->f_mode = 2; /* write */ - put_fs_long(fd[0],0+fildes); - put_fs_long(fd[1],1+fildes); - return 0; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/read_write.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/read_write.c deleted file mode 100644 index 341274a..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/read_write.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - * linux/fs/read_write.c - * - * (C) 1991 Linus Torvalds - */ - -#include -#include -#include - -#include -#include -#include - -extern int rw_char(int rw,int dev, char * buf, int count, off_t * pos); -extern int read_pipe(struct m_inode * inode, char * buf, int count); -extern int write_pipe(struct m_inode * inode, char * buf, int count); -extern int block_read(int dev, off_t * pos, char * buf, int count); -extern int block_write(int dev, off_t * pos, char * buf, int count); -extern int file_read(struct m_inode * inode, struct file * filp, - char * buf, int count); -extern int file_write(struct m_inode * inode, struct file * filp, - char * buf, int count); - -int sys_lseek(unsigned int fd,off_t offset, int origin) -{ - struct file * file; - int tmp; - - if (fd >= NR_OPEN || !(file=current->filp[fd]) || !(file->f_inode) - || !IS_SEEKABLE(MAJOR(file->f_inode->i_dev))) - return -EBADF; - if (file->f_inode->i_pipe) - return -ESPIPE; - switch (origin) { - case 0: - if (offset<0) return -EINVAL; - file->f_pos=offset; - break; - case 1: - if (file->f_pos+offset<0) return -EINVAL; - file->f_pos += offset; - break; - case 2: - if ((tmp=file->f_inode->i_size+offset) < 0) - return -EINVAL; - file->f_pos = tmp; - break; - default: - return -EINVAL; - } - return file->f_pos; -} - -int sys_read(unsigned int fd,char * buf,int count) -{ - struct file * file; - struct m_inode * inode; - - if (fd>=NR_OPEN || count<0 || !(file=current->filp[fd])) - return -EINVAL; - if (!count) - return 0; - verify_area(buf,count); - inode = file->f_inode; - if (inode->i_pipe) - return (file->f_mode&1)?read_pipe(inode,buf,count):-EIO; - if (S_ISCHR(inode->i_mode)) - return rw_char(READ,inode->i_zone[0],buf,count,&file->f_pos); - if (S_ISBLK(inode->i_mode)) - return block_read(inode->i_zone[0],&file->f_pos,buf,count); - if (S_ISDIR(inode->i_mode) || S_ISREG(inode->i_mode)) { - if (count+file->f_pos > inode->i_size) - count = inode->i_size - file->f_pos; - if (count<=0) - return 0; - return file_read(inode,file,buf,count); - } - printk("(Read)inode->i_mode=%06o\n\r",inode->i_mode); - return -EINVAL; -} - -int sys_write(unsigned int fd,char * buf,int count) -{ - struct file * file; - struct m_inode * inode; - - if (fd>=NR_OPEN || count <0 || !(file=current->filp[fd])) - return -EINVAL; - if (!count) - return 0; - inode=file->f_inode; - if (inode->i_pipe) - return (file->f_mode&2)?write_pipe(inode,buf,count):-EIO; - if (S_ISCHR(inode->i_mode)) - return rw_char(WRITE,inode->i_zone[0],buf,count,&file->f_pos); - if (S_ISBLK(inode->i_mode)) - return block_write(inode->i_zone[0],&file->f_pos,buf,count); - if (S_ISREG(inode->i_mode)) - return file_write(inode,file,buf,count); - printk("(Write)inode->i_mode=%06o\n\r",inode->i_mode); - return -EINVAL; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/stat.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/stat.c deleted file mode 100644 index 61a4ceb..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/stat.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * linux/fs/stat.c - * - * (C) 1991 Linus Torvalds - */ - -#include -#include - -#include -#include -#include -#include - -static void cp_stat(struct m_inode * inode, struct stat * statbuf) -{ - struct stat tmp; - int i; - - verify_area(statbuf,sizeof (* statbuf)); - tmp.st_dev = inode->i_dev; - tmp.st_ino = inode->i_num; - tmp.st_mode = inode->i_mode; - tmp.st_nlink = inode->i_nlinks; - tmp.st_uid = inode->i_uid; - tmp.st_gid = inode->i_gid; - tmp.st_rdev = inode->i_zone[0]; - tmp.st_size = inode->i_size; - tmp.st_atime = inode->i_atime; - tmp.st_mtime = inode->i_mtime; - tmp.st_ctime = inode->i_ctime; - for (i=0 ; i= NR_OPEN || !(f=current->filp[fd]) || !(inode=f->f_inode)) - return -EBADF; - cp_stat(inode,statbuf); - return 0; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/super.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/super.c deleted file mode 100644 index 39c4089..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/super.c +++ /dev/null @@ -1,281 +0,0 @@ -/* - * linux/fs/super.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * super.c contains code to handle the super-block tables. - */ -#include -#include -#include -#include - -#include -#include - -int sync_dev(int dev); -void wait_for_keypress(void); - -/* set_bit uses setb, as gas doesn't recognize setc */ -#define set_bit(bitnr,addr) ({ \ -register int __res ; \ -__asm__("bt %2,%3;setb %%al":"=a" (__res):"a" (0),"r" (bitnr),"m" (*(addr))); \ -__res; }) - -struct super_block super_block[NR_SUPER]; -/* this is initialized in init/main.c */ -int ROOT_DEV = 0; - -static void lock_super(struct super_block * sb) -{ - cli(); - while (sb->s_lock) - sleep_on(&(sb->s_wait)); - sb->s_lock = 1; - sti(); -} - -static void free_super(struct super_block * sb) -{ - cli(); - sb->s_lock = 0; - wake_up(&(sb->s_wait)); - sti(); -} - -static void wait_on_super(struct super_block * sb) -{ - cli(); - while (sb->s_lock) - sleep_on(&(sb->s_wait)); - sti(); -} - -struct super_block * get_super(int dev) -{ - struct super_block * s; - - if (!dev) - return NULL; - s = 0+super_block; - while (s < NR_SUPER+super_block) - if (s->s_dev == dev) { - wait_on_super(s); - if (s->s_dev == dev) - return s; - s = 0+super_block; - } else - s++; - return NULL; -} - -void put_super(int dev) -{ - struct super_block * sb; - /* struct m_inode * inode;*/ - int i; - - if (dev == ROOT_DEV) { - printk("root diskette changed: prepare for armageddon\n\r"); - return; - } - if (!(sb = get_super(dev))) - return; - if (sb->s_imount) { - printk("Mounted disk changed - tssk, tssk\n\r"); - return; - } - lock_super(sb); - sb->s_dev = 0; - for(i=0;is_imap[i]); - for(i=0;is_zmap[i]); - free_super(sb); - return; -} - -static struct super_block * read_super(int dev) -{ - struct super_block * s; - struct buffer_head * bh; - int i,block; - - if (!dev) - return NULL; - check_disk_change(dev); - if ((s = get_super(dev))) - return s; - for (s = 0+super_block ;; s++) { - if (s >= NR_SUPER+super_block) - return NULL; - if (!s->s_dev) - break; - } - s->s_dev = dev; - s->s_isup = NULL; - s->s_imount = NULL; - s->s_time = 0; - s->s_rd_only = 0; - s->s_dirt = 0; - lock_super(s); - if (!(bh = bread(dev,1))) { - s->s_dev=0; - free_super(s); - return NULL; - } - *((struct d_super_block *) s) = - *((struct d_super_block *) bh->b_data); - brelse(bh); - if (s->s_magic != SUPER_MAGIC) { - s->s_dev = 0; - free_super(s); - return NULL; - } - for (i=0;is_imap[i] = NULL; - for (i=0;is_zmap[i] = NULL; - block=2; - for (i=0 ; i < s->s_imap_blocks ; i++) - if ((s->s_imap[i]=bread(dev,block))) - block++; - else - break; - for (i=0 ; i < s->s_zmap_blocks ; i++) - if ((s->s_zmap[i]=bread(dev,block))) - block++; - else - break; - if (block != 2+s->s_imap_blocks+s->s_zmap_blocks) { - for(i=0;is_imap[i]); - for(i=0;is_zmap[i]); - s->s_dev=0; - free_super(s); - return NULL; - } - s->s_imap[0]->b_data[0] |= 1; - s->s_zmap[0]->b_data[0] |= 1; - free_super(s); - return s; -} - -int sys_umount(char * dev_name) -{ - struct m_inode * inode; - struct super_block * sb; - int dev; - - if (!(inode=namei(dev_name))) - return -ENOENT; - dev = inode->i_zone[0]; - if (!S_ISBLK(inode->i_mode)) { - iput(inode); - return -ENOTBLK; - } - iput(inode); - if (dev==ROOT_DEV) - return -EBUSY; - if (!(sb=get_super(dev)) || !(sb->s_imount)) - return -ENOENT; - if (!sb->s_imount->i_mount) - printk("Mounted inode has i_mount=0\n"); - for (inode=inode_table+0 ; inodei_dev==dev && inode->i_count) - return -EBUSY; - sb->s_imount->i_mount=0; - iput(sb->s_imount); - sb->s_imount = NULL; - iput(sb->s_isup); - sb->s_isup = NULL; - put_super(dev); - sync_dev(dev); - return 0; -} - -int sys_mount(char * dev_name, char * dir_name, int rw_flag) -{ - struct m_inode * dev_i, * dir_i; - struct super_block * sb; - int dev; - - if (!(dev_i=namei(dev_name))) - return -ENOENT; - dev = dev_i->i_zone[0]; - if (!S_ISBLK(dev_i->i_mode)) { - iput(dev_i); - return -EPERM; - } - iput(dev_i); - if (!(dir_i=namei(dir_name))) - return -ENOENT; - if (dir_i->i_count != 1 || dir_i->i_num == ROOT_INO) { - iput(dir_i); - return -EBUSY; - } - if (!S_ISDIR(dir_i->i_mode)) { - iput(dir_i); - return -EPERM; - } - if (!(sb=read_super(dev))) { - iput(dir_i); - return -EBUSY; - } - if (sb->s_imount) { - iput(dir_i); - return -EBUSY; - } - if (dir_i->i_mount) { - iput(dir_i); - return -EPERM; - } - sb->s_imount=dir_i; - dir_i->i_mount=1; - dir_i->i_dirt=1; /* NOTE! we don't iput(dir_i) */ - return 0; /* we do that in umount */ -} - -void mount_root(void) -{ - int i,free; - struct super_block * p; - struct m_inode * mi; - - if (32 != sizeof (struct d_inode)) - panic("bad i-node size"); - for(i=0;is_dev = 0; - p->s_lock = 0; - p->s_wait = NULL; - } - if (!(p=read_super(ROOT_DEV))) - panic("Unable to mount root"); - if (!(mi=iget(ROOT_DEV,ROOT_INO))) - panic("Unable to read root i-node"); - mi->i_count += 3 ; /* NOTE! it is logically used 4 times, not 1 */ - p->s_isup = p->s_imount = mi; - current->pwd = mi; - current->root = mi; - free=0; - i=p->s_nzones; - while (-- i >= 0) - if (!set_bit(i&8191,p->s_zmap[i>>13]->b_data)) - free++; - printk("%d/%d free blocks\n\r",free,p->s_nzones); - free=0; - i=p->s_ninodes+1; - while (-- i >= 0) - if (!set_bit(i&8191,p->s_imap[i>>13]->b_data)) - free++; - printk("%d/%d free inodes\n\r",free,p->s_ninodes); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/truncate.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/truncate.c deleted file mode 100644 index cb22d5f..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/fs/truncate.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * linux/fs/truncate.c - * - * (C) 1991 Linus Torvalds - */ - -#include - -#include - -static void free_ind(int dev,int block) -{ - struct buffer_head * bh; - unsigned short * p; - int i; - - if (!block) - return; - if ((bh=bread(dev,block))) { - p = (unsigned short *) bh->b_data; - for (i=0;i<512;i++,p++) - if (*p) - free_block(dev,*p); - brelse(bh); - } - free_block(dev,block); -} - -static void free_dind(int dev,int block) -{ - struct buffer_head * bh; - unsigned short * p; - int i; - - if (!block) - return; - if ((bh=bread(dev,block))) { - p = (unsigned short *) bh->b_data; - for (i=0;i<512;i++,p++) - if (*p) - free_ind(dev,*p); - brelse(bh); - } - free_block(dev,block); -} - -void truncate(struct m_inode * inode) -{ - int i; - - if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) - return; - for (i=0;i<7;i++) - if (inode->i_zone[i]) { - free_block(inode->i_dev,inode->i_zone[i]); - inode->i_zone[i]=0; - } - free_ind(inode->i_dev,inode->i_zone[7]); - free_dind(inode->i_dev,inode->i_zone[8]); - inode->i_zone[7] = inode->i_zone[8] = 0; - inode->i_size = 0; - inode->i_dirt = 1; - inode->i_mtime = inode->i_ctime = CURRENT_TIME; -} - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/a.out.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/a.out.h deleted file mode 100644 index 3e67974..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/a.out.h +++ /dev/null @@ -1,220 +0,0 @@ -#ifndef _A_OUT_H -#define _A_OUT_H - -#define __GNU_EXEC_MACROS__ - -struct exec { - unsigned long a_magic; /* Use macros N_MAGIC, etc for access */ - unsigned a_text; /* length of text, in bytes */ - unsigned a_data; /* length of data, in bytes */ - unsigned a_bss; /* length of uninitialized data area for file, in bytes */ - unsigned a_syms; /* length of symbol table data in file, in bytes */ - unsigned a_entry; /* start address */ - unsigned a_trsize; /* length of relocation info for text, in bytes */ - unsigned a_drsize; /* length of relocation info for data, in bytes */ -}; - -#ifndef N_MAGIC -#define N_MAGIC(exec) ((exec).a_magic) -#endif - -#ifndef OMAGIC -/* Code indicating object file or impure executable. */ -#define OMAGIC 0407 -/* Code indicating pure executable. */ -#define NMAGIC 0410 -/* Code indicating demand-paged executable. */ -#define ZMAGIC 0413 -#endif /* not OMAGIC */ - -#ifndef N_BADMAG -#define N_BADMAG(x) \ - (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \ - && N_MAGIC(x) != ZMAGIC) -#endif - -#define _N_BADMAG(x) \ - (N_MAGIC(x) != OMAGIC && N_MAGIC(x) != NMAGIC \ - && N_MAGIC(x) != ZMAGIC) - -#define _N_HDROFF(x) (SEGMENT_SIZE - sizeof (struct exec)) - -#ifndef N_TXTOFF -#define N_TXTOFF(x) \ - (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : sizeof (struct exec)) -#endif - -#ifndef N_DATOFF -#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text) -#endif - -#ifndef N_TRELOFF -#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data) -#endif - -#ifndef N_DRELOFF -#define N_DRELOFF(x) (N_TRELOFF(x) + (x).a_trsize) -#endif - -#ifndef N_SYMOFF -#define N_SYMOFF(x) (N_DRELOFF(x) + (x).a_drsize) -#endif - -#ifndef N_STROFF -#define N_STROFF(x) (N_SYMOFF(x) + (x).a_syms) -#endif - -/* Address of text segment in memory after it is loaded. */ -#ifndef N_TXTADDR -#define N_TXTADDR(x) 0 -#endif - -/* Address of data segment in memory after it is loaded. - Note that it is up to you to define SEGMENT_SIZE - on machines not listed here. */ -#if defined(vax) || defined(hp300) || defined(pyr) -#define SEGMENT_SIZE PAGE_SIZE -#endif -#ifdef hp300 -#define PAGE_SIZE 4096 -#endif -#ifdef sony -#define SEGMENT_SIZE 0x2000 -#endif /* Sony. */ -#ifdef is68k -#define SEGMENT_SIZE 0x20000 -#endif -#if defined(m68k) && defined(PORTAR) -#define PAGE_SIZE 0x400 -#define SEGMENT_SIZE PAGE_SIZE -#endif - -#define PAGE_SIZE 4096 -#define SEGMENT_SIZE 1024 - -#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1)) - -#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) - -#ifndef N_DATADDR -#define N_DATADDR(x) \ - (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x)) \ - : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) -#endif - -/* Address of bss segment in memory after it is loaded. */ -#ifndef N_BSSADDR -#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data) -#endif - -#ifndef N_NLIST_DECLARED -struct nlist { - union { - char *n_name; - struct nlist *n_next; - long n_strx; - } n_un; - unsigned char n_type; - char n_other; - short n_desc; - unsigned long n_value; -}; -#endif - -#ifndef N_UNDF -#define N_UNDF 0 -#endif -#ifndef N_ABS -#define N_ABS 2 -#endif -#ifndef N_TEXT -#define N_TEXT 4 -#endif -#ifndef N_DATA -#define N_DATA 6 -#endif -#ifndef N_BSS -#define N_BSS 8 -#endif -#ifndef N_COMM -#define N_COMM 18 -#endif -#ifndef N_FN -#define N_FN 15 -#endif - -#ifndef N_EXT -#define N_EXT 1 -#endif -#ifndef N_TYPE -#define N_TYPE 036 -#endif -#ifndef N_STAB -#define N_STAB 0340 -#endif - -/* The following type indicates the definition of a symbol as being - an indirect reference to another symbol. The other symbol - appears as an undefined reference, immediately following this symbol. - - Indirection is asymmetrical. The other symbol's value will be used - to satisfy requests for the indirect symbol, but not vice versa. - If the other symbol does not have a definition, libraries will - be searched to find a definition. */ -#define N_INDR 0xa - -/* The following symbols refer to set elements. - All the N_SET[ATDB] symbols with the same name form one set. - Space is allocated for the set in the text section, and each set - element's value is stored into one word of the space. - The first word of the space is the length of the set (number of elements). - - The address of the set is made into an N_SETV symbol - whose name is the same as the name of the set. - This symbol acts like a N_DATA global symbol - in that it can satisfy undefined external references. */ - -/* These appear as input to LD, in a .o file. */ -#define N_SETA 0x14 /* Absolute set element symbol */ -#define N_SETT 0x16 /* Text set element symbol */ -#define N_SETD 0x18 /* Data set element symbol */ -#define N_SETB 0x1A /* Bss set element symbol */ - -/* This is output from LD. */ -#define N_SETV 0x1C /* Pointer to set vector in data area. */ - -#ifndef N_RELOCATION_INFO_DECLARED - -/* This structure describes a single relocation to be performed. - The text-relocation section of the file is a vector of these structures, - all of which apply to the text section. - Likewise, the data-relocation section applies to the data section. */ - -struct relocation_info -{ - /* Address (within segment) to be relocated. */ - int r_address; - /* The meaning of r_symbolnum depends on r_extern. */ - unsigned int r_symbolnum:24; - /* Nonzero means value is a pc-relative offset - and it should be relocated for changes in its own address - as well as for changes in the symbol or section specified. */ - unsigned int r_pcrel:1; - /* Length (as exponent of 2) of the field to be relocated. - Thus, a value of 2 indicates 1<<2 bytes. */ - unsigned int r_length:2; - /* 1 => relocate with value of symbol. - r_symbolnum is the index of the symbol - in file's the symbol table. - 0 => relocate with the address of a segment. - r_symbolnum is N_TEXT, N_DATA, N_BSS or N_ABS - (the N_EXT bit may be set also, but signifies nothing). */ - unsigned int r_extern:1; - /* Four bits that aren't used, but when writing an object file - it is desirable to clear them. */ - unsigned int r_pad:4; -}; -#endif /* no N_RELOCATION_INFO_DECLARED. */ - - -#endif /* __A_OUT_GNU_H__ */ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/io.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/io.h deleted file mode 100644 index d5cc42a..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/io.h +++ /dev/null @@ -1,24 +0,0 @@ -#define outb(value,port) \ -__asm__ ("outb %%al,%%dx"::"a" (value),"d" (port)) - - -#define inb(port) ({ \ -unsigned char _v; \ -__asm__ volatile ("inb %%dx,%%al":"=a" (_v):"d" (port)); \ -_v; \ -}) - -#define outb_p(value,port) \ -__asm__ ("outb %%al,%%dx\n" \ - "\tjmp 1f\n" \ - "1:\tjmp 1f\n" \ - "1:"::"a" (value),"d" (port)) - -#define inb_p(port) ({ \ -unsigned char _v; \ -__asm__ volatile ("inb %%dx,%%al\n" \ - "\tjmp 1f\n" \ - "1:\tjmp 1f\n" \ - "1:":"=a" (_v):"d" (port)); \ -_v; \ -}) diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/memory.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/memory.h deleted file mode 100644 index 4457420..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/memory.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * NOTE!!! memcpy(dest,src,n) assumes ds=es=normal data segment. This - * goes for all kernel functions (ds=es=kernel space, fs=local data, - * gs=null), as well as for all well-behaving user programs (ds=es= - * user data space). This is NOT a bug, as any user program that changes - * es deserves to die if it isn't careful. - */ -#define memcpy(dest,src,n) ({ \ -void * _res = dest; \ -__asm__ ("cld;rep;movsb" \ - ::"D" ((long)(_res)),"S" ((long)(src)),"c" ((long) (n)) \ - ); \ -_res; \ -}) diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/segment.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/segment.h deleted file mode 100644 index 94dd102..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/segment.h +++ /dev/null @@ -1,65 +0,0 @@ -static inline unsigned char get_fs_byte(const char * addr) -{ - unsigned register char _v; - - __asm__ ("movb %%fs:%1,%0":"=r" (_v):"m" (*addr)); - return _v; -} - -static inline unsigned short get_fs_word(const unsigned short *addr) -{ - unsigned short _v; - - __asm__ ("movw %%fs:%1,%0":"=r" (_v):"m" (*addr)); - return _v; -} - -static inline unsigned long get_fs_long(const unsigned long *addr) -{ - unsigned long _v; - - __asm__ ("movl %%fs:%1,%0":"=r" (_v):"m" (*addr)); \ - return _v; -} - -static inline void put_fs_byte(char val,char *addr) -{ -__asm__ ("movb %0,%%fs:%1"::"r" (val),"m" (*addr)); -} - -static inline void put_fs_word(short val,short * addr) -{ -__asm__ ("movw %0,%%fs:%1"::"r" (val),"m" (*addr)); -} - -static inline void put_fs_long(unsigned long val,unsigned long * addr) -{ -__asm__ ("movl %0,%%fs:%1"::"r" (val),"m" (*addr)); -} - -/* - * Someone who knows GNU asm better than I should double check the followig. - * It seems to work, but I don't know if I'm doing something subtly wrong. - * --- TYT, 11/24/91 - * [ nothing wrong here, Linus ] - */ - -static inline unsigned long get_fs() -{ - unsigned short _v; - __asm__("mov %%fs,%%ax":"=a" (_v):); - return _v; -} - -static inline unsigned long get_ds() -{ - unsigned short _v; - __asm__("mov %%ds,%%ax":"=a" (_v):); - return _v; -} - -static inline void set_fs(unsigned long val) -{ - __asm__("mov %0,%%fs"::"a" ((unsigned short) val)); -} - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/system.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/system.h deleted file mode 100644 index 9bc027a..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/asm/system.h +++ /dev/null @@ -1,67 +0,0 @@ -#define move_to_user_mode() \ -__asm__ ("movl %%esp,%%eax\n\t" \ - "pushl $0x17\n\t" \ - "pushl %%eax\n\t" \ - "pushfl\n\t" \ - "pushl $0x0f\n\t" \ - "pushl $1f\n\t" \ - "iret\n" \ - "1:\tmovl $0x17,%%eax\n\t" \ - "movw %%ax,%%ds\n\t" \ - "movw %%ax,%%es\n\t" \ - "movw %%ax,%%fs\n\t" \ - "movw %%ax,%%gs" \ - :::"ax") - -#define sti() __asm__ ("sti"::) -#define cli() __asm__ ("cli"::) -#define nop() __asm__ ("nop"::) - -#define iret() __asm__ ("iret"::) - -#define _set_gate(gate_addr,type,dpl,addr) \ -__asm__ ("movw %%dx,%%ax\n\t" \ - "movw %0,%%dx\n\t" \ - "movl %%eax,%1\n\t" \ - "movl %%edx,%2" \ - : \ - : "i" ((short) (0x8000+(dpl<<13)+(type<<8))), \ - "o" (*((char *) (gate_addr))), \ - "o" (*(4+(char *) (gate_addr))), \ - "d" ((char *) (addr)),"a" (0x00080000)) - -#define set_intr_gate(n,addr) \ - _set_gate(&idt[n],14,0,addr) - -#define set_trap_gate(n,addr) \ - _set_gate(&idt[n],15,0,addr) - -#define set_system_gate(n,addr) \ - _set_gate(&idt[n],15,3,addr) - -#define _set_seg_desc(gate_addr,type,dpl,base,limit) {\ - *(gate_addr) = ((base) & 0xff000000) | \ - (((base) & 0x00ff0000)>>16) | \ - ((limit) & 0xf0000) | \ - ((dpl)<<13) | \ - (0x00408000) | \ - ((type)<<8); \ - *((gate_addr)+1) = (((base) & 0x0000ffff)<<16) | \ - ((limit) & 0x0ffff); } - -#define _set_tssldt_desc(n,addr,type) \ -__asm__ ("movw $104,%1\n\t" \ - "movw %%ax,%2\n\t" \ - "rorl $16,%%eax\n\t" \ - "movb %%al,%3\n\t" \ - "movb $" type ",%4\n\t" \ - "movb $0x00,%5\n\t" \ - "movb %%ah,%6\n\t" \ - "rorl $16,%%eax" \ - ::"a" (addr), "m" (*(n)), "m" (*(n+2)), "m" (*(n+4)), \ - "m" (*(n+5)), "m" (*(n+6)), "m" (*(n+7)) \ - ) - -#define set_tss_desc(n,addr) _set_tssldt_desc(((char *) (n)),((int)(addr)),"0x89") -#define set_ldt_desc(n,addr) _set_tssldt_desc(((char *) (n)),((int)(addr)),"0x82") - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/const.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/const.h deleted file mode 100644 index 7828e61..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/const.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _CONST_H -#define _CONST_H - -#define BUFFER_END 0x200000 - -#define I_TYPE 0170000 -#define I_DIRECTORY 0040000 -#define I_REGULAR 0100000 -#define I_BLOCK_SPECIAL 0060000 -#define I_CHAR_SPECIAL 0020000 -#define I_NAMED_PIPE 0010000 -#define I_SET_UID_BIT 0004000 -#define I_SET_GID_BIT 0002000 - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/ctype.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/ctype.h deleted file mode 100644 index 7acf55d..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/ctype.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef _CTYPE_H -#define _CTYPE_H - -#define _U 0x01 /* upper */ -#define _L 0x02 /* lower */ -#define _D 0x04 /* digit */ -#define _C 0x08 /* cntrl */ -#define _P 0x10 /* punct */ -#define _S 0x20 /* white space (space/lf/tab) */ -#define _X 0x40 /* hex digit */ -#define _SP 0x80 /* hard space (0x20) */ - -extern unsigned char _ctype[]; -extern char _ctmp; - -#define isalnum(c) ((_ctype+1)[c]&(_U|_L|_D)) -#define isalpha(c) ((_ctype+1)[c]&(_U|_L)) -#define iscntrl(c) ((_ctype+1)[c]&(_C)) -#define isdigit(c) ((_ctype+1)[c]&(_D)) -#define isgraph(c) ((_ctype+1)[c]&(_P|_U|_L|_D)) -#define islower(c) ((_ctype+1)[c]&(_L)) -#define isprint(c) ((_ctype+1)[c]&(_P|_U|_L|_D|_SP)) -#define ispunct(c) ((_ctype+1)[c]&(_P)) -#define isspace(c) ((_ctype+1)[c]&(_S)) -#define isupper(c) ((_ctype+1)[c]&(_U)) -#define isxdigit(c) ((_ctype+1)[c]&(_D|_X)) - -#define isascii(c) (((unsigned) c)<=0x7f) -#define toascii(c) (((unsigned) c)&0x7f) - -#define tolower(c) (_ctmp=c,isupper(_ctmp)?_ctmp-('A'-'a'):_ctmp) -#define toupper(c) (_ctmp=c,islower(_ctmp)?_ctmp-('a'-'A'):_ctmp) - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/errno.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/errno.h deleted file mode 100644 index c282f69..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/errno.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef _ERRNO_H -#define _ERRNO_H - -/* - * ok, as I hadn't got any other source of information about - * possible error numbers, I was forced to use the same numbers - * as minix. - * Hopefully these are posix or something. I wouldn't know (and posix - * isn't telling me - they want $$$ for their f***ing standard). - * - * We don't use the _SIGN cludge of minix, so kernel returns must - * see to the sign by themselves. - * - * NOTE! Remember to change strerror() if you change this file! - */ - -extern int errno; - -#define ERROR 99 -#define EPERM 1 -#define ENOENT 2 -#define ESRCH 3 -#define EINTR 4 -#define EIO 5 -#define ENXIO 6 -#define E2BIG 7 -#define ENOEXEC 8 -#define EBADF 9 -#define ECHILD 10 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EFAULT 14 -#define ENOTBLK 15 -#define EBUSY 16 -#define EEXIST 17 -#define EXDEV 18 -#define ENODEV 19 -#define ENOTDIR 20 -#define EISDIR 21 -#define EINVAL 22 -#define ENFILE 23 -#define EMFILE 24 -#define ENOTTY 25 -#define ETXTBSY 26 -#define EFBIG 27 -#define ENOSPC 28 -#define ESPIPE 29 -#define EROFS 30 -#define EMLINK 31 -#define EPIPE 32 -#define EDOM 33 -#define ERANGE 34 -#define EDEADLK 35 -#define ENAMETOOLONG 36 -#define ENOLCK 37 -#define ENOSYS 38 -#define ENOTEMPTY 39 - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/fcntl.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/fcntl.h deleted file mode 100644 index a5bf9af..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/fcntl.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _FCNTL_H -#define _FCNTL_H - -#include - -/* open/fcntl - NOCTTY, NDELAY isn't implemented yet */ -#define O_ACCMODE 00003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 -#define O_CREAT 00100 /* not fcntl */ -#define O_EXCL 00200 /* not fcntl */ -#define O_NOCTTY 00400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 /* not fcntl */ -#define O_NDELAY O_NONBLOCK - -/* Defines for fcntl-commands. Note that currently - * locking isn't supported, and other things aren't really - * tested. - */ -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get f_flags */ -#define F_SETFD 2 /* set f_flags */ -#define F_GETFL 3 /* more flags (cloexec) */ -#define F_SETFL 4 -#define F_GETLK 5 /* not implemented */ -#define F_SETLK 6 -#define F_SETLKW 7 - -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - -/* Ok, these are locking features, and aren't implemented at any - * level. POSIX wants them. - */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* Once again - not implemented, but ... */ -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - -extern int creat(const char * filename,mode_t mode); -extern int fcntl(int fildes,int cmd, ...); -extern int open(const char * filename, int flags, ...); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/config.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/config.h deleted file mode 100644 index 819b525..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/config.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _CONFIG_H -#define _CONFIG_H - -/* - * The root-device is no longer hard-coded. You can change the default - * root-device by changing the line ROOT_DEV = XXX in boot/bootsect.s - */ - -/* - * define your keyboard here - - * KBD_FINNISH for Finnish keyboards - * KBD_US for US-type - * KBD_GR for German keyboards - * KBD_FR for Frech keyboard - */ -#define KBD_US -/*#define KBD_GR */ -/*#define KBD_FR */ -/*#define KBD_FINNISH */ - -/* - * Normally, Linux can get the drive parameters from the BIOS at - * startup, but if this for some unfathomable reason fails, you'd - * be left stranded. For this case, you can define HD_TYPE, which - * contains all necessary info on your harddisk. - * - * The HD_TYPE macro should look like this: - * - * #define HD_TYPE { head, sect, cyl, wpcom, lzone, ctl} - * - * In case of two harddisks, the info should be sepatated by - * commas: - * - * #define HD_TYPE { h,s,c,wpcom,lz,ctl },{ h,s,c,wpcom,lz,ctl } - */ -/* - This is an example, two drives, first is type 2, second is type 3: - -#define HD_TYPE { 4,17,615,300,615,8 }, { 6,17,615,300,615,0 } - - NOTE: ctl is 0 for all drives with heads<=8, and ctl=8 for drives - with more than 8 heads. - - If you want the BIOS to tell what kind of drive you have, just - leave HD_TYPE undefined. This is the normal thing to do. -*/ - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/fdreg.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/fdreg.h deleted file mode 100644 index 01355af..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/fdreg.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * This file contains some defines for the floppy disk controller. - * Various sources. Mostly "IBM Microcomputers: A Programmers - * Handbook", Sanches and Canton. - */ -#ifndef _FDREG_H -#define _FDREG_H - -extern int ticks_to_floppy_on(unsigned int nr); -extern void floppy_on(unsigned int nr); -extern void floppy_off(unsigned int nr); -extern void floppy_select(unsigned int nr); -extern void floppy_deselect(unsigned int nr); - -/* Fd controller regs. S&C, about page 340 */ -#define FD_STATUS 0x3f4 -#define FD_DATA 0x3f5 -#define FD_DOR 0x3f2 /* Digital Output Register */ -#define FD_DIR 0x3f7 /* Digital Input Register (read) */ -#define FD_DCR 0x3f7 /* Diskette Control Register (write)*/ - -/* Bits of main status register */ -#define STATUS_BUSYMASK 0x0F /* drive busy mask */ -#define STATUS_BUSY 0x10 /* FDC busy */ -#define STATUS_DMA 0x20 /* 0- DMA mode */ -#define STATUS_DIR 0x40 /* 0- cpu->fdc */ -#define STATUS_READY 0x80 /* Data reg ready */ - -/* Bits of FD_ST0 */ -#define ST0_DS 0x03 /* drive select mask */ -#define ST0_HA 0x04 /* Head (Address) */ -#define ST0_NR 0x08 /* Not Ready */ -#define ST0_ECE 0x10 /* Equipment chech error */ -#define ST0_SE 0x20 /* Seek end */ -#define ST0_INTR 0xC0 /* Interrupt code mask */ - -/* Bits of FD_ST1 */ -#define ST1_MAM 0x01 /* Missing Address Mark */ -#define ST1_WP 0x02 /* Write Protect */ -#define ST1_ND 0x04 /* No Data - unreadable */ -#define ST1_OR 0x10 /* OverRun */ -#define ST1_CRC 0x20 /* CRC error in data or addr */ -#define ST1_EOC 0x80 /* End Of Cylinder */ - -/* Bits of FD_ST2 */ -#define ST2_MAM 0x01 /* Missing Addess Mark (again) */ -#define ST2_BC 0x02 /* Bad Cylinder */ -#define ST2_SNS 0x04 /* Scan Not Satisfied */ -#define ST2_SEH 0x08 /* Scan Equal Hit */ -#define ST2_WC 0x10 /* Wrong Cylinder */ -#define ST2_CRC 0x20 /* CRC error in data field */ -#define ST2_CM 0x40 /* Control Mark = deleted */ - -/* Bits of FD_ST3 */ -#define ST3_HA 0x04 /* Head (Address) */ -#define ST3_TZ 0x10 /* Track Zero signal (1=track 0) */ -#define ST3_WP 0x40 /* Write Protect */ - -/* Values for FD_COMMAND */ -#define FD_RECALIBRATE 0x07 /* move to track 0 */ -#define FD_SEEK 0x0F /* seek track */ -#define FD_READ 0xE6 /* read with MT, MFM, SKip deleted */ -#define FD_WRITE 0xC5 /* write with MT, MFM */ -#define FD_SENSEI 0x08 /* Sense Interrupt Status */ -#define FD_SPECIFY 0x03 /* specify HUT etc */ - -/* DMA commands */ -#define DMA_READ 0x46 -#define DMA_WRITE 0x4A - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/fs.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/fs.h deleted file mode 100644 index 7a90b10..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/fs.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - * This file has definitions for some important file table - * structures etc. - */ - -#ifndef _FS_H -#define _FS_H - -#include - -/* devices are as follows: (same as minix, so we can use the minix - * file system. These are major numbers.) - * - * 0 - unused (nodev) - * 1 - /dev/mem - * 2 - /dev/fd - * 3 - /dev/hd - * 4 - /dev/ttyx - * 5 - /dev/tty - * 6 - /dev/lp - * 7 - unnamed pipes - */ - -#define IS_SEEKABLE(x) ((x)>=1 && (x)<=3) - -#define READ 0 -#define WRITE 1 -#define READA 2 /* read-ahead - don't pause */ -#define WRITEA 3 /* "write-ahead" - silly, but somewhat useful */ - -void buffer_init(long buffer_end); - -#define MAJOR(a) (((unsigned)(a))>>8) -#define MINOR(a) ((a)&0xff) - -#define NAME_LEN 14 -#define ROOT_INO 1 - -#define I_MAP_SLOTS 8 -#define Z_MAP_SLOTS 8 -#define SUPER_MAGIC 0x137F - -#define NR_OPEN 20 -#define NR_INODE 32 -#define NR_FILE 64 -#define NR_SUPER 8 -#define NR_HASH 307 -#define NR_BUFFERS nr_buffers -#define BLOCK_SIZE 1024 -#define BLOCK_SIZE_BITS 10 -#ifndef NULL -#define NULL ((void *) 0) -#endif - -#define INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct d_inode))) -#define DIR_ENTRIES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct dir_entry))) - -#define PIPE_HEAD(inode) ((inode).i_zone[0]) -#define PIPE_TAIL(inode) ((inode).i_zone[1]) -#define PIPE_SIZE(inode) ((PIPE_HEAD(inode)-PIPE_TAIL(inode))&(PAGE_SIZE-1)) -#define PIPE_EMPTY(inode) (PIPE_HEAD(inode)==PIPE_TAIL(inode)) -#define PIPE_FULL(inode) (PIPE_SIZE(inode)==(PAGE_SIZE-1)) -#define INC_PIPE(head) \ -__asm__("incl %0\n\tandl $4095,%0"::"m" (head)) - -typedef char buffer_block[BLOCK_SIZE]; - -struct buffer_head { - char * b_data; /* pointer to data block (1024 bytes) */ - unsigned long b_blocknr; /* block number */ - unsigned short b_dev; /* device (0 = free) */ - unsigned char b_uptodate; - unsigned char b_dirt; /* 0-clean,1-dirty */ - unsigned char b_count; /* users using this block */ - unsigned char b_lock; /* 0 - ok, 1 -locked */ - struct task_struct * b_wait; - struct buffer_head * b_prev; - struct buffer_head * b_next; - struct buffer_head * b_prev_free; - struct buffer_head * b_next_free; -}; - -struct d_inode { - unsigned short i_mode; - unsigned short i_uid; - unsigned long i_size; - unsigned long i_time; - unsigned char i_gid; - unsigned char i_nlinks; - unsigned short i_zone[9]; -}; - -struct m_inode { - unsigned short i_mode; - unsigned short i_uid; - unsigned long i_size; - unsigned long i_mtime; - unsigned char i_gid; - unsigned char i_nlinks; - unsigned short i_zone[9]; -/* these are in memory also */ - struct task_struct * i_wait; - unsigned long i_atime; - unsigned long i_ctime; - unsigned short i_dev; - unsigned short i_num; - unsigned short i_count; - unsigned char i_lock; - unsigned char i_dirt; - unsigned char i_pipe; - unsigned char i_mount; - unsigned char i_seek; - unsigned char i_update; -}; - -struct file { - unsigned short f_mode; - unsigned short f_flags; - unsigned short f_count; - struct m_inode * f_inode; - off_t f_pos; -}; - -struct super_block { - unsigned short s_ninodes; - unsigned short s_nzones; - unsigned short s_imap_blocks; - unsigned short s_zmap_blocks; - unsigned short s_firstdatazone; - unsigned short s_log_zone_size; - unsigned long s_max_size; - unsigned short s_magic; -/* These are only in memory */ - struct buffer_head * s_imap[8]; - struct buffer_head * s_zmap[8]; - unsigned short s_dev; - struct m_inode * s_isup; - struct m_inode * s_imount; - unsigned long s_time; - struct task_struct * s_wait; - unsigned char s_lock; - unsigned char s_rd_only; - unsigned char s_dirt; -}; - -struct d_super_block { - unsigned short s_ninodes; - unsigned short s_nzones; - unsigned short s_imap_blocks; - unsigned short s_zmap_blocks; - unsigned short s_firstdatazone; - unsigned short s_log_zone_size; - unsigned long s_max_size; - unsigned short s_magic; -}; - -struct dir_entry { - unsigned short inode; - char name[NAME_LEN]; -}; - -extern struct m_inode inode_table[NR_INODE]; -extern struct file file_table[NR_FILE]; -extern struct super_block super_block[NR_SUPER]; -extern struct buffer_head * start_buffer; -extern int nr_buffers; - -extern void check_disk_change(int dev); -extern int floppy_change(unsigned int nr); -extern int ticks_to_floppy_on(unsigned int dev); -extern void floppy_on(unsigned int dev); -extern void floppy_off(unsigned int dev); -extern void truncate(struct m_inode * inode); -extern void sync_inodes(void); -extern void wait_on(struct m_inode * inode); -extern int bmap(struct m_inode * inode,int block); -extern int create_block(struct m_inode * inode,int block); -extern struct m_inode * namei(const char * pathname); -extern int open_namei(const char * pathname, int flag, int mode, - struct m_inode ** res_inode); -extern void iput(struct m_inode * inode); -extern struct m_inode * iget(int dev,int nr); -extern struct m_inode * get_empty_inode(void); -extern struct m_inode * get_pipe_inode(void); -extern struct buffer_head * get_hash_table(int dev, int block); -extern struct buffer_head * getblk(int dev, int block); -extern void ll_rw_block(int rw, struct buffer_head * bh); -extern void brelse(struct buffer_head * buf); -extern struct buffer_head * bread(int dev,int block); -extern void bread_page(unsigned long addr,int dev,int b[4]); -extern struct buffer_head * breada(int dev,int block,...); -extern int new_block(int dev); -extern void free_block(int dev, int block); -extern struct m_inode * new_inode(int dev); -extern void free_inode(struct m_inode * inode); -extern int sync_dev(int dev); -extern struct super_block * get_super(int dev); -extern int ROOT_DEV; - -extern void mount_root(void); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/hdreg.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/hdreg.h deleted file mode 100644 index e6c593f..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/hdreg.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * This file contains some defines for the AT-hd-controller. - * Various sources. Check out some definitions (see comments with - * a ques). - */ -#ifndef _HDREG_H -#define _HDREG_H - -/* Hd controller regs. Ref: IBM AT Bios-listing */ -#define HD_DATA 0x1f0 /* _CTL when writing */ -#define HD_ERROR 0x1f1 /* see err-bits */ -#define HD_NSECTOR 0x1f2 /* nr of sectors to read/write */ -#define HD_SECTOR 0x1f3 /* starting sector */ -#define HD_LCYL 0x1f4 /* starting cylinder */ -#define HD_HCYL 0x1f5 /* high byte of starting cyl */ -#define HD_CURRENT 0x1f6 /* 101dhhhh , d=drive, hhhh=head */ -#define HD_STATUS 0x1f7 /* see status-bits */ -#define HD_PRECOMP HD_ERROR /* same io address, read=error, write=precomp */ -#define HD_COMMAND HD_STATUS /* same io address, read=status, write=cmd */ - -#define HD_CMD 0x3f6 - -/* Bits of HD_STATUS */ -#define ERR_STAT 0x01 -#define INDEX_STAT 0x02 -#define ECC_STAT 0x04 /* Corrected error */ -#define DRQ_STAT 0x08 -#define SEEK_STAT 0x10 -#define WRERR_STAT 0x20 -#define READY_STAT 0x40 -#define BUSY_STAT 0x80 - -/* Values for HD_COMMAND */ -#define WIN_RESTORE 0x10 -#define WIN_READ 0x20 -#define WIN_WRITE 0x30 -#define WIN_VERIFY 0x40 -#define WIN_FORMAT 0x50 -#define WIN_INIT 0x60 -#define WIN_SEEK 0x70 -#define WIN_DIAGNOSE 0x90 -#define WIN_SPECIFY 0x91 - -/* Bits for HD_ERROR */ -#define MARK_ERR 0x01 /* Bad address mark ? */ -#define TRK0_ERR 0x02 /* couldn't find track 0 */ -#define ABRT_ERR 0x04 /* ? */ -#define ID_ERR 0x10 /* ? */ -#define ECC_ERR 0x40 /* ? */ -#define BBD_ERR 0x80 /* ? */ - -struct partition { - unsigned char boot_ind; /* 0x80 - active (unused) */ - unsigned char head; /* ? */ - unsigned char sector; /* ? */ - unsigned char cyl; /* ? */ - unsigned char sys_ind; /* ? */ - unsigned char end_head; /* ? */ - unsigned char end_sector; /* ? */ - unsigned char end_cyl; /* ? */ - unsigned int start_sect; /* starting sector counting from 0 */ - unsigned int nr_sects; /* nr of sectors in partition */ -}; - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/head.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/head.h deleted file mode 100644 index db3dda2..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/head.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _HEAD_H -#define _HEAD_H - -typedef struct desc_struct { - unsigned long a,b; -} desc_table[256]; - -extern unsigned long pg_dir[1024]; -extern desc_table idt,gdt; - -#define GDT_NUL 0 -#define GDT_CODE 1 -#define GDT_DATA 2 -#define GDT_TMP 3 - -#define LDT_NUL 0 -#define LDT_CODE 1 -#define LDT_DATA 2 - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/kernel.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/kernel.h deleted file mode 100644 index cb40dd5..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/kernel.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 'kernel.h' contains some often-used function prototypes etc - */ -void verify_area(void * addr,int count); -volatile void panic(const char * str); -int printf(const char * fmt, ...); -int printk(const char * fmt, ...); -int tty_write(unsigned ch,char * buf,int count); -void * malloc(unsigned int size); -void free_s(void * obj, int size); - -#define free(x) free_s((x), 0) - -/* - * This is defined as a macro, but at some point this might become a - * real subroutine that sets a flag if it returns true (to do - * BSD-style accounting where the process is flagged if it uses root - * privs). The implication of this is that you should do normal - * permissions checks first, and check suser() last. - */ -#define suser() (current->euid == 0) - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/mm.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/mm.h deleted file mode 100644 index 5a160f3..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/mm.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _MM_H -#define _MM_H - -#define PAGE_SIZE 4096 - -extern unsigned long get_free_page(void); -extern unsigned long put_page(unsigned long page,unsigned long address); -extern void free_page(unsigned long addr); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sched.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sched.h deleted file mode 100644 index 53ffbe8..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sched.h +++ /dev/null @@ -1,256 +0,0 @@ -#ifndef _SCHED_H -#define _SCHED_H - -#define NR_TASKS 64 -#define HZ 100 - -#define FIRST_TASK task[0] -#define LAST_TASK task[NR_TASKS-1] - -#include -#include -#include -#include - -#if (NR_OPEN > 32) -#error "Currently the close-on-exec-flags are in one word, max 32 files/proc" -#endif - -#define TASK_RUNNING 0 -#define TASK_INTERRUPTIBLE 1 -#define TASK_UNINTERRUPTIBLE 2 -#define TASK_ZOMBIE 3 -#define TASK_STOPPED 4 - -#ifndef NULL -#define NULL ((void *) 0) -#endif - -extern int copy_page_tables(unsigned long from, unsigned long to, long size); -extern int free_page_tables(unsigned long from, unsigned long size); - -extern void sched_init(void); -extern void schedule(void); -extern void trap_init(void); -#ifndef PANIC -volatile void panic(const char * str); -#endif -extern int tty_write(unsigned minor,char * buf,int count); - -typedef int (*fn_ptr)(); - -struct i387_struct { - long cwd; - long swd; - long twd; - long fip; - long fcs; - long foo; - long fos; - long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */ -}; - -struct tss_struct { - long back_link; /* 16 high bits zero */ - long esp0; - long ss0; /* 16 high bits zero */ - long esp1; - long ss1; /* 16 high bits zero */ - long esp2; - long ss2; /* 16 high bits zero */ - long cr3; - long eip; - long eflags; - long eax,ecx,edx,ebx; - long esp; - long ebp; - long esi; - long edi; - long es; /* 16 high bits zero */ - long cs; /* 16 high bits zero */ - long ss; /* 16 high bits zero */ - long ds; /* 16 high bits zero */ - long fs; /* 16 high bits zero */ - long gs; /* 16 high bits zero */ - long ldt; /* 16 high bits zero */ - long trace_bitmap; /* bits: trace 0, bitmap 16-31 */ - struct i387_struct i387; -}; - -struct task_struct { -/* these are hardcoded - don't touch */ - long state; /* -1 unrunnable, 0 runnable, >0 stopped */ - long counter; - long priority; - long signal; - struct sigaction sigaction[32]; - long blocked; /* bitmap of masked signals */ -/* various fields */ - int exit_code; - unsigned long start_code,end_code,end_data,brk,start_stack; - long pid,father,pgrp,session,leader; - unsigned short uid,euid,suid; - unsigned short gid,egid,sgid; - long alarm; - long utime,stime,cutime,cstime,start_time; - unsigned short used_math; -/* file system info */ - int tty; /* -1 if no tty, so it must be signed */ - unsigned short umask; - struct m_inode * pwd; - struct m_inode * root; - struct m_inode * executable; - unsigned long close_on_exec; - struct file * filp[NR_OPEN]; -/* ldt for this task 0 - zero 1 - cs 2 - ds&ss */ - struct desc_struct ldt[3]; -/* tss for this task */ - struct tss_struct tss; -}; - -/* - * INIT_TASK is used to set up the first task table, touch at - * your own risk!. Base=0, limit=0x9ffff (=640kB) - */ -#define INIT_TASK \ -/* state etc */ { 0,15,15, \ -/* signals */ 0,{{},},0, \ -/* ec,brk... */ 0,0,0,0,0,0, \ -/* pid etc.. */ 0,-1,0,0,0, \ -/* uid etc */ 0,0,0,0,0,0, \ -/* alarm */ 0,0,0,0,0,0, \ -/* math */ 0, \ -/* fs info */ -1,0022,NULL,NULL,NULL,0, \ -/* filp */ {NULL,}, \ - { \ - {0,0}, \ -/* ldt */ {0x9f,0xc0fa00}, \ - {0x9f,0xc0f200}, \ - }, \ -/*tss*/ {0,PAGE_SIZE+(long)&init_task,0x10,0,0,0,0,(long)&pg_dir,\ - 0,0,0,0,0,0,0,0, \ - 0,0,0x17,0x17,0x17,0x17,0x17,0x17, \ - _LDT(0),0x80000000, \ - {} \ - }, \ -} - -extern struct task_struct *task[NR_TASKS]; -extern struct task_struct *last_task_used_math; -extern struct task_struct *current; -extern long volatile jiffies; -extern long startup_time; - -#define CURRENT_TIME (startup_time+jiffies/HZ) - -extern void add_timer(long jiffies, void (*fn)(void)); -extern void sleep_on(struct task_struct ** p); -extern void interruptible_sleep_on(struct task_struct ** p); -extern void wake_up(struct task_struct ** p); - -/* - * Entry into gdt where to find first TSS. 0-nul, 1-cs, 2-ds, 3-syscall - * 4-TSS0, 5-LDT0, 6-TSS1 etc ... - */ -#define FIRST_TSS_ENTRY 4 -#define FIRST_LDT_ENTRY (FIRST_TSS_ENTRY+1) -#define _TSS(n) ((((unsigned long) n)<<4)+(FIRST_TSS_ENTRY<<3)) -#define _LDT(n) ((((unsigned long) n)<<4)+(FIRST_LDT_ENTRY<<3)) -#define ltr(n) __asm__("ltr %%ax"::"a" (_TSS(n))) -#define lldt(n) __asm__("lldt %%ax"::"a" (_LDT(n))) -#define str(n) \ -__asm__("str %%ax\n\t" \ - "subl %2,%%eax\n\t" \ - "shrl $4,%%eax" \ - :"=a" (n) \ - :"a" (0),"i" (FIRST_TSS_ENTRY<<3)) -/* - * switch_to(n) should switch tasks to task nr n, first - * checking that n isn't the current task, in which case it does nothing. - * This also clears the TS-flag if the task we switched to has used - * tha math co-processor latest. - */ -#define switch_to(n) {\ -struct {long a,b;} __tmp; \ -__asm__("cmpl %%ecx,_current\n\t" \ - "je 1f\n\t" \ - "movw %%dx,%1\n\t" \ - "xchgl %%ecx,_current\n\t" \ - "ljmp *%0\n\t" \ - "cmpl %%ecx,_last_task_used_math\n\t" \ - "jne 1f\n\t" \ - "clts\n" \ - "1:" \ - ::"m" (*&__tmp.a),"m" (*&__tmp.b), \ - "d" (_TSS(n)),"c" ((long) task[n])); \ -} - -#define PAGE_ALIGN(n) (((n)+0xfff)&0xfffff000) - -#define _set_base(addr,base) \ -__asm__ ("push %%edx\n\t" \ - "movw %%dx,%0\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %%dl,%1\n\t" \ - "movb %%dh,%2\n\t" \ - "pop %%edx" \ - ::"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7)), \ - "d" (base) \ - ) - -#define _set_limit(addr,limit) \ -__asm__ ("push %%edx\n\t" \ - "movw %%dx,%0\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %1,%%dh\n\t" \ - "andb $0xf0,%%dh\n\t" \ - "orb %%dh,%%dl\n\t" \ - "movb %%dl,%1\n\t" \ - "pop %%edx" \ - ::"m" (*(addr)), \ - "m" (*((addr)+6)), \ - "d" (limit) \ - ) - -#define set_base(ldt,base) _set_base( ((char *)&(ldt)) , (base) ) -#define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , (limit-1)>>12 ) - -/** -#define _get_base(addr) ({\ -unsigned long __base; \ -__asm__("movb %3,%%dh\n\t" \ - "movb %2,%%dl\n\t" \ - "shll $16,%%edx\n\t" \ - "movw %1,%%dx" \ - :"=d" (__base) \ - :"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7)) \ - :"memory"); \ -__base;}) -**/ - -static inline unsigned long _get_base(char * addr) -{ - unsigned long __base; - __asm__("movb %3,%%dh\n\t" - "movb %2,%%dl\n\t" - "shll $16,%%edx\n\t" - "movw %1,%%dx" - :"=&d" (__base) - :"m" (*((addr)+2)), - "m" (*((addr)+4)), - "m" (*((addr)+7))); - return __base; -} - -#define get_base(ldt) _get_base( ((char *)&(ldt)) ) - -#define get_limit(segment) ({ \ -unsigned long __limit; \ -__asm__("lsll %1,%0\n\tincl %0":"=r" (__limit):"r" (segment)); \ -__limit;}) - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sched.h.cur1 b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sched.h.cur1 deleted file mode 100644 index 20b05ce..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sched.h.cur1 +++ /dev/null @@ -1,235 +0,0 @@ -#ifndef _SCHED_H -#define _SCHED_H - -#define NR_TASKS 64 -#define HZ 100 - -#define FIRST_TASK task[0] -#define LAST_TASK task[NR_TASKS-1] - -#include -#include -#include -#include - -#if (NR_OPEN > 32) -#error "Currently the close-on-exec-flags are in one word, max 32 files/proc" -#endif - -#define TASK_RUNNING 0 -#define TASK_INTERRUPTIBLE 1 -#define TASK_UNINTERRUPTIBLE 2 -#define TASK_ZOMBIE 3 -#define TASK_STOPPED 4 - -#ifndef NULL -#define NULL ((void *) 0) -#endif - -extern int copy_page_tables(unsigned long from, unsigned long to, long size); -extern int free_page_tables(unsigned long from, unsigned long size); - -extern void sched_init(void); -extern void schedule(void); -extern void trap_init(void); -#ifndef PANIC -volatile void panic(const char * str); -#endif -extern int tty_write(unsigned minor,char * buf,int count); - -typedef int (*fn_ptr)(); - -struct i387_struct { - long cwd; - long swd; - long twd; - long fip; - long fcs; - long foo; - long fos; - long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */ -}; - -struct tss_struct { - long back_link; /* 16 high bits zero */ - long esp0; - long ss0; /* 16 high bits zero */ - long esp1; - long ss1; /* 16 high bits zero */ - long esp2; - long ss2; /* 16 high bits zero */ - long cr3; - long eip; - long eflags; - long eax,ecx,edx,ebx; - long esp; - long ebp; - long esi; - long edi; - long es; /* 16 high bits zero */ - long cs; /* 16 high bits zero */ - long ss; /* 16 high bits zero */ - long ds; /* 16 high bits zero */ - long fs; /* 16 high bits zero */ - long gs; /* 16 high bits zero */ - long ldt; /* 16 high bits zero */ - long trace_bitmap; /* bits: trace 0, bitmap 16-31 */ - struct i387_struct i387; -}; - -struct task_struct { -/* these are hardcoded - don't touch */ - long state; /* -1 unrunnable, 0 runnable, >0 stopped */ - long counter; - long priority; - long signal; - struct sigaction sigaction[32]; - long blocked; /* bitmap of masked signals */ -/* various fields */ - int exit_code; - unsigned long start_code,end_code,end_data,brk,start_stack; - long pid,father,pgrp,session,leader; - unsigned short uid,euid,suid; - unsigned short gid,egid,sgid; - long alarm; - long utime,stime,cutime,cstime,start_time; - unsigned short used_math; -/* file system info */ - int tty; /* -1 if no tty, so it must be signed */ - unsigned short umask; - struct m_inode * pwd; - struct m_inode * root; - struct m_inode * executable; - unsigned long close_on_exec; - struct file * filp[NR_OPEN]; -/* ldt for this task 0 - zero 1 - cs 2 - ds&ss */ - struct desc_struct ldt[3]; -/* tss for this task */ - struct tss_struct tss; -}; - -/* - * INIT_TASK is used to set up the first task table, touch at - * your own risk!. Base=0, limit=0x9ffff (=640kB) - */ -#define INIT_TASK \ -/* state etc */ { 0,15,15, \ -/* signals */ 0,{{},},0, \ -/* ec,brk... */ 0,0,0,0,0,0, \ -/* pid etc.. */ 0,-1,0,0,0, \ -/* uid etc */ 0,0,0,0,0,0, \ -/* alarm */ 0,0,0,0,0,0, \ -/* math */ 0, \ -/* fs info */ -1,0022,NULL,NULL,NULL,0, \ -/* filp */ {NULL,}, \ - { \ - {0,0}, \ -/* ldt */ {0x9f,0xc0fa00}, \ - {0x9f,0xc0f200}, \ - }, \ -/*tss*/ {0,PAGE_SIZE+(long)&init_task,0x10,0,0,0,0,(long)&pg_dir,\ - 0,0,0,0,0,0,0,0, \ - 0,0,0x17,0x17,0x17,0x17,0x17,0x17, \ - _LDT(0),0x80000000, \ - {} \ - }, \ -} - -extern struct task_struct *task[NR_TASKS]; -extern struct task_struct *last_task_used_math; -extern struct task_struct *current; -extern long volatile jiffies; -extern long startup_time; - -#define CURRENT_TIME (startup_time+jiffies/HZ) - -extern void add_timer(long jiffies, void (*fn)(void)); -extern void sleep_on(struct task_struct ** p); -extern void interruptible_sleep_on(struct task_struct ** p); -extern void wake_up(struct task_struct ** p); - -/* - * Entry into gdt where to find first TSS. 0-nul, 1-cs, 2-ds, 3-syscall - * 4-TSS0, 5-LDT0, 6-TSS1 etc ... - */ -#define FIRST_TSS_ENTRY 4 -#define FIRST_LDT_ENTRY (FIRST_TSS_ENTRY+1) -#define _TSS(n) ((((unsigned long) n)<<4)+(FIRST_TSS_ENTRY<<3)) -#define _LDT(n) ((((unsigned long) n)<<4)+(FIRST_LDT_ENTRY<<3)) -#define ltr(n) __asm__("ltr %%ax"::"a" (_TSS(n))) -#define lldt(n) __asm__("lldt %%ax"::"a" (_LDT(n))) -#define str(n) \ -__asm__("str %%ax\n\t" \ - "subl %2,%%eax\n\t" \ - "shrl $4,%%eax" \ - :"=a" (n) \ - :"a" (0),"i" (FIRST_TSS_ENTRY<<3)) -/* - * switch_to(n) should switch tasks to task nr n, first - * checking that n isn't the current task, in which case it does nothing. - * This also clears the TS-flag if the task we switched to has used - * tha math co-processor latest. - */ -#define switch_to(n) {\ -struct {long a,b;} __tmp; \ -__asm__("cmpl %%ecx,current\n\t" \ - "je 1f\n\t" \ - "movw %%dx,%1\n\t" \ - "xchgl %%ecx,current\n\t" \ - "ljmp *%0\n\t" \ - "cmpl %%ecx,last_task_used_math\n\t" \ - "jne 1f\n\t" \ - "clts\n" \ - "1:" \ - ::"m" (*&__tmp.a),"m" (*&__tmp.b), \ - "d" (_TSS(n)),"c" ((long) task[n])); \ -} - -#define PAGE_ALIGN(n) (((n)+0xfff)&0xfffff000) - -#define _set_base(addr,base) \ -__asm__ ("movw %%dx,%0\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %%dl,%1\n\t" \ - "movb %%dh,%2\n\t" \ - ::"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7)), \ - "d" (base) \ - ) - -#define _set_limit(addr,limit) \ -__asm__ ("movw %%dx,%0\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %1,%%dh\n\t" \ - "andb $0xf0,%%dh\n\t" \ - "orb %%dh,%%dl\n\t" \ - "movb %%dl,%1\n\t" \ - ::"m" (*(addr)), \ - "m" (*((addr)+6)), \ - "d" (limit) \ - ) - -#define set_base(ldt,base) _set_base( ((char *)&(ldt)) , (base) ) -#define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , (limit-1)>>12 ) - -#define _get_base(addr) ({\ -unsigned long __base; \ -__asm__("movb %3,%%dh\n\t" \ - "movb %2,%%dl\n\t" \ - "shll $16,%%edx\n\t" \ - "movw %1,%%dx" \ - :"=d" (__base) \ - :"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7))); \ -__base;}) - -#define get_base(ldt) _get_base( ((char *)&(ldt)) ) - -#define get_limit(segment) ({ \ -unsigned long __limit; \ -__asm__("lsll %1,%0\n\tincl %0":"=r" (__limit):"r" (segment)); \ -__limit;}) - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sched.h.old b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sched.h.old deleted file mode 100644 index c6e4deb..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sched.h.old +++ /dev/null @@ -1,239 +0,0 @@ -#ifndef _SCHED_H -#define _SCHED_H - -#define NR_TASKS 64 -#define HZ 100 - -#define FIRST_TASK task[0] -#define LAST_TASK task[NR_TASKS-1] - -#include -#include -#include -#include - -#if (NR_OPEN > 32) -#error "Currently the close-on-exec-flags are in one word, max 32 files/proc" -#endif - -#define TASK_RUNNING 0 -#define TASK_INTERRUPTIBLE 1 -#define TASK_UNINTERRUPTIBLE 2 -#define TASK_ZOMBIE 3 -#define TASK_STOPPED 4 - -#ifndef NULL -#define NULL ((void *) 0) -#endif - -extern int copy_page_tables(unsigned long from, unsigned long to, long size); -extern int free_page_tables(unsigned long from, unsigned long size); - -extern void sched_init(void); -extern void schedule(void); -extern void trap_init(void); -#ifndef PANIC -extern void panic(const char * str); -#endif -extern int tty_write(unsigned minor,char * buf,int count); - -typedef int (*fn_ptr)(); - -struct i387_struct { - long cwd; - long swd; - long twd; - long fip; - long fcs; - long foo; - long fos; - long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */ -}; - -struct tss_struct { - long back_link; /* 16 high bits zero */ - long esp0; - long ss0; /* 16 high bits zero */ - long esp1; - long ss1; /* 16 high bits zero */ - long esp2; - long ss2; /* 16 high bits zero */ - long cr3; - long eip; - long eflags; - long eax,ecx,edx,ebx; - long esp; - long ebp; - long esi; - long edi; - long es; /* 16 high bits zero */ - long cs; /* 16 high bits zero */ - long ss; /* 16 high bits zero */ - long ds; /* 16 high bits zero */ - long fs; /* 16 high bits zero */ - long gs; /* 16 high bits zero */ - long ldt; /* 16 high bits zero */ - long trace_bitmap; /* bits: trace 0, bitmap 16-31 */ - struct i387_struct i387; -}; - -struct task_struct { -/* these are hardcoded - don't touch */ - long state; /* -1 unrunnable, 0 runnable, >0 stopped */ - long counter; - long priority; - long signal; - struct sigaction sigaction[32]; - long blocked; /* bitmap of masked signals */ -/* various fields */ - int exit_code; - unsigned long start_code,end_code,end_data,brk,start_stack; - long pid,father,pgrp,session,leader; - unsigned short uid,euid,suid; - unsigned short gid,egid,sgid; - long alarm; - long utime,stime,cutime,cstime,start_time; - unsigned short used_math; -/* file system info */ - int tty; /* -1 if no tty, so it must be signed */ - unsigned short umask; - struct m_inode * pwd; - struct m_inode * root; - struct m_inode * executable; - unsigned long close_on_exec; - struct file * filp[NR_OPEN]; -/* ldt for this task 0 - zero 1 - cs 2 - ds&ss */ - struct desc_struct ldt[3]; -/* tss for this task */ - struct tss_struct tss; -}; - -/* - * INIT_TASK is used to set up the first task table, touch at - * your own risk!. Base=0, limit=0x9ffff (=640kB) - */ -#define INIT_TASK \ -/* state etc */ { 0,15,15, \ -/* signals */ 0,{{},},0, \ -/* ec,brk... */ 0,0,0,0,0,0, \ -/* pid etc.. */ 0,-1,0,0,0, \ -/* uid etc */ 0,0,0,0,0,0, \ -/* alarm */ 0,0,0,0,0,0, \ -/* math */ 0, \ -/* fs info */ -1,0022,NULL,NULL,NULL,0, \ -/* filp */ {NULL,}, \ - { \ - {0,0}, \ -/* ldt */ {0x9f,0xc0fa00}, \ - {0x9f,0xc0f200}, \ - }, \ -/*tss*/ {0,PAGE_SIZE+(long)&init_task,0x10,0,0,0,0,(long)&pg_dir,\ - 0,0,0,0,0,0,0,0, \ - 0,0,0x17,0x17,0x17,0x17,0x17,0x17, \ - _LDT(0),0x80000000, \ - {} \ - }, \ -} - -extern struct task_struct *task[NR_TASKS]; -extern struct task_struct *last_task_used_math; -extern struct task_struct *current; -extern long volatile jiffies; -extern long startup_time; - -#define CURRENT_TIME (startup_time+jiffies/HZ) - -extern void add_timer(long jiffies, void (*fn)(void)); -extern void sleep_on(struct task_struct ** p); -extern void interruptible_sleep_on(struct task_struct ** p); -extern void wake_up(struct task_struct ** p); - -/* - * Entry into gdt where to find first TSS. 0-nul, 1-cs, 2-ds, 3-syscall - * 4-TSS0, 5-LDT0, 6-TSS1 etc ... - */ -#define FIRST_TSS_ENTRY 4 -#define FIRST_LDT_ENTRY (FIRST_TSS_ENTRY+1) -#define _TSS(n) ((((unsigned long) n)<<4)+(FIRST_TSS_ENTRY<<3)) -#define _LDT(n) ((((unsigned long) n)<<4)+(FIRST_LDT_ENTRY<<3)) -#define ltr(n) __asm__("ltr %%ax"::"a" (_TSS(n))) -#define lldt(n) __asm__("lldt %%ax"::"a" (_LDT(n))) -#define str(n) \ -__asm__("str %%ax\n\t" \ - "subl %2,%%eax\n\t" \ - "shrl $4,%%eax" \ - :"=a" (n) \ - :"a" (0),"i" (FIRST_TSS_ENTRY<<3)) -/* - * switch_to(n) should switch tasks to task nr n, first - * checking that n isn't the current task, in which case it does nothing. - * This also clears the TS-flag if the task we switched to has used - * tha math co-processor latest. - */ -#define switch_to(n) {\ -struct {long a,b;} __tmp; \ -__asm__("cmpl %%ecx,current\n\t" \ - "je 1f\n\t" \ - "movw %%dx,%1\n\t" \ - "xchgl %%ecx,current\n\t" \ - "ljmp *%0\n\t" \ - "cmpl %%ecx,last_task_used_math\n\t" \ - "jne 1f\n\t" \ - "clts\n" \ - "1:" \ - ::"m" (*&__tmp.a),"m" (*&__tmp.b), \ - "d" (_TSS(n)),"c" ((long) task[n])); \ -} - -#define PAGE_ALIGN(n) (((n)+0xfff)&0xfffff000) - -#define _set_base(addr,base) \ -__asm__ ("push %%edx\n\t" \ - "movw %%dx,%0\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %%dl,%1\n\t" \ - "movb %%dh,%2\n\t" \ - "pop %%edx" \ - ::"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7)), \ - "d" (base) \ - ) - -#define _set_limit(addr,limit) \ -__asm__ ("push %%edx\n\t" \ - "movw %%dx,%0\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %1,%%dh\n\t" \ - "andb $0xf0,%%dh\n\t" \ - "orb %%dh,%%dl\n\t" \ - "movb %%dl,%1\n\t" \ - "pop %%edx" \ - ::"m" (*(addr)), \ - "m" (*((addr)+6)), \ - "d" (limit) \ - ) - -#define set_base(ldt,base) _set_base( ((char *)&(ldt)) , base ) -#define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , (limit-1)>>12 ) - -#define _get_base(addr) ({\ -unsigned long __base; \ -__asm__("movb %3,%%dh\n\t" \ - "movb %2,%%dl\n\t" \ - "shll $16,%%edx\n\t" \ - "movw %1,%%dx" \ - :"=d" (__base) \ - :"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7))); \ -__base;}) - -#define get_base(ldt) _get_base( ((char *)&(ldt)) ) - -#define get_limit(segment) ({ \ -unsigned long __limit; \ -__asm__("lsll %1,%0\n\tincl %0":"=r" (__limit):"r" (segment)); \ -__limit;}) - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sys.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sys.h deleted file mode 100644 index c538fc1..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/sys.h +++ /dev/null @@ -1,86 +0,0 @@ -extern int sys_setup(); -extern int sys_exit(); -extern int sys_fork(); -extern int sys_read(); -extern int sys_write(); -extern int sys_open(); -extern int sys_close(); -extern int sys_waitpid(); -extern int sys_creat(); -extern int sys_link(); -extern int sys_unlink(); -extern int sys_execve(); -extern int sys_chdir(); -extern int sys_time(); -extern int sys_mknod(); -extern int sys_chmod(); -extern int sys_chown(); -extern int sys_break(); -extern int sys_stat(); -extern int sys_lseek(); -extern int sys_getpid(); -extern int sys_mount(); -extern int sys_umount(); -extern int sys_setuid(); -extern int sys_getuid(); -extern int sys_stime(); -extern int sys_ptrace(); -extern int sys_alarm(); -extern int sys_fstat(); -extern int sys_pause(); -extern int sys_utime(); -extern int sys_stty(); -extern int sys_gtty(); -extern int sys_access(); -extern int sys_nice(); -extern int sys_ftime(); -extern int sys_sync(); -extern int sys_kill(); -extern int sys_rename(); -extern int sys_mkdir(); -extern int sys_rmdir(); -extern int sys_dup(); -extern int sys_pipe(); -extern int sys_times(); -extern int sys_prof(); -extern int sys_brk(); -extern int sys_setgid(); -extern int sys_getgid(); -extern int sys_signal(); -extern int sys_geteuid(); -extern int sys_getegid(); -extern int sys_acct(); -extern int sys_phys(); -extern int sys_lock(); -extern int sys_ioctl(); -extern int sys_fcntl(); -extern int sys_mpx(); -extern int sys_setpgid(); -extern int sys_ulimit(); -extern int sys_uname(); -extern int sys_umask(); -extern int sys_chroot(); -extern int sys_ustat(); -extern int sys_dup2(); -extern int sys_getppid(); -extern int sys_getpgrp(); -extern int sys_setsid(); -extern int sys_sigaction(); -extern int sys_sgetmask(); -extern int sys_ssetmask(); -extern int sys_setreuid(); -extern int sys_setregid(); - -fn_ptr sys_call_table[] = { sys_setup, sys_exit, sys_fork, sys_read, -sys_write, sys_open, sys_close, sys_waitpid, sys_creat, sys_link, -sys_unlink, sys_execve, sys_chdir, sys_time, sys_mknod, sys_chmod, -sys_chown, sys_break, sys_stat, sys_lseek, sys_getpid, sys_mount, -sys_umount, sys_setuid, sys_getuid, sys_stime, sys_ptrace, sys_alarm, -sys_fstat, sys_pause, sys_utime, sys_stty, sys_gtty, sys_access, -sys_nice, sys_ftime, sys_sync, sys_kill, sys_rename, sys_mkdir, -sys_rmdir, sys_dup, sys_pipe, sys_times, sys_prof, sys_brk, sys_setgid, -sys_getgid, sys_signal, sys_geteuid, sys_getegid, sys_acct, sys_phys, -sys_lock, sys_ioctl, sys_fcntl, sys_mpx, sys_setpgid, sys_ulimit, -sys_uname, sys_umask, sys_chroot, sys_ustat, sys_dup2, sys_getppid, -sys_getpgrp, sys_setsid, sys_sigaction, sys_sgetmask, sys_ssetmask, -sys_setreuid,sys_setregid }; diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/tty.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/tty.h deleted file mode 100644 index ad846b3..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/linux/tty.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 'tty.h' defines some structures used by tty_io.c and some defines. - * - * NOTE! Don't touch this without checking that nothing in rs_io.s or - * con_io.s breaks. Some constants are hardwired into the system (mainly - * offsets into 'tty_queue' - */ - -#ifndef _TTY_H -#define _TTY_H - -#include - -#define TTY_BUF_SIZE 1024 - -struct tty_queue { - unsigned long data; - unsigned long head; - unsigned long tail; - struct task_struct * proc_list; - char buf[TTY_BUF_SIZE]; -}; - -#define INC(a) ((a) = ((a)+1) & (TTY_BUF_SIZE-1)) -#define DEC(a) ((a) = ((a)-1) & (TTY_BUF_SIZE-1)) -#define EMPTY(a) ((a).head == (a).tail) -#define LEFT(a) (((a).tail-(a).head-1)&(TTY_BUF_SIZE-1)) -#define LAST(a) ((a).buf[(TTY_BUF_SIZE-1)&((a).head-1)]) -#define FULL(a) (!LEFT(a)) -#define CHARS(a) (((a).head-(a).tail)&(TTY_BUF_SIZE-1)) -#define GETCH(queue,c) \ -(void)({c=(queue).buf[(queue).tail];INC((queue).tail);}) -#define PUTCH(c,queue) \ -(void)({(queue).buf[(queue).head]=(c);INC((queue).head);}) - -#define INTR_CHAR(tty) ((tty)->termios.c_cc[VINTR]) -#define QUIT_CHAR(tty) ((tty)->termios.c_cc[VQUIT]) -#define ERASE_CHAR(tty) ((tty)->termios.c_cc[VERASE]) -#define KILL_CHAR(tty) ((tty)->termios.c_cc[VKILL]) -#define EOF_CHAR(tty) ((tty)->termios.c_cc[VEOF]) -#define START_CHAR(tty) ((tty)->termios.c_cc[VSTART]) -#define STOP_CHAR(tty) ((tty)->termios.c_cc[VSTOP]) -#define SUSPEND_CHAR(tty) ((tty)->termios.c_cc[VSUSP]) - -struct tty_struct { - struct termios termios; - int pgrp; - int stopped; - void (*write)(struct tty_struct * tty); - struct tty_queue read_q; - struct tty_queue write_q; - struct tty_queue secondary; - }; - -extern struct tty_struct tty_table[]; - -/* intr=^C quit=^| erase=del kill=^U - eof=^D vtime=\0 vmin=\1 sxtc=\0 - start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V - eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" - -void rs_init(void); -void con_init(void); -void tty_init(void); - -int tty_read(unsigned c, char * buf, int n); -int tty_write(unsigned c, char * buf, int n); - -void rs_write(struct tty_struct * tty); -void con_write(struct tty_struct * tty); - -void copy_to_cooked(struct tty_struct * tty); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/signal.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/signal.h deleted file mode 100644 index 0eea9a3..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/signal.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef _SIGNAL_H -#define _SIGNAL_H - -#include - -typedef int sig_atomic_t; -typedef unsigned int sigset_t; /* 32 bits */ - -#define _NSIG 32 -#define NSIG _NSIG - -#define SIGHUP 1 -#define SIGINT 2 -#define SIGQUIT 3 -#define SIGILL 4 -#define SIGTRAP 5 -#define SIGABRT 6 -#define SIGIOT 6 -#define SIGUNUSED 7 -#define SIGFPE 8 -#define SIGKILL 9 -#define SIGUSR1 10 -#define SIGSEGV 11 -#define SIGUSR2 12 -#define SIGPIPE 13 -#define SIGALRM 14 -#define SIGTERM 15 -#define SIGSTKFLT 16 -#define SIGCHLD 17 -#define SIGCONT 18 -#define SIGSTOP 19 -#define SIGTSTP 20 -#define SIGTTIN 21 -#define SIGTTOU 22 - -/* Ok, I haven't implemented sigactions, but trying to keep headers POSIX */ -#define SA_NOCLDSTOP 1 -#define SA_NOMASK 0x40000000 -#define SA_ONESHOT 0x80000000 - -#define SIG_BLOCK 0 /* for blocking signals */ -#define SIG_UNBLOCK 1 /* for unblocking signals */ -#define SIG_SETMASK 2 /* for setting the signal mask */ - -#define SIG_DFL ((void (*)(int))0) /* default signal handling */ -#define SIG_IGN ((void (*)(int))1) /* ignore signal */ - -struct sigaction { - void (*sa_handler)(int); - sigset_t sa_mask; - int sa_flags; - void (*sa_restorer)(void); -}; - -void (*signal(int _sig, void (*_func)(int)))(int); -int raise(int sig); -int kill(pid_t pid, int sig); -int sigaddset(sigset_t *mask, int signo); -int sigdelset(sigset_t *mask, int signo); -int sigemptyset(sigset_t *mask); -int sigfillset(sigset_t *mask); -int sigismember(sigset_t *mask, int signo); /* 1 - is, 0 - not, -1 error */ -int sigpending(sigset_t *set); -int sigprocmask(int how, sigset_t *set, sigset_t *oldset); -int sigsuspend(sigset_t *sigmask); -int sigaction(int sig, struct sigaction *act, struct sigaction *oldact); - -#endif /* _SIGNAL_H */ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/stdarg.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/stdarg.h deleted file mode 100644 index fd79ec0..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/stdarg.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _STDARG_H -#define _STDARG_H - -typedef char *va_list; - -/* Amount of space required in an argument list for an arg of type TYPE. - TYPE may alternatively be an expression whose type is used. */ - -#define __va_rounded_size(TYPE) \ - (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) - -#ifndef __sparc__ -#define va_start(AP, LASTARG) \ - (AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG))) -#else -#define va_start(AP, LASTARG) \ - (__builtin_saveregs (), \ - AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG))) -#endif - -void va_end (va_list); /* Defined in gnulib */ -#define va_end(AP) - -#define va_arg(AP, TYPE) \ - (AP += __va_rounded_size (TYPE), \ - *((TYPE *) (AP - __va_rounded_size (TYPE)))) - -#endif /* _STDARG_H */ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/stddef.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/stddef.h deleted file mode 100644 index 97f72ff..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/stddef.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _STDDEF_H -#define _STDDEF_H - -#ifndef _PTRDIFF_T -#define _PTRDIFF_T -typedef long ptrdiff_t; -#endif - -#ifndef _SIZE_T -#define _SIZE_T -typedef unsigned long size_t; -#endif - -#undef NULL -#define NULL ((void *)0) - -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/string.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/string.h deleted file mode 100644 index 608e86f..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/string.h +++ /dev/null @@ -1,405 +0,0 @@ -#ifndef _STRING_H_ -#define _STRING_H_ - -#ifndef NULL -#define NULL ((void *) 0) -#endif - -#ifndef _SIZE_T -#define _SIZE_T -typedef unsigned int size_t; -#endif - -extern char * strerror(int errno); - -/* - * This string-include defines all string functions as inline - * functions. Use gcc. It also assumes ds=es=data space, this should be - * normal. Most of the string-functions are rather heavily hand-optimized, - * see especially strtok,strstr,str[c]spn. They should work, but are not - * very easy to understand. Everything is done entirely within the register - * set, making the functions fast and clean. String instructions have been - * used through-out, making for "slightly" unclear code :-) - * - * (C) 1991 Linus Torvalds - */ - -extern inline char * strcpy(char * dest,const char *src) -{ -__asm__("cld\n" - "1:\tlodsb\n\t" - "stosb\n\t" - "testb %%al,%%al\n\t" - "jne 1b" - ::"S" (src),"D" (dest)); -return dest; -} - -static inline char * strncpy(char * dest,const char *src,int count) -{ -__asm__("cld\n" - "1:\tdecl %2\n\t" - "js 2f\n\t" - "lodsb\n\t" - "stosb\n\t" - "testb %%al,%%al\n\t" - "jne 1b\n\t" - "rep\n\t" - "stosb\n" - "2:" - ::"S" (src),"D" (dest),"c" (count)); -return dest; -} - -extern inline char * strcat(char * dest,const char * src) -{ -__asm__("cld\n\t" - "repne\n\t" - "scasb\n\t" - "decl %1\n" - "1:\tlodsb\n\t" - "stosb\n\t" - "testb %%al,%%al\n\t" - "jne 1b" - ::"S" (src),"D" (dest),"a" (0),"c" (0xffffffff)); -return dest; -} - -static inline char * strncat(char * dest,const char * src,int count) -{ -__asm__("cld\n\t" - "repne\n\t" - "scasb\n\t" - "decl %1\n\t" - "movl %4,%3\n" - "1:\tdecl %3\n\t" - "js 2f\n\t" - "lodsb\n\t" - "stosb\n\t" - "testb %%al,%%al\n\t" - "jne 1b\n" - "2:\txorl %2,%2\n\t" - "stosb" - ::"S" (src),"D" (dest),"a" (0),"c" (0xffffffff),"g" (count) - ); -return dest; -} - -extern inline int strcmp(const char * cs,const char * ct) -{ -register int __res ; -__asm__("cld\n" - "1:\tlodsb\n\t" - "scasb\n\t" - "jne 2f\n\t" - "testb %%al,%%al\n\t" - "jne 1b\n\t" - "xorl %%eax,%%eax\n\t" - "jmp 3f\n" - "2:\tmovl $1,%%eax\n\t" - "jl 3f\n\t" - "negl %%eax\n" - "3:" - :"=a" (__res):"D" (cs),"S" (ct)); -return __res; -} - -static inline int strncmp(const char * cs,const char * ct,int count) -{ -register int __res ; -__asm__("cld\n" - "1:\tdecl %3\n\t" - "js 2f\n\t" - "lodsb\n\t" - "scasb\n\t" - "jne 3f\n\t" - "testb %%al,%%al\n\t" - "jne 1b\n" - "2:\txorl %%eax,%%eax\n\t" - "jmp 4f\n" - "3:\tmovl $1,%%eax\n\t" - "jl 4f\n\t" - "negl %%eax\n" - "4:" - :"=a" (__res):"D" (cs),"S" (ct),"c" (count)); -return __res; -} - -static inline char * strchr(const char * s,char c) -{ -register char * __res ; -__asm__("cld\n\t" - "movb %%al,%%ah\n" - "1:\tlodsb\n\t" - "cmpb %%ah,%%al\n\t" - "je 2f\n\t" - "testb %%al,%%al\n\t" - "jne 1b\n\t" - "movl $1,%1\n" - "2:\tmovl %1,%0\n\t" - "decl %0" - :"=a" (__res):"S" (s),"0" (c)); -return __res; -} - -static inline char * strrchr(const char * s,char c) -{ -register char * __res; -__asm__("cld\n\t" - "movb %%al,%%ah\n" - "1:\tlodsb\n\t" - "cmpb %%ah,%%al\n\t" - "jne 2f\n\t" - "movl %%esi,%0\n\t" - "decl %0\n" - "2:\ttestb %%al,%%al\n\t" - "jne 1b" - :"=d" (__res):"0" (0),"S" (s),"a" (c)); -return __res; -} - -extern inline int strspn(const char * cs, const char * ct) -{ -register char * __res; -__asm__("cld\n\t" - "movl %4,%%edi\n\t" - "repne\n\t" - "scasb\n\t" - "notl %%ecx\n\t" - "decl %%ecx\n\t" - "movl %%ecx,%%edx\n" - "1:\tlodsb\n\t" - "testb %%al,%%al\n\t" - "je 2f\n\t" - "movl %4,%%edi\n\t" - "movl %%edx,%%ecx\n\t" - "repne\n\t" - "scasb\n\t" - "je 1b\n" - "2:\tdecl %0" - :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct) - ); -return __res-cs; -} - -extern inline int strcspn(const char * cs, const char * ct) -{ -register char * __res; -__asm__("cld\n\t" - "movl %4,%%edi\n\t" - "repne\n\t" - "scasb\n\t" - "notl %%ecx\n\t" - "decl %%ecx\n\t" - "movl %%ecx,%%edx\n" - "1:\tlodsb\n\t" - "testb %%al,%%al\n\t" - "je 2f\n\t" - "movl %4,%%edi\n\t" - "movl %%edx,%%ecx\n\t" - "repne\n\t" - "scasb\n\t" - "jne 1b\n" - "2:\tdecl %0" - :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct) - ); -return __res-cs; -} - -extern inline char * strpbrk(const char * cs,const char * ct) -{ -register char * __res ; -__asm__("cld\n\t" - "movl %4,%%edi\n\t" - "repne\n\t" - "scasb\n\t" - "notl %%ecx\n\t" - "decl %%ecx\n\t" - "movl %%ecx,%%edx\n" - "1:\tlodsb\n\t" - "testb %%al,%%al\n\t" - "je 2f\n\t" - "movl %4,%%edi\n\t" - "movl %%edx,%%ecx\n\t" - "repne\n\t" - "scasb\n\t" - "jne 1b\n\t" - "decl %0\n\t" - "jmp 3f\n" - "2:\txorl %0,%0\n" - "3:" - :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct) - ); -return __res; -} - -extern inline char * strstr(const char * cs,const char * ct) -{ -register char * __res ; -__asm__("cld\n\t" \ - "movl %4,%%edi\n\t" - "repne\n\t" - "scasb\n\t" - "notl %%ecx\n\t" - "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */ - "movl %%ecx,%%edx\n" - "1:\tmovl %4,%%edi\n\t" - "movl %%esi,%%eax\n\t" - "movl %%edx,%%ecx\n\t" - "repe\n\t" - "cmpsb\n\t" - "je 2f\n\t" /* also works for empty string, see above */ - "xchgl %%eax,%%esi\n\t" - "incl %%esi\n\t" - "cmpb $0,-1(%%eax)\n\t" - "jne 1b\n\t" - "xorl %%eax,%%eax\n\t" - "2:" - :"=a" (__res):"0" (0),"c" (0xffffffff),"S" (cs),"g" (ct) - ); -return __res; -} - -extern inline int strlen(const char * s) -{ -register int __res ; -__asm__("cld\n\t" - "repne\n\t" - "scasb\n\t" - "notl %0\n\t" - "decl %0" - :"=c" (__res):"D" (s),"a" (0),"0" (0xffffffff)); -return __res; -} - -extern char * ___strtok; - -extern inline char * strtok(char * s,const char * ct) -{ -register char * __res ; -__asm__("testl %1,%1\n\t" - "jne 1f\n\t" - "testl %0,%0\n\t" - "je 8f\n\t" - "movl %0,%1\n" - "1:\txorl %0,%0\n\t" - "movl $-1,%%ecx\n\t" - "xorl %%eax,%%eax\n\t" - "cld\n\t" - "movl %4,%%edi\n\t" - "repne\n\t" - "scasb\n\t" - "notl %%ecx\n\t" - "decl %%ecx\n\t" - "je 7f\n\t" /* empty delimeter-string */ - "movl %%ecx,%%edx\n" - "2:\tlodsb\n\t" - "testb %%al,%%al\n\t" - "je 7f\n\t" - "movl %4,%%edi\n\t" - "movl %%edx,%%ecx\n\t" - "repne\n\t" - "scasb\n\t" - "je 2b\n\t" - "decl %1\n\t" - "cmpb $0,(%1)\n\t" - "je 7f\n\t" - "movl %1,%0\n" - "3:\tlodsb\n\t" - "testb %%al,%%al\n\t" - "je 5f\n\t" - "movl %4,%%edi\n\t" - "movl %%edx,%%ecx\n\t" - "repne\n\t" - "scasb\n\t" - "jne 3b\n\t" - "decl %1\n\t" - "cmpb $0,(%1)\n\t" - "je 5f\n\t" - "movb $0,(%1)\n\t" - "incl %1\n\t" - "jmp 6f\n" - "5:\txorl %1,%1\n" - "6:\tcmpb $0,(%0)\n\t" - "jne 7f\n\t" - "xorl %0,%0\n" - "7:\ttestl %0,%0\n\t" - "jne 8f\n\t" - "movl %0,%1\n" - "8:" - :"=b" (__res),"=S" (___strtok) - :"0" (___strtok),"1" (s),"g" (ct) - ); -return __res; -} - -static inline void * memcpy(void * dest,const void * src, int n) -{ -__asm__("cld\n\t" - "rep\n\t" - "movsb" - ::"c" (n),"S" (src),"D" (dest) - ); -return dest; -} - -extern inline void * memmove(void * dest,const void * src, int n) -{ -if (dest - -struct stat { - dev_t st_dev; - ino_t st_ino; - umode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - dev_t st_rdev; - off_t st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -}; - -#define S_IFMT 00170000 -#define S_IFREG 0100000 -#define S_IFBLK 0060000 -#define S_IFDIR 0040000 -#define S_IFCHR 0020000 -#define S_IFIFO 0010000 -#define S_ISUID 0004000 -#define S_ISGID 0002000 -#define S_ISVTX 0001000 - -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) -#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) -#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) - -#define S_IRWXU 00700 -#define S_IRUSR 00400 -#define S_IWUSR 00200 -#define S_IXUSR 00100 - -#define S_IRWXG 00070 -#define S_IRGRP 00040 -#define S_IWGRP 00020 -#define S_IXGRP 00010 - -#define S_IRWXO 00007 -#define S_IROTH 00004 -#define S_IWOTH 00002 -#define S_IXOTH 00001 - -extern int chmod(const char *_path, mode_t mode); -extern int fstat(int fildes, struct stat *stat_buf); -extern int mkdir(const char *_path, mode_t mode); -extern int mkfifo(const char *_path, mode_t mode); -extern int stat(const char *filename, struct stat *stat_buf); -extern mode_t umask(mode_t mask); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/times.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/times.h deleted file mode 100644 index 68d5bfb..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/times.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _TIMES_H -#define _TIMES_H - -#include - -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_cutime; - time_t tms_cstime; -}; - -extern time_t times(struct tms * tp); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/types.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/types.h deleted file mode 100644 index 557aa31..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/types.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef _SYS_TYPES_H -#define _SYS_TYPES_H - -#ifndef _SIZE_T -#define _SIZE_T -typedef unsigned int size_t; -#endif - -#ifndef _TIME_T -#define _TIME_T -typedef long time_t; -#endif - -#ifndef _PTRDIFF_T -#define _PTRDIFF_T -typedef long ptrdiff_t; -#endif - -#ifndef NULL -#define NULL ((void *) 0) -#endif - -typedef int pid_t; -typedef unsigned short uid_t; -typedef unsigned char gid_t; -typedef unsigned short dev_t; -typedef unsigned short ino_t; -typedef unsigned short mode_t; -typedef unsigned short umode_t; -typedef unsigned char nlink_t; -typedef int daddr_t; -typedef long off_t; -typedef unsigned char u_char; -typedef unsigned short ushort; - -typedef struct { int quot,rem; } div_t; -typedef struct { long quot,rem; } ldiv_t; - -struct ustat { - daddr_t f_tfree; - ino_t f_tinode; - char f_fname[6]; - char f_fpack[6]; -}; - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/utsname.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/utsname.h deleted file mode 100644 index 0a1c5a0..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/utsname.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _SYS_UTSNAME_H -#define _SYS_UTSNAME_H - -#include - -struct utsname { - char sysname[9]; - char nodename[9]; - char release[9]; - char version[9]; - char machine[9]; -}; - -extern int uname(struct utsname * utsbuf); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/wait.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/wait.h deleted file mode 100644 index 53190c2..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/sys/wait.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _SYS_WAIT_H -#define _SYS_WAIT_H - -#include - -#define _LOW(v) ( (v) & 0377) -#define _HIGH(v) ( ((v) >> 8) & 0377) - -/* options for waitpid, WUNTRACED not supported */ -#define WNOHANG 1 -#define WUNTRACED 2 - -#define WIFEXITED(s) (!((s)&0xFF) -#define WIFSTOPPED(s) (((s)&0xFF)==0x7F) -#define WEXITSTATUS(s) (((s)>>8)&0xFF) -#define WTERMSIG(s) ((s)&0x7F) -#define WSTOPSIG(s) (((s)>>8)&0xFF) -#define WIFSIGNALED(s) (((unsigned int)(s)-1 & 0xFFFF) < 0xFF) - -pid_t wait(int *stat_loc); -pid_t waitpid(pid_t pid, int *stat_loc, int options); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/termios.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/termios.h deleted file mode 100644 index 2b7b913..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/termios.h +++ /dev/null @@ -1,228 +0,0 @@ -#ifndef _TERMIOS_H -#define _TERMIOS_H - -#define TTY_BUF_SIZE 1024 - -/* 0x54 is just a magic number to make these relatively uniqe ('T') */ - -#define TCGETS 0x5401 -#define TCSETS 0x5402 -#define TCSETSW 0x5403 -#define TCSETSF 0x5404 -#define TCGETA 0x5405 -#define TCSETA 0x5406 -#define TCSETAW 0x5407 -#define TCSETAF 0x5408 -#define TCSBRK 0x5409 -#define TCXONC 0x540A -#define TCFLSH 0x540B -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E -#define TIOCGPGRP 0x540F -#define TIOCSPGRP 0x5410 -#define TIOCOUTQ 0x5411 -#define TIOCSTI 0x5412 -#define TIOCGWINSZ 0x5413 -#define TIOCSWINSZ 0x5414 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define TIOCINQ 0x541B - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { - unsigned short c_iflag; /* input mode flags */ - unsigned short c_oflag; /* output mode flags */ - unsigned short c_cflag; /* control mode flags */ - unsigned short c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - -#define NCCS 17 -struct termios { - unsigned long c_iflag; /* input mode flags */ - unsigned long c_oflag; /* output mode flags */ - unsigned long c_cflag; /* control mode flags */ - unsigned long c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCCS]; /* control characters */ -}; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 - -/* c_oflag bits */ -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define XTABS 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 -#define FFDLY 0040000 -#define FF0 0000000 -#define FF1 0040000 - -/* c_cflag bit meaning */ -#define CBAUD 0000017 -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define CPARENB 0000400 -#define CPARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 -#define CIBAUD 03600000 /* input baud rate (not used) */ -#define CRTSCTS 020000000000 /* flow control */ - -#define PARENB CPARENB -#define PARODD CPARODD - -/* c_lflag bits */ -#define ISIG 0000001 -#define ICANON 0000002 -#define XCASE 0000004 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 -#define IEXTEN 0100000 - -/* modem lines */ -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* tcsetattr uses these */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -typedef int speed_t; - -extern speed_t cfgetispeed(struct termios *termios_p); -extern speed_t cfgetospeed(struct termios *termios_p); -extern int cfsetispeed(struct termios *termios_p, speed_t speed); -extern int cfsetospeed(struct termios *termios_p, speed_t speed); -extern int tcdrain(int fildes); -extern int tcflow(int fildes, int action); -extern int tcflush(int fildes, int queue_selector); -extern int tcgetattr(int fildes, struct termios *termios_p); -extern int tcsendbreak(int fildes, int duration); -extern int tcsetattr(int fildes, int optional_actions, - struct termios *termios_p); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/time.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/time.h deleted file mode 100644 index d0a765d..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/time.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _TIME_H -#define _TIME_H - -#ifndef _TIME_T -#define _TIME_T -typedef long time_t; -#endif - -#ifndef _SIZE_T -#define _SIZE_T -typedef unsigned int size_t; -#endif - -#define CLOCKS_PER_SEC 100 - -typedef long clock_t; - -struct tm { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; -}; - -clock_t clock(void); -time_t time(time_t * tp); -double difftime(time_t time2, time_t time1); -time_t mktime(struct tm * tp); - -char * asctime(const struct tm * tp); -char * ctime(const time_t * tp); -struct tm * gmtime(const time_t *tp); -struct tm *localtime(const time_t * tp); -size_t strftime(char * s, size_t smax, const char * fmt, const struct tm * tp); -void tzset(void); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/unistd.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/unistd.h deleted file mode 100644 index bf71dcb..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/unistd.h +++ /dev/null @@ -1,253 +0,0 @@ -#ifndef _UNISTD_H -#define _UNISTD_H - -/* ok, this may be a joke, but I'm working on it */ -#define _POSIX_VERSION 198808L - -#define _POSIX_CHOWN_RESTRICTED /* only root can do a chown (I think..) */ -#define _POSIX_NO_TRUNC /* no pathname truncation (but see in kernel) */ -#define _POSIX_VDISABLE '\0' /* character to disable things like ^C */ -/*#define _POSIX_SAVED_IDS */ /* we'll get to this yet */ -/*#define _POSIX_JOB_CONTROL */ /* we aren't there quite yet. Soon hopefully */ - -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 - -#ifndef NULL -#define NULL ((void *)0) -#endif - -/* access */ -#define F_OK 0 -#define X_OK 1 -#define W_OK 2 -#define R_OK 4 - -/* lseek */ -#define SEEK_SET 0 -#define SEEK_CUR 1 -#define SEEK_END 2 - -/* _SC stands for System Configuration. We don't use them much */ -#define _SC_ARG_MAX 1 -#define _SC_CHILD_MAX 2 -#define _SC_CLOCKS_PER_SEC 3 -#define _SC_NGROUPS_MAX 4 -#define _SC_OPEN_MAX 5 -#define _SC_JOB_CONTROL 6 -#define _SC_SAVED_IDS 7 -#define _SC_VERSION 8 - -/* more (possibly) configurable things - now pathnames */ -#define _PC_LINK_MAX 1 -#define _PC_MAX_CANON 2 -#define _PC_MAX_INPUT 3 -#define _PC_NAME_MAX 4 -#define _PC_PATH_MAX 5 -#define _PC_PIPE_BUF 6 -#define _PC_NO_TRUNC 7 -#define _PC_VDISABLE 8 -#define _PC_CHOWN_RESTRICTED 9 - -#include -#include -#include -#include - -#ifdef __LIBRARY__ - -#define __NR_setup 0 /* used only by init, to get system going */ -#define __NR_exit 1 -#define __NR_fork 2 -#define __NR_read 3 -#define __NR_write 4 -#define __NR_open 5 -#define __NR_close 6 -#define __NR_waitpid 7 -#define __NR_creat 8 -#define __NR_link 9 -#define __NR_unlink 10 -#define __NR_execve 11 -#define __NR_chdir 12 -#define __NR_time 13 -#define __NR_mknod 14 -#define __NR_chmod 15 -#define __NR_chown 16 -#define __NR_break 17 -#define __NR_stat 18 -#define __NR_lseek 19 -#define __NR_getpid 20 -#define __NR_mount 21 -#define __NR_umount 22 -#define __NR_setuid 23 -#define __NR_getuid 24 -#define __NR_stime 25 -#define __NR_ptrace 26 -#define __NR_alarm 27 -#define __NR_fstat 28 -#define __NR_pause 29 -#define __NR_utime 30 -#define __NR_stty 31 -#define __NR_gtty 32 -#define __NR_access 33 -#define __NR_nice 34 -#define __NR_ftime 35 -#define __NR_sync 36 -#define __NR_kill 37 -#define __NR_rename 38 -#define __NR_mkdir 39 -#define __NR_rmdir 40 -#define __NR_dup 41 -#define __NR_pipe 42 -#define __NR_times 43 -#define __NR_prof 44 -#define __NR_brk 45 -#define __NR_setgid 46 -#define __NR_getgid 47 -#define __NR_signal 48 -#define __NR_geteuid 49 -#define __NR_getegid 50 -#define __NR_acct 51 -#define __NR_phys 52 -#define __NR_lock 53 -#define __NR_ioctl 54 -#define __NR_fcntl 55 -#define __NR_mpx 56 -#define __NR_setpgid 57 -#define __NR_ulimit 58 -#define __NR_uname 59 -#define __NR_umask 60 -#define __NR_chroot 61 -#define __NR_ustat 62 -#define __NR_dup2 63 -#define __NR_getppid 64 -#define __NR_getpgrp 65 -#define __NR_setsid 66 -#define __NR_sigaction 67 -#define __NR_sgetmask 68 -#define __NR_ssetmask 69 -#define __NR_setreuid 70 -#define __NR_setregid 71 - -#define _syscall0(type,name) \ -type name(void) \ -{ \ -long __res; \ -__asm__ volatile ("int $0x80" \ - : "=a" (__res) \ - : "0" (__NR_##name)); \ -if (__res >= 0) \ - return (type) __res; \ -errno = -__res; \ -return -1; \ -} - -#define _syscall1(type,name,atype,a) \ -type name(atype a) \ -{ \ -long __res; \ -__asm__ volatile ("int $0x80" \ - : "=a" (__res) \ - : "0" (__NR_##name),"b" ((long)(a))); \ -if (__res >= 0) \ - return (type) __res; \ -errno = -__res; \ -return -1; \ -} - -#define _syscall2(type,name,atype,a,btype,b) \ -type name(atype a,btype b) \ -{ \ -long __res; \ -__asm__ volatile ("int $0x80" \ - : "=a" (__res) \ - : "0" (__NR_##name),"b" ((long)(a)),"c" ((long)(b))); \ -if (__res >= 0) \ - return (type) __res; \ -errno = -__res; \ -return -1; \ -} - -#define _syscall3(type,name,atype,a,btype,b,ctype,c) \ -type name(atype a,btype b,ctype c) \ -{ \ -long __res; \ -__asm__ volatile ("int $0x80" \ - : "=a" (__res) \ - : "0" (__NR_##name),"b" ((long)(a)),"c" ((long)(b)),"d" ((long)(c))); \ -if (__res>=0) \ - return (type) __res; \ -errno=-__res; \ -return -1; \ -} - -#endif /* __LIBRARY__ */ - -extern int errno; - -int access(const char * filename, mode_t mode); -int acct(const char * filename); -int alarm(int sec); -int brk(void * end_data_segment); -void * sbrk(ptrdiff_t increment); -int chdir(const char * filename); -int chmod(const char * filename, mode_t mode); -int chown(const char * filename, uid_t owner, gid_t group); -int chroot(const char * filename); -int close(int fildes); -int creat(const char * filename, mode_t mode); -int dup(int fildes); -int execve(const char * filename, char ** argv, char ** envp); -int execv(const char * pathname, char ** argv); -int execvp(const char * file, char ** argv); -int execl(const char * pathname, char * arg0, ...); -int execlp(const char * file, char * arg0, ...); -int execle(const char * pathname, char * arg0, ...); -volatile void exit(int status); -volatile void _exit(int status); -int fcntl(int fildes, int cmd, ...); -int fork(void); -int getpid(void); -int getuid(void); -int geteuid(void); -int getgid(void); -int getegid(void); -int ioctl(int fildes, int cmd, ...); -int kill(pid_t pid, int signal); -int link(const char * filename1, const char * filename2); -int lseek(int fildes, off_t offset, int origin); -int mknod(const char * filename, mode_t mode, dev_t dev); -int mount(const char * specialfile, const char * dir, int rwflag); -int nice(int val); -int open(const char * filename, int flag, ...); -int pause(void); -int pipe(int * fildes); -int read(int fildes, char * buf, off_t count); -int setpgrp(void); -int setpgid(pid_t pid,pid_t pgid); -int setuid(uid_t uid); -int setgid(gid_t gid); -void (*signal(int sig, void (*fn)(int)))(int); -int stat(const char * filename, struct stat * stat_buf); -int fstat(int fildes, struct stat * stat_buf); -int stime(time_t * tptr); -int sync(void); -time_t time(time_t * tloc); -time_t times(struct tms * tbuf); -int ulimit(int cmd, long limit); -mode_t umask(mode_t mask); -int umount(const char * specialfile); -int uname(struct utsname * name); -int unlink(const char * filename); -int ustat(dev_t dev, struct ustat * ubuf); -int utime(const char * filename, struct utimbuf * times); -pid_t waitpid(pid_t pid,int * wait_stat,int options); -pid_t wait(int * wait_stat); -int write(int fildes, const char * buf, off_t count); -int dup2(int oldfd, int newfd); -int getppid(void); -pid_t getpgrp(void); -pid_t setsid(void); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/utime.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/utime.h deleted file mode 100644 index 83f07c7..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/include/utime.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _UTIME_H -#define _UTIME_H - -#include /* I know - shouldn't do this, but .. */ - -struct utimbuf { - time_t actime; - time_t modtime; -}; - -extern int utime(const char *filename, struct utimbuf *times); - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/init/main.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/init/main.c deleted file mode 100644 index c304d06..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/init/main.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - * linux/init/main.c - * - * (C) 1991 Linus Torvalds - */ - -#define __LIBRARY__ -#include -#include - -/* - * we need this inline - forking from kernel space will result - * in NO COPY ON WRITE (!!!), until an execve is executed. This - * is no problem, but for the stack. This is handled by not letting - * main() use the stack at all after fork(). Thus, no function - * calls - which means inline code for fork too, as otherwise we - * would use the stack upon exit from 'fork()'. - * - * Actually only pause and fork are needed inline, so that there - * won't be any messing with the stack from main(), but we define - * some others too. - */ -static inline _syscall0(int,fork) -static inline _syscall0(int,pause) -static inline _syscall1(int,setup,void *,BIOS) -static inline _syscall0(int,sync) - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -static char printbuf[1024]; - -extern int vsprintf(); -extern void init(void); -extern void blk_dev_init(void); -extern void chr_dev_init(void); -extern void hd_init(void); -extern void floppy_init(void); -extern void mem_init(long start, long end); -extern long rd_init(long mem_start, int length); -extern long kernel_mktime(struct tm * tm); -extern long startup_time; - -/* - * This is set up by the setup-routine at boot-time - */ -#define EXT_MEM_K (*(unsigned short *)0x90002) -#define DRIVE_INFO (*(struct drive_info *)0x90080) -#define ORIG_ROOT_DEV (*(unsigned short *)0x901FC) - -/* - * Yeah, yeah, it's ugly, but I cannot find how to do this correctly - * and this seems to work. I anybody has more info on the real-time - * clock I'd be interested. Most of this was trial and error, and some - * bios-listing reading. Urghh. - */ - -#define CMOS_READ(addr) ({ \ -outb_p(0x80|addr,0x70); \ -inb_p(0x71); \ -}) - -#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) - -static void time_init(void) -{ - struct tm time; - - do { - time.tm_sec = CMOS_READ(0); - time.tm_min = CMOS_READ(2); - time.tm_hour = CMOS_READ(4); - time.tm_mday = CMOS_READ(7); - time.tm_mon = CMOS_READ(8); - time.tm_year = CMOS_READ(9); - } while (time.tm_sec != CMOS_READ(0)); - BCD_TO_BIN(time.tm_sec); - BCD_TO_BIN(time.tm_min); - BCD_TO_BIN(time.tm_hour); - BCD_TO_BIN(time.tm_mday); - BCD_TO_BIN(time.tm_mon); - BCD_TO_BIN(time.tm_year); - time.tm_mon--; - startup_time = kernel_mktime(&time); -} - -static long memory_end = 0; -static long buffer_memory_end = 0; -static long main_memory_start = 0; - -struct drive_info { char dummy[32]; } drive_info; - -void start(void) /* This really IS void, no error here. */ -{ /* The startup routine assumes (well, ...) this */ -/* - * Interrupts are still disabled. Do necessary setups, then - * enable them - */ - ROOT_DEV = ORIG_ROOT_DEV; - drive_info = DRIVE_INFO; - memory_end = (1<<20) + (EXT_MEM_K<<10); - memory_end &= 0xfffff000; - if (memory_end > 16*1024*1024) - memory_end = 16*1024*1024; - if (memory_end > 12*1024*1024) - buffer_memory_end = 4*1024*1024; - else if (memory_end > 6*1024*1024) - buffer_memory_end = 2*1024*1024; - else - buffer_memory_end = 1*1024*1024; - main_memory_start = buffer_memory_end; -#ifdef RAMDISK - main_memory_start += rd_init(main_memory_start, RAMDISK*1024); -#endif - mem_init(main_memory_start,memory_end); - trap_init(); - blk_dev_init(); - chr_dev_init(); - tty_init(); - time_init(); - sched_init(); - buffer_init(buffer_memory_end); - hd_init(); - floppy_init(); - sti(); - move_to_user_mode(); - if (!fork()) { /* we count on this going ok */ - init(); - } -/* - * NOTE!! For any other task 'pause()' would mean we have to get a - * signal to awaken, but task0 is the sole exception (see 'schedule()') - * as task 0 gets activated at every idle moment (when no other tasks - * can run). For task0 'pause()' just means we go check if some other - * task can run, and if not we return here. - */ - for(;;) pause(); -} - -static int printf(const char *fmt, ...) -{ - va_list args; - int i; - - va_start(args, fmt); - write(1,printbuf,i=vsprintf(printbuf, fmt, args)); - va_end(args); - return i; -} - -static char * argv_rc[] = { "/bin/sh", NULL }; -static char * envp_rc[] = { "HOME=/", NULL }; - -static char * argv[] = { "-/bin/sh",NULL }; -static char * envp[] = { "HOME=/usr/root", NULL }; - -void init(void) -{ - int pid,i; - - setup((void *) &drive_info); - (void) open("/dev/tty0",O_RDWR,0); - (void) dup(0); - (void) dup(0); - printf("%d buffers = %d bytes buffer space\n\r",NR_BUFFERS, - NR_BUFFERS*BLOCK_SIZE); - printf("Free mem: %d bytes\n\r",memory_end-main_memory_start); - if (!(pid=fork())) { - close(0); - if (open("/etc/rc",O_RDONLY,0)) - _exit(1); - execve("/bin/sh",argv_rc,envp_rc); - _exit(2); - } - if (pid>0) - while (pid != wait(&i)) - /* nothing */; - while (1) { - if ((pid=fork())<0) { - printf("Fork failed in init\r\n"); - continue; - } - if (!pid) { - close(0);close(1);close(2); - setsid(); - (void) open("/dev/tty0",O_RDWR,0); - (void) dup(0); - (void) dup(0); - _exit(execve("/bin/sh",argv,envp)); - } - while (1) - if (pid == wait(&i)) - break; - printf("\n\rchild %d died with code %04x\n\r",pid,i); - sync(); - } - _exit(0); /* NOTE! _exit, not exit() */ -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/Makefile b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/Makefile deleted file mode 100644 index fbd0d43..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/Makefile +++ /dev/null @@ -1,83 +0,0 @@ -# -# Makefile for the FREAX-kernel. -# -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# - -AR =ar -AS =as -LD =ld -LDFLAGS =-s -x -CC =gcc -mcpu=i386 -CFLAGS =-Wall -O -fstrength-reduce -fomit-frame-pointer \ - -finline-functions -nostdinc -I../include -CPP =gcc -E -nostdinc -I../include - -.c.s: - $(CC) $(CFLAGS) \ - -S -o $*.s $< -.s.o: - $(AS) -o $*.o $< -.c.o: - $(CC) $(CFLAGS) \ - -c -o $*.o $< - -OBJS = sched.o system_call.o traps.o asm.o fork.o \ - panic.o printk.o vsprintf.o sys.o exit.o \ - signal.o mktime.o - -kernel.o: $(OBJS) - $(LD) -r -o kernel.o $(OBJS) - sync - -clean: - rm -f core *.o *.a tmp_make keyboard.s - for i in *.c;do rm -f `basename $$i .c`.s;done - (cd chr_drv; make clean) - (cd blk_drv; make clean) - (cd math; make clean) - -dep: - sed '/\#\#\# Dependencies/q' < Makefile > tmp_make - (for i in *.c;do echo -n `echo $$i | sed 's,\.c,\.s,'`" "; \ - $(CPP) -M $$i;done) >> tmp_make - cp tmp_make Makefile - (cd chr_drv; make dep) - (cd blk_drv; make dep) - -### Dependencies: -exit.s exit.o: exit.c ../include/errno.h ../include/signal.h \ - ../include/sys/types.h ../include/sys/wait.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/fs.h ../include/linux/mm.h \ - ../include/linux/kernel.h ../include/linux/tty.h ../include/termios.h \ - ../include/asm/segment.h -fork.s fork.o: fork.c ../include/errno.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/fs.h ../include/sys/types.h \ - ../include/linux/mm.h ../include/signal.h ../include/linux/kernel.h \ - ../include/asm/segment.h ../include/asm/system.h -mktime.s mktime.o: mktime.c ../include/time.h -panic.s panic.o: panic.c ../include/linux/kernel.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/fs.h ../include/sys/types.h \ - ../include/linux/mm.h ../include/signal.h -printk.s printk.o: printk.c ../include/stdarg.h ../include/stddef.h \ - ../include/linux/kernel.h -sched.s sched.o: sched.c ../include/linux/sched.h ../include/linux/head.h \ - ../include/linux/fs.h ../include/sys/types.h ../include/linux/mm.h \ - ../include/signal.h ../include/linux/kernel.h ../include/linux/sys.h \ - ../include/linux/fdreg.h ../include/asm/system.h ../include/asm/io.h \ - ../include/asm/segment.h -signal.s signal.o: signal.c ../include/linux/sched.h ../include/linux/head.h \ - ../include/linux/fs.h ../include/sys/types.h ../include/linux/mm.h \ - ../include/signal.h ../include/linux/kernel.h ../include/asm/segment.h -sys.s sys.o: sys.c ../include/errno.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/fs.h ../include/sys/types.h \ - ../include/linux/mm.h ../include/signal.h ../include/linux/tty.h \ - ../include/termios.h ../include/linux/kernel.h ../include/asm/segment.h \ - ../include/sys/times.h ../include/sys/utsname.h -traps.s traps.o: traps.c ../include/string.h ../include/linux/head.h \ - ../include/linux/sched.h ../include/linux/fs.h ../include/sys/types.h \ - ../include/linux/mm.h ../include/signal.h ../include/linux/kernel.h \ - ../include/asm/system.h ../include/asm/segment.h ../include/asm/io.h -vsprintf.s vsprintf.o: vsprintf.c ../include/stdarg.h ../include/string.h diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/asm.s b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/asm.s deleted file mode 100644 index 34f9b20..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/asm.s +++ /dev/null @@ -1,146 +0,0 @@ -/* - * linux/kernel/asm.s - * - * (C) 1991 Linus Torvalds - */ - -/* - * asm.s contains the low-level code for most hardware faults. - * page_exception is handled by the mm, so that isn't here. This - * file also handles (hopefully) fpu-exceptions due to TS-bit, as - * the fpu must be properly saved/resored. This hasn't been tested. - */ - -.globl _divide_error, _debug, _nmi, _int3, _overflow,_bounds,_invalid_op -.globl _double_fault, _coprocessor_segment_overrun -.globl _invalid_TSS, _segment_not_present, _stack_segment -.globl _general_protection, _coprocessor_error,_irq13, _reserved - -_divide_error: - pushl $_do_divide_error -no_error_code: - xchgl %eax,(%esp) - pushl %ebx - pushl %ecx - pushl %edx - pushl %edi - pushl %esi - pushl %ebp - push %ds - push %es - push %fs - pushl $0 # "error code" - lea 44(%esp),%edx - pushl %edx - movl $0x10,%edx - mov %dx,%ds - mov %dx,%es - mov %dx,%fs - call *%eax - addl $8,%esp - pop %fs - pop %es - pop %ds - popl %ebp - popl %esi - popl %edi - popl %edx - popl %ecx - popl %ebx - popl %eax - iret - -_debug: - pushl $_do_int3 # _do_debug - jmp no_error_code - -_nmi: - pushl $_do_nmi - jmp no_error_code - -_int3: - pushl $_do_int3 - jmp no_error_code - -_overflow: - pushl $_do_overflow - jmp no_error_code - -_bounds: - pushl $_do_bounds - jmp no_error_code - -_invalid_op: - pushl $_do_invalid_op - jmp no_error_code - -_coprocessor_segment_overrun: - pushl $_do_coprocessor_segment_overrun - jmp no_error_code - -_reserved: - pushl $_do_reserved - jmp no_error_code - -_irq13: - pushl %eax - xorb %al,%al - outb %al,$0xF0 - movb $0x20,%al - outb %al,$0x20 - jmp 1f -1: jmp 1f -1: outb %al,$0xA0 - popl %eax - jmp _coprocessor_error - -_double_fault: - pushl $_do_double_fault -error_code: - xchgl %eax,4(%esp) # error code <-> %eax - xchgl %ebx,(%esp) # &function <-> %ebx - pushl %ecx - pushl %edx - pushl %edi - pushl %esi - pushl %ebp - push %ds - push %es - push %fs - pushl %eax # error code - lea 44(%esp),%eax # offset - pushl %eax - movl $0x10,%eax - mov %ax,%ds - mov %ax,%es - mov %ax,%fs - call *%ebx - addl $8,%esp - pop %fs - pop %es - pop %ds - popl %ebp - popl %esi - popl %edi - popl %edx - popl %ecx - popl %ebx - popl %eax - iret - -_invalid_TSS: - pushl $_do_invalid_TSS - jmp error_code - -_segment_not_present: - pushl $_do_segment_not_present - jmp error_code - -_stack_segment: - pushl $_do_stack_segment - jmp error_code - -_general_protection: - pushl $_do_general_protection - jmp error_code - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/Makefile b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/Makefile deleted file mode 100644 index 14074c2..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -# -# Makefile for the FREAX-kernel block device drivers. -# -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# - -AR =ar -AS =as -LD =ld -LDFLAGS =-s -x -CC =gcc -mcpu=i386 -CFLAGS =-Wall -O -fstrength-reduce -fomit-frame-pointer \ - -finline-functions -nostdinc -I../../include -CPP =gcc -E -nostdinc -I../../include - -.c.s: - $(CC) $(CFLAGS) \ - -S -o $*.s $< -.s.o: - $(AS) -o $*.o $< -.c.o: - $(CC) $(CFLAGS) \ - -c -o $*.o $< - -OBJS = ll_rw_blk.o floppy.o hd.o ramdisk.o - -blk_drv.a: $(OBJS) - $(AR) rcs blk_drv.a $(OBJS) - sync - -clean: - rm -f core *.o *.a tmp_make - for i in *.c;do rm -f `basename $$i .c`.s;done - -dep: - sed '/\#\#\# Dependencies/q' < Makefile > tmp_make - (for i in *.c;do echo -n `echo $$i | sed 's,\.c,\.s,'`" "; \ - $(CPP) -M $$i;done) >> tmp_make - cp tmp_make Makefile - -### Dependencies: -floppy.s floppy.o: floppy.c ../../include/linux/sched.h ../../include/linux/head.h \ - ../../include/linux/fs.h ../../include/sys/types.h \ - ../../include/linux/mm.h ../../include/signal.h \ - ../../include/linux/kernel.h ../../include/linux/fdreg.h \ - ../../include/asm/system.h ../../include/asm/io.h \ - ../../include/asm/segment.h blk.h -hd.s hd.o: hd.c ../../include/linux/config.h ../../include/linux/sched.h \ - ../../include/linux/head.h ../../include/linux/fs.h \ - ../../include/sys/types.h ../../include/linux/mm.h \ - ../../include/signal.h ../../include/linux/kernel.h \ - ../../include/linux/hdreg.h ../../include/asm/system.h \ - ../../include/asm/io.h ../../include/asm/segment.h blk.h -ll_rw_blk.s ll_rw_blk.o: ll_rw_blk.c ../../include/errno.h \ - ../../include/linux/sched.h ../../include/linux/head.h \ - ../../include/linux/fs.h ../../include/sys/types.h \ - ../../include/linux/mm.h ../../include/signal.h \ - ../../include/linux/kernel.h ../../include/asm/system.h blk.h -ramdisk.s ramdisk.o: ramdisk.c ../../include/string.h ../../include/linux/config.h \ - ../../include/linux/sched.h ../../include/linux/head.h \ - ../../include/linux/fs.h ../../include/sys/types.h \ - ../../include/linux/mm.h ../../include/signal.h \ - ../../include/linux/kernel.h ../../include/asm/system.h \ - ../../include/asm/segment.h ../../include/asm/memory.h blk.h diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/blk.h b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/blk.h deleted file mode 100644 index 9ee7591..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/blk.h +++ /dev/null @@ -1,140 +0,0 @@ -#ifndef _BLK_H -#define _BLK_H - -#define NR_BLK_DEV 7 -/* - * NR_REQUEST is the number of entries in the request-queue. - * NOTE that writes may use only the low 2/3 of these: reads - * take precedence. - * - * 32 seems to be a reasonable number: enough to get some benefit - * from the elevator-mechanism, but not so much as to lock a lot of - * buffers when they are in the queue. 64 seems to be too many (easily - * long pauses in reading when heavy writing/syncing is going on) - */ -#define NR_REQUEST 32 - -/* - * Ok, this is an expanded form so that we can use the same - * request for paging requests when that is implemented. In - * paging, 'bh' is NULL, and 'waiting' is used to wait for - * read/write completion. - */ -struct request { - int dev; /* -1 if no request */ - int cmd; /* READ or WRITE */ - int errors; - unsigned long sector; - unsigned long nr_sectors; - char * buffer; - struct task_struct * waiting; - struct buffer_head * bh; - struct request * next; -}; - -/* - * This is used in the elevator algorithm: Note that - * reads always go before writes. This is natural: reads - * are much more time-critical than writes. - */ -#define IN_ORDER(s1,s2) \ -((s1)->cmd<(s2)->cmd || ((s1)->cmd==(s2)->cmd && \ -((s1)->dev < (s2)->dev || ((s1)->dev == (s2)->dev && \ -(s1)->sector < (s2)->sector)))) - -struct blk_dev_struct { - void (*request_fn)(void); - struct request * current_request; -}; - -extern struct blk_dev_struct blk_dev[NR_BLK_DEV]; -extern struct request request[NR_REQUEST]; -extern struct task_struct * wait_for_request; - -#ifdef MAJOR_NR - -/* - * Add entries as needed. Currently the only block devices - * supported are hard-disks and floppies. - */ - -#if (MAJOR_NR == 1) -/* ram disk */ -#define DEVICE_NAME "ramdisk" -#define DEVICE_REQUEST do_rd_request -#define DEVICE_NR(device) ((device) & 7) -#define DEVICE_ON(device) -#define DEVICE_OFF(device) - -#elif (MAJOR_NR == 2) -/* floppy */ -#define DEVICE_NAME "floppy" -#define DEVICE_INTR do_floppy -#define DEVICE_REQUEST do_fd_request -#define DEVICE_NR(device) ((device) & 3) -#define DEVICE_ON(device) floppy_on(DEVICE_NR(device)) -#define DEVICE_OFF(device) floppy_off(DEVICE_NR(device)) - -#elif (MAJOR_NR == 3) -/* harddisk */ -#define DEVICE_NAME "harddisk" -#define DEVICE_INTR do_hd -#define DEVICE_REQUEST do_hd_request -#define DEVICE_NR(device) (MINOR(device)/5) -#define DEVICE_ON(device) -#define DEVICE_OFF(device) - -#elif -/* unknown blk device */ -#error "unknown blk device" - -#endif - -#define CURRENT (blk_dev[MAJOR_NR].current_request) -#define CURRENT_DEV DEVICE_NR(CURRENT->dev) - -#ifdef DEVICE_INTR -void (*DEVICE_INTR)(void) = NULL; -#endif -static void (DEVICE_REQUEST)(void); - -static inline void unlock_buffer(struct buffer_head * bh) -{ - if (!bh->b_lock) - printk(DEVICE_NAME ": free buffer being unlocked\n"); - bh->b_lock=0; - wake_up(&bh->b_wait); -} - -static inline void end_request(int uptodate) -{ - DEVICE_OFF(CURRENT->dev); - if (CURRENT->bh) { - CURRENT->bh->b_uptodate = uptodate; - unlock_buffer(CURRENT->bh); - } - if (!uptodate) { - printk(DEVICE_NAME " I/O error\n\r"); - printk("dev %04x, block %d\n\r",CURRENT->dev, - CURRENT->bh->b_blocknr); - } - wake_up(&CURRENT->waiting); - wake_up(&wait_for_request); - CURRENT->dev = -1; - CURRENT = CURRENT->next; -} - -#define INIT_REQUEST \ -repeat: \ - if (!CURRENT) \ - return; \ - if (MAJOR(CURRENT->dev) != MAJOR_NR) \ - panic(DEVICE_NAME ": request list destroyed"); \ - if (CURRENT->bh) { \ - if (!CURRENT->bh->b_lock) \ - panic(DEVICE_NAME ": block not locked"); \ - } - -#endif - -#endif diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/floppy.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/floppy.c deleted file mode 100644 index 6ca6401..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/floppy.c +++ /dev/null @@ -1,462 +0,0 @@ -/* - * linux/kernel/floppy.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * 02.12.91 - Changed to static variables to indicate need for reset - * and recalibrate. This makes some things easier (output_byte reset - * checking etc), and means less interrupt jumping in case of errors, - * so the code is hopefully easier to understand. - */ - -/* - * This file is certainly a mess. I've tried my best to get it working, - * but I don't like programming floppies, and I have only one anyway. - * Urgel. I should check for more errors, and do more graceful error - * recovery. Seems there are problems with several drives. I've tried to - * correct them. No promises. - */ - -/* - * As with hd.c, all routines within this file can (and will) be called - * by interrupts, so extreme caution is needed. A hardware interrupt - * handler may not sleep, or a kernel panic will happen. Thus I cannot - * call "floppy-on" directly, but have to set a special timer interrupt - * etc. - * - * Also, I'm not certain this works on more than 1 floppy. Bugs may - * abund. - */ - -#include -#include -#include -#include -#include -#include -#include - -#define MAJOR_NR 2 -#include "blk.h" - -static int recalibrate = 0; -static int reset = 0; -static int seek = 0; - -extern unsigned char current_DOR; - -#define immoutb_p(val,port) \ -__asm__("outb %0,%1\n\tjmp 1f\n1:\tjmp 1f\n1:"::"a" ((char) (val)),"i" (port)) - -#define TYPE(x) ((x)>>2) -#define DRIVE(x) ((x)&0x03) -/* - * Note that MAX_ERRORS=8 doesn't imply that we retry every bad read - * max 8 times - some types of errors increase the errorcount by 2, - * so we might actually retry only 5-6 times before giving up. - */ -#define MAX_ERRORS 8 - -/* - * globals used by 'result()' - */ -#define MAX_REPLIES 7 -static unsigned char reply_buffer[MAX_REPLIES]; -#define ST0 (reply_buffer[0]) -#define ST1 (reply_buffer[1]) -#define ST2 (reply_buffer[2]) -#define ST3 (reply_buffer[3]) - -/* - * This struct defines the different floppy types. Unlike minix - * linux doesn't have a "search for right type"-type, as the code - * for that is convoluted and weird. I've got enough problems with - * this driver as it is. - * - * The 'stretch' tells if the tracks need to be boubled for some - * types (ie 360kB diskette in 1.2MB drive etc). Others should - * be self-explanatory. - */ -static struct floppy_struct { - unsigned int size, sect, head, track, stretch; - unsigned char gap,rate,spec1; -} floppy_type[] = { - { 0, 0,0, 0,0,0x00,0x00,0x00 }, /* no testing */ - { 720, 9,2,40,0,0x2A,0x02,0xDF }, /* 360kB PC diskettes */ - { 2400,15,2,80,0,0x1B,0x00,0xDF }, /* 1.2 MB AT-diskettes */ - { 720, 9,2,40,1,0x2A,0x02,0xDF }, /* 360kB in 720kB drive */ - { 1440, 9,2,80,0,0x2A,0x02,0xDF }, /* 3.5" 720kB diskette */ - { 720, 9,2,40,1,0x23,0x01,0xDF }, /* 360kB in 1.2MB drive */ - { 1440, 9,2,80,0,0x23,0x01,0xDF }, /* 720kB in 1.2MB drive */ - { 2880,18,2,80,0,0x1B,0x00,0xCF }, /* 1.44MB diskette */ -}; -/* - * Rate is 0 for 500kb/s, 2 for 300kbps, 1 for 250kbps - * Spec1 is 0xSH, where S is stepping rate (F=1ms, E=2ms, D=3ms etc), - * H is head unload time (1=16ms, 2=32ms, etc) - * - * Spec2 is (HLD<<1 | ND), where HLD is head load time (1=2ms, 2=4 ms etc) - * and ND is set means no DMA. Hardcoded to 6 (HLD=6ms, use DMA). - */ - -extern void floppy_interrupt(void); -extern char tmp_floppy_area[1024]; - -/* - * These are global variables, as that's the easiest way to give - * information to interrupts. They are the data used for the current - * request. - */ -static int cur_spec1 = -1; -static int cur_rate = -1; -static struct floppy_struct * floppy = floppy_type; -static unsigned char current_drive = 0; -static unsigned char sector = 0; -static unsigned char head = 0; -static unsigned char track = 0; -static unsigned char seek_track = 0; -static unsigned char current_track = 255; -static unsigned char command = 0; -unsigned char selected = 0; -struct task_struct * wait_on_floppy_select = NULL; - -void floppy_deselect(unsigned int nr) -{ - if (nr != (current_DOR & 3)) - printk("floppy_deselect: drive not selected\n\r"); - selected = 0; - wake_up(&wait_on_floppy_select); -} - -/* - * floppy-change is never called from an interrupt, so we can relax a bit - * here, sleep etc. Note that floppy-on tries to set current_DOR to point - * to the desired drive, but it will probably not survive the sleep if - * several floppies are used at the same time: thus the loop. - */ -int floppy_change(unsigned int nr) -{ -repeat: - floppy_on(nr); - while ((current_DOR & 3) != nr && selected) - interruptible_sleep_on(&wait_on_floppy_select); - if ((current_DOR & 3) != nr) - goto repeat; - if (inb(FD_DIR) & 0x80) { - floppy_off(nr); - return 1; - } - floppy_off(nr); - return 0; -} - -#define copy_buffer(from,to) \ -__asm__("cld ; rep ; movsl" \ - ::"c" (BLOCK_SIZE/4),"S" ((long)(from)),"D" ((long)(to)) \ - ) - -static void setup_DMA(void) -{ - long addr = (long) CURRENT->buffer; - - cli(); - if (addr >= 0x100000) { - addr = (long) tmp_floppy_area; - if (command == FD_WRITE) - copy_buffer(CURRENT->buffer,tmp_floppy_area); - } -/* mask DMA 2 */ - immoutb_p(4|2,10); -/* output command byte. I don't know why, but everyone (minix, */ -/* sanches & canton) output this twice, first to 12 then to 11 */ - __asm__("outb %%al,$12\n\tjmp 1f\n1:\tjmp 1f\n1:\t" - "outb %%al,$11\n\tjmp 1f\n1:\tjmp 1f\n1:":: - "a" ((char) ((command == FD_READ)?DMA_READ:DMA_WRITE))); -/* 8 low bits of addr */ - immoutb_p(addr,4); - addr >>= 8; -/* bits 8-15 of addr */ - immoutb_p(addr,4); - addr >>= 8; -/* bits 16-19 of addr */ - immoutb_p(addr,0x81); -/* low 8 bits of count-1 (1024-1=0x3ff) */ - immoutb_p(0xff,5); -/* high 8 bits of count-1 */ - immoutb_p(3,5); -/* activate DMA 2 */ - immoutb_p(0|2,10); - sti(); -} - -static void output_byte(char byte) -{ - int counter; - unsigned char status; - - if (reset) - return; - for(counter = 0 ; counter < 10000 ; counter++) { - status = inb_p(FD_STATUS) & (STATUS_READY | STATUS_DIR); - if (status == STATUS_READY) { - outb(byte,FD_DATA); - return; - } - } - reset = 1; - printk("Unable to send byte to FDC\n\r"); -} - -static int result(void) -{ - int i = 0, counter, status; - - if (reset) - return -1; - for (counter = 0 ; counter < 10000 ; counter++) { - status = inb_p(FD_STATUS)&(STATUS_DIR|STATUS_READY|STATUS_BUSY); - if (status == STATUS_READY) - return i; - if (status == (STATUS_DIR|STATUS_READY|STATUS_BUSY)) { - if (i >= MAX_REPLIES) - break; - reply_buffer[i++] = inb_p(FD_DATA); - } - } - reset = 1; - printk("Getstatus times out\n\r"); - return -1; -} - -static void bad_flp_intr(void) -{ - CURRENT->errors++; - if (CURRENT->errors > MAX_ERRORS) { - floppy_deselect(current_drive); - end_request(0); - } - if (CURRENT->errors > MAX_ERRORS/2) - reset = 1; - else - recalibrate = 1; -} - -/* - * Ok, this interrupt is called after a DMA read/write has succeeded, - * so we check the results, and copy any buffers. - */ -static void rw_interrupt(void) -{ - if (result() != 7 || (ST0 & 0xf8) || (ST1 & 0xbf) || (ST2 & 0x73)) { - if (ST1 & 0x02) { - printk("Drive %d is write protected\n\r",current_drive); - floppy_deselect(current_drive); - end_request(0); - } else - bad_flp_intr(); - do_fd_request(); - return; - } - if (command == FD_READ && (unsigned long)(CURRENT->buffer) >= 0x100000) - copy_buffer(tmp_floppy_area,CURRENT->buffer); - floppy_deselect(current_drive); - end_request(1); - do_fd_request(); -} - -inline void setup_rw_floppy(void) -{ - setup_DMA(); - do_floppy = rw_interrupt; - output_byte(command); - output_byte(head<<2 | current_drive); - output_byte(track); - output_byte(head); - output_byte(sector); - output_byte(2); /* sector size = 512 */ - output_byte(floppy->sect); - output_byte(floppy->gap); - output_byte(0xFF); /* sector size (0xff when n!=0 ?) */ - if (reset) - do_fd_request(); -} - -/* - * This is the routine called after every seek (or recalibrate) interrupt - * from the floppy controller. Note that the "unexpected interrupt" routine - * also does a recalibrate, but doesn't come here. - */ -static void seek_interrupt(void) -{ -/* sense drive status */ - output_byte(FD_SENSEI); - if (result() != 2 || (ST0 & 0xF8) != 0x20 || ST1 != seek_track) { - bad_flp_intr(); - do_fd_request(); - return; - } - current_track = ST1; - setup_rw_floppy(); -} - -/* - * This routine is called when everything should be correctly set up - * for the transfer (ie floppy motor is on and the correct floppy is - * selected). - */ -static void transfer(void) -{ - if (cur_spec1 != floppy->spec1) { - cur_spec1 = floppy->spec1; - output_byte(FD_SPECIFY); - output_byte(cur_spec1); /* hut etc */ - output_byte(6); /* Head load time =6ms, DMA */ - } - if (cur_rate != floppy->rate) - outb_p(cur_rate = floppy->rate,FD_DCR); - if (reset) { - do_fd_request(); - return; - } - if (!seek) { - setup_rw_floppy(); - return; - } - do_floppy = seek_interrupt; - if (seek_track) { - output_byte(FD_SEEK); - output_byte(head<<2 | current_drive); - output_byte(seek_track); - } else { - output_byte(FD_RECALIBRATE); - output_byte(head<<2 | current_drive); - } - if (reset) - do_fd_request(); -} - -/* - * Special case - used after a unexpected interrupt (or reset) - */ -static void recal_interrupt(void) -{ - output_byte(FD_SENSEI); - if (result()!=2 || (ST0 & 0xE0) == 0x60) - reset = 1; - else - recalibrate = 0; - do_fd_request(); -} - -void unexpected_floppy_interrupt(void) -{ - output_byte(FD_SENSEI); - if (result()!=2 || (ST0 & 0xE0) == 0x60) - reset = 1; - else - recalibrate = 1; -} - -static void recalibrate_floppy(void) -{ - recalibrate = 0; - current_track = 0; - do_floppy = recal_interrupt; - output_byte(FD_RECALIBRATE); - output_byte(head<<2 | current_drive); - if (reset) - do_fd_request(); -} - -static void reset_interrupt(void) -{ - output_byte(FD_SENSEI); - (void) result(); - output_byte(FD_SPECIFY); - output_byte(cur_spec1); /* hut etc */ - output_byte(6); /* Head load time =6ms, DMA */ - do_fd_request(); -} - -/* - * reset is done by pulling bit 2 of DOR low for a while. - */ -static void reset_floppy(void) -{ - int i; - - reset = 0; - cur_spec1 = -1; - cur_rate = -1; - recalibrate = 1; - printk("Reset-floppy called\n\r"); - cli(); - do_floppy = reset_interrupt; - outb_p(current_DOR & ~0x04,FD_DOR); - for (i=0 ; i<100 ; i++) - __asm__("nop"); - outb(current_DOR,FD_DOR); - sti(); -} - -static void floppy_on_interrupt(void) -{ -/* We cannot do a floppy-select, as that might sleep. We just force it */ - selected = 1; - if (current_drive != (current_DOR & 3)) { - current_DOR &= 0xFC; - current_DOR |= current_drive; - outb(current_DOR,FD_DOR); - add_timer(2,&transfer); - } else - transfer(); -} - -void do_fd_request(void) -{ - unsigned int block; - - seek = 0; - if (reset) { - reset_floppy(); - return; - } - if (recalibrate) { - recalibrate_floppy(); - return; - } - INIT_REQUEST; - floppy = (MINOR(CURRENT->dev)>>2) + floppy_type; - if (current_drive != CURRENT_DEV) - seek = 1; - current_drive = CURRENT_DEV; - block = CURRENT->sector; - if (block+2 > floppy->size) { - end_request(0); - goto repeat; - } - sector = block % floppy->sect; - block /= floppy->sect; - head = block % floppy->head; - track = block / floppy->head; - seek_track = track << floppy->stretch; - if (seek_track != current_track) - seek = 1; - sector++; - if (CURRENT->cmd == READ) - command = FD_READ; - else if (CURRENT->cmd == WRITE) - command = FD_WRITE; - else - panic("do_fd_request: unknown command"); - add_timer(ticks_to_floppy_on(current_drive),&floppy_on_interrupt); -} - -void floppy_init(void) -{ - blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST; - set_trap_gate(0x26,&floppy_interrupt); - outb(inb_p(0x21)&~0x40,0x21); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/hd.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/hd.c deleted file mode 100644 index 3e176f7..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/hd.c +++ /dev/null @@ -1,349 +0,0 @@ -/* - * linux/kernel/hd.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * This is the low-level hd interrupt support. It traverses the - * request-list, using interrupts to jump between functions. As - * all the functions are called within interrupts, we may not - * sleep. Special care is recommended. - * - * modified by Drew Eckhardt to check nr of hd's from the CMOS. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAJOR_NR 3 -#include "blk.h" - -#define CMOS_READ(addr) ({ \ -outb_p(0x80|addr,0x70); \ -inb_p(0x71); \ -}) - -/* Max read/write errors/sector */ -#define MAX_ERRORS 7 -#define MAX_HD 2 - -static void recal_intr(void); - -static int recalibrate = 1; -static int reset = 1; - -/* - * This struct defines the HD's and their types. - */ -struct hd_i_struct { - int head,sect,cyl,wpcom,lzone,ctl; - }; -#ifdef HD_TYPE -struct hd_i_struct hd_info[] = { HD_TYPE }; -#define NR_HD ((sizeof (hd_info))/(sizeof (struct hd_i_struct))) -#else -struct hd_i_struct hd_info[] = { {0,0,0,0,0,0},{0,0,0,0,0,0} }; -static int NR_HD = 0; -#endif - -static struct hd_struct { - long start_sect; - long nr_sects; -} hd[5*MAX_HD]={{0,0},}; - -#define port_read(port,buf,nr) \ -__asm__("cld;rep;insw"::"d" (port),"D" (buf),"c" (nr)) - -#define port_write(port,buf,nr) \ -__asm__("cld;rep;outsw"::"d" (port),"S" (buf),"c" (nr)) - -extern void hd_interrupt(void); -extern void rd_load(void); - -/* This may be used only once, enforced by 'static int callable' */ -int sys_setup(void * BIOS) -{ - static int callable = 1; - int i,drive; - unsigned char cmos_disks; - struct partition *p; - struct buffer_head * bh; - - if (!callable) - return -1; - callable = 0; -#ifndef HD_TYPE - for (drive=0 ; drive<2 ; drive++) { - hd_info[drive].cyl = *(unsigned short *) BIOS; - hd_info[drive].head = *(unsigned char *) (2+BIOS); - hd_info[drive].wpcom = *(unsigned short *) (5+BIOS); - hd_info[drive].ctl = *(unsigned char *) (8+BIOS); - hd_info[drive].lzone = *(unsigned short *) (12+BIOS); - hd_info[drive].sect = *(unsigned char *) (14+BIOS); - BIOS += 16; - } - if (hd_info[1].cyl) - NR_HD=2; - else - NR_HD=1; -#endif - for (i=0 ; i are the primary drives in the system, and - the ones reflected as drive 1 or 2. - - The first drive is stored in the high nibble of CMOS - byte 0x12, the second in the low nibble. This will be - either a 4 bit drive type or 0xf indicating use byte 0x19 - for an 8 bit type, drive 1, 0x1a for drive 2 in CMOS. - - Needless to say, a non-zero value means we have - an AT controller hard disk for that drive. - - - */ - - if ((cmos_disks = CMOS_READ(0x12)) & 0xf0) - if (cmos_disks & 0x0f) - NR_HD = 2; - else - NR_HD = 1; - else - NR_HD = 0; - for (i = NR_HD ; i < 2 ; i++) { - hd[i*5].start_sect = 0; - hd[i*5].nr_sects = 0; - } - for (drive=0 ; driveb_data[510] != 0x55 || (unsigned char) - bh->b_data[511] != 0xAA) { - printk("Bad partition table on drive %d\n\r",drive); - panic(""); - } - p = 0x1BE + (void *)bh->b_data; - for (i=1;i<5;i++,p++) { - hd[i+5*drive].start_sect = p->start_sect; - hd[i+5*drive].nr_sects = p->nr_sects; - } - brelse(bh); - } - if (NR_HD) - printk("Partition table%s ok.\n\r",(NR_HD>1)?"s":""); - rd_load(); - mount_root(); - return (0); -} - -static int controller_ready(void) -{ - int retries=10000; - - while (--retries && (inb_p(HD_STATUS)&0xc0)!=0x40); - return (retries); -} - -static int win_result(void) -{ - int i=inb_p(HD_STATUS); - - if ((i & (BUSY_STAT | READY_STAT | WRERR_STAT | SEEK_STAT | ERR_STAT)) - == (READY_STAT | SEEK_STAT)) - return(0); /* ok */ - if (i&1) i=inb(HD_ERROR); - return (1); -} - -static void hd_out(unsigned int drive,unsigned int nsect,unsigned int sect, - unsigned int head,unsigned int cyl,unsigned int cmd, - void (*intr_addr)(void)) -{ - register int port asm("dx"); - - if (drive>1 || head>15) - panic("Trying to write bad sector"); - if (!controller_ready()) - panic("HD controller not ready"); - do_hd = intr_addr; - outb_p(hd_info[drive].ctl,HD_CMD); - port=HD_DATA; - outb_p(hd_info[drive].wpcom>>2,++port); - outb_p(nsect,++port); - outb_p(sect,++port); - outb_p(cyl,++port); - outb_p(cyl>>8,++port); - outb_p(0xA0|(drive<<4)|head,++port); - outb(cmd,++port); -} - -static int drive_busy(void) -{ - unsigned int i; - - for (i = 0; i < 10000; i++) - if (READY_STAT == (inb_p(HD_STATUS) & (BUSY_STAT|READY_STAT))) - break; - i = inb(HD_STATUS); - i &= BUSY_STAT | READY_STAT | SEEK_STAT; - if (i == (READY_STAT | SEEK_STAT)) - return(0); - printk("HD controller times out\n\r"); - return(1); -} - -static void reset_controller(void) -{ - int i; - - outb(4,HD_CMD); - for(i = 0; i < 100; i++) nop(); - outb(hd_info[0].ctl & 0x0f ,HD_CMD); - if (drive_busy()) - printk("HD-controller still busy\n\r"); - if ((i = inb(HD_ERROR)) != 1) - printk("HD-controller reset failed: %02x\n\r",i); -} - -static void reset_hd(int nr) -{ - reset_controller(); - hd_out(nr,hd_info[nr].sect,hd_info[nr].sect,hd_info[nr].head-1, - hd_info[nr].cyl,WIN_SPECIFY,&recal_intr); -} - -void unexpected_hd_interrupt(void) -{ - printk("Unexpected HD interrupt\n\r"); -} - -static void bad_rw_intr(void) -{ - if (++CURRENT->errors >= MAX_ERRORS) - end_request(0); - if (CURRENT->errors > MAX_ERRORS/2) - reset = 1; -} - -static void read_intr(void) -{ - if (win_result()) { - bad_rw_intr(); - do_hd_request(); - return; - } - port_read(HD_DATA,CURRENT->buffer,256); - CURRENT->errors = 0; - CURRENT->buffer += 512; - CURRENT->sector++; - if (--CURRENT->nr_sectors) { - do_hd = &read_intr; - return; - } - end_request(1); - do_hd_request(); -} - -static void write_intr(void) -{ - if (win_result()) { - bad_rw_intr(); - do_hd_request(); - return; - } - if (--CURRENT->nr_sectors) { - CURRENT->sector++; - CURRENT->buffer += 512; - do_hd = &write_intr; - port_write(HD_DATA,CURRENT->buffer,256); - return; - } - end_request(1); - do_hd_request(); -} - -static void recal_intr(void) -{ - if (win_result()) - bad_rw_intr(); - do_hd_request(); -} - -void do_hd_request(void) -{ - int i,r = 0; - unsigned int block,dev; - unsigned int sec,head,cyl; - unsigned int nsect; - - INIT_REQUEST; - dev = MINOR(CURRENT->dev); - block = CURRENT->sector; - if (dev >= 5*NR_HD || block+2 > hd[dev].nr_sects) { - end_request(0); - goto repeat; - } - block += hd[dev].start_sect; - dev /= 5; - __asm__("divl %4":"=a" (block),"=d" (sec):"0" (block),"1" (0), - "r" (hd_info[dev].sect)); - __asm__("divl %4":"=a" (cyl),"=d" (head):"0" (block),"1" (0), - "r" (hd_info[dev].head)); - sec++; - nsect = CURRENT->nr_sectors; - if (reset) { - reset = 0; - recalibrate = 1; - reset_hd(CURRENT_DEV); - return; - } - if (recalibrate) { - recalibrate = 0; - hd_out(dev,hd_info[CURRENT_DEV].sect,0,0,0, - WIN_RESTORE,&recal_intr); - return; - } - if (CURRENT->cmd == WRITE) { - hd_out(dev,nsect,sec,head,cyl,WIN_WRITE,&write_intr); - for(i=0 ; i<3000 && !(r=inb_p(HD_STATUS)&DRQ_STAT) ; i++) - /* nothing */ ; - if (!r) { - bad_rw_intr(); - goto repeat; - } - port_write(HD_DATA,CURRENT->buffer,256); - } else if (CURRENT->cmd == READ) { - hd_out(dev,nsect,sec,head,cyl,WIN_READ,&read_intr); - } else - panic("unknown hd-command"); -} - -void hd_init(void) -{ - blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST; - set_intr_gate(0x2E,&hd_interrupt); - outb_p(inb_p(0x21)&0xfb,0x21); - outb(inb_p(0xA1)&0xbf,0xA1); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/ll_rw_blk.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/ll_rw_blk.c deleted file mode 100644 index 8931a81..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/blk_drv/ll_rw_blk.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * linux/kernel/blk_dev/ll_rw.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * This handles all read/write requests to block devices - */ -#include -#include -#include -#include - -#include "blk.h" - -/* - * The request-struct contains all necessary data - * to load a nr of sectors into memory - */ -struct request request[NR_REQUEST]; - -/* - * used to wait on when there are no free requests - */ -struct task_struct * wait_for_request = NULL; - -/* blk_dev_struct is: - * do_request-address - * next-request - */ -struct blk_dev_struct blk_dev[NR_BLK_DEV] = { - { NULL, NULL }, /* no_dev */ - { NULL, NULL }, /* dev mem */ - { NULL, NULL }, /* dev fd */ - { NULL, NULL }, /* dev hd */ - { NULL, NULL }, /* dev ttyx */ - { NULL, NULL }, /* dev tty */ - { NULL, NULL } /* dev lp */ -}; - -static inline void lock_buffer(struct buffer_head * bh) -{ - cli(); - while (bh->b_lock) - sleep_on(&bh->b_wait); - bh->b_lock=1; - sti(); -} - -static inline void unlock_buffer(struct buffer_head * bh) -{ - if (!bh->b_lock) - printk("ll_rw_block.c: buffer not locked\n\r"); - bh->b_lock = 0; - wake_up(&bh->b_wait); -} - -/* - * add-request adds a request to the linked list. - * It disables interrupts so that it can muck with the - * request-lists in peace. - */ -static void add_request(struct blk_dev_struct * dev, struct request * req) -{ - struct request * tmp; - - req->next = NULL; - cli(); - if (req->bh) - req->bh->b_dirt = 0; - if (!(tmp = dev->current_request)) { - dev->current_request = req; - sti(); - (dev->request_fn)(); - return; - } - for ( ; tmp->next ; tmp=tmp->next) - if ((IN_ORDER(tmp,req) || - !IN_ORDER(tmp,tmp->next)) && - IN_ORDER(req,tmp->next)) - break; - req->next=tmp->next; - tmp->next=req; - sti(); -} - -static void make_request(int major,int rw, struct buffer_head * bh) -{ - struct request * req; - int rw_ahead; - -/* WRITEA/READA is special case - it is not really needed, so if the */ -/* buffer is locked, we just forget about it, else it's a normal read */ - if ((rw_ahead = (rw == READA || rw == WRITEA))) { - if (bh->b_lock) - return; - if (rw == READA) - rw = READ; - else - rw = WRITE; - } - if (rw!=READ && rw!=WRITE) - panic("Bad block dev command, must be R/W/RA/WA"); - lock_buffer(bh); - if ((rw == WRITE && !bh->b_dirt) || (rw == READ && bh->b_uptodate)) { - unlock_buffer(bh); - return; - } -repeat: -/* we don't allow the write-requests to fill up the queue completely: - * we want some room for reads: they take precedence. The last third - * of the requests are only for reads. - */ - if (rw == READ) - req = request+NR_REQUEST; - else - req = request+((NR_REQUEST*2)/3); -/* find an empty request */ - while (--req >= request) - if (req->dev<0) - break; -/* if none found, sleep on new requests: check for rw_ahead */ - if (req < request) { - if (rw_ahead) { - unlock_buffer(bh); - return; - } - sleep_on(&wait_for_request); - goto repeat; - } -/* fill up the request-info, and add it to the queue */ - req->dev = bh->b_dev; - req->cmd = rw; - req->errors=0; - req->sector = bh->b_blocknr<<1; - req->nr_sectors = 2; - req->buffer = bh->b_data; - req->waiting = NULL; - req->bh = bh; - req->next = NULL; - add_request(major+blk_dev,req); -} - -void ll_rw_block(int rw, struct buffer_head * bh) -{ - unsigned int major; - - if ((major=MAJOR(bh->b_dev)) >= NR_BLK_DEV || - !(blk_dev[major].request_fn)) { - printk("Trying to read nonexistent block-device\n\r"); - return; - } - make_request(major,rw,bh); -} - -void blk_dev_init(void) -{ - int i; - - for (i=0 ; i - -#include -#include -#include -#include -#include -#include -#include - -#define MAJOR_NR 1 -#include "blk.h" - -char *rd_start; -int rd_length = 0; - -void do_rd_request(void) -{ - int len; - char *addr; - - INIT_REQUEST; - addr = rd_start + (CURRENT->sector << 9); - len = CURRENT->nr_sectors << 9; - if ((MINOR(CURRENT->dev) != 1) || (addr+len > rd_start+rd_length)) { - end_request(0); - goto repeat; - } - if (CURRENT-> cmd == WRITE) { - (void ) memcpy(addr, - CURRENT->buffer, - len); - } else if (CURRENT->cmd == READ) { - (void) memcpy(CURRENT->buffer, - addr, - len); - } else - panic("unknown ramdisk-command"); - end_request(1); - goto repeat; -} - -/* - * Returns amount of memory which needs to be reserved. - */ -long rd_init(long mem_start, int length) -{ - int i; - char *cp; - - blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST; - rd_start = (char *) mem_start; - rd_length = length; - cp = rd_start; - for (i=0; i < length; i++) - *cp++ = '\0'; - return(length); -} - -/* - * If the root device is the ram disk, try to load it. - * In order to do this, the root device is originally set to the - * floppy, and we later change it to be ram disk. - */ -void rd_load(void) -{ - struct buffer_head *bh; - struct super_block s; - int block = 256; /* Start at block 256 */ - int i = 1; - int nblocks; - char *cp; /* Move pointer */ - - if (!rd_length) - return; - printk("Ram disk: %d bytes, starting at 0x%x\n", rd_length, - (int) rd_start); - if (MAJOR(ROOT_DEV) != 2) - return; - bh = breada(ROOT_DEV,block+1,block,block+2,-1); - if (!bh) { - printk("Disk error while looking for ramdisk!\n"); - return; - } - *((struct d_super_block *) &s) = *((struct d_super_block *) bh->b_data); - brelse(bh); - if (s.s_magic != SUPER_MAGIC) - /* No ram disk image present, assume normal floppy boot */ - return; - nblocks = s.s_nzones << s.s_log_zone_size; - if (nblocks > (rd_length >> BLOCK_SIZE_BITS)) { - printk("Ram disk image too big! (%d blocks, %d avail)\n", - nblocks, rd_length >> BLOCK_SIZE_BITS); - return; - } - printk("Loading %d bytes into ram disk... 0000k", - nblocks << BLOCK_SIZE_BITS); - cp = rd_start; - while (nblocks) { - if (nblocks > 2) - bh = breada(ROOT_DEV, block, block+1, block+2, -1); - else - bh = bread(ROOT_DEV, block); - if (!bh) { - printk("I/O error on block %d, aborting load\n", - block); - return; - } - (void) memcpy(cp, bh->b_data, BLOCK_SIZE); - brelse(bh); - printk("\010\010\010\010\010%4dk",i); - cp += BLOCK_SIZE; - block++; - nblocks--; - i++; - } - printk("\010\010\010\010\010done \n"); - ROOT_DEV=0x0101; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/Makefile b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/Makefile deleted file mode 100644 index 76d9cdd..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -# -# Makefile for the FREAX-kernel character device drivers. -# -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# - -AR =ar -AS =as -LD =ld -LDFLAGS =-s -x -CC =gcc -mcpu=i386 -CFLAGS =-Wall -O -fstrength-reduce -fomit-frame-pointer \ - -finline-functions -nostdinc -I../../include -CPP =gcc -E -nostdinc -I../../include - -.c.s: - $(CC) $(CFLAGS) \ - -S -o $*.s $< -.s.o: - $(AS) -o $*.o $< -.c.o: - $(CC) $(CFLAGS) \ - -c -o $*.o $< - -OBJS = tty_io.o console.o keyboard.o serial.o rs_io.o \ - tty_ioctl.o - -chr_drv.a: $(OBJS) - $(AR) rcs chr_drv.a $(OBJS) - sync - -keyboard.s: keyboard.S ../../include/linux/config.h - $(CPP) -traditional keyboard.S -o keyboard.s - -clean: - rm -f core *.o *.a tmp_make keyboard.s - for i in *.c;do rm -f `basename $$i .c`.s;done - -dep: - sed '/\#\#\# Dependencies/q' < Makefile > tmp_make - (for i in *.c;do echo -n `echo $$i | sed 's,\.c,\.s,'`" "; \ - $(CPP) -M $$i;done) >> tmp_make - cp tmp_make Makefile - -### Dependencies: -console.s console.o: console.c ../../include/linux/sched.h \ - ../../include/linux/head.h ../../include/linux/fs.h \ - ../../include/sys/types.h ../../include/linux/mm.h \ - ../../include/signal.h ../../include/linux/tty.h \ - ../../include/termios.h ../../include/asm/io.h \ - ../../include/asm/system.h -serial.s serial.o: serial.c ../../include/linux/tty.h ../../include/termios.h \ - ../../include/linux/sched.h ../../include/linux/head.h \ - ../../include/linux/fs.h ../../include/sys/types.h \ - ../../include/linux/mm.h ../../include/signal.h \ - ../../include/asm/system.h ../../include/asm/io.h -tty_io.s tty_io.o: tty_io.c ../../include/ctype.h ../../include/errno.h \ - ../../include/signal.h ../../include/sys/types.h \ - ../../include/linux/sched.h ../../include/linux/head.h \ - ../../include/linux/fs.h ../../include/linux/mm.h \ - ../../include/linux/tty.h ../../include/termios.h \ - ../../include/asm/segment.h ../../include/asm/system.h -tty_ioctl.s tty_ioctl.o: tty_ioctl.c ../../include/errno.h ../../include/termios.h \ - ../../include/linux/sched.h ../../include/linux/head.h \ - ../../include/linux/fs.h ../../include/sys/types.h \ - ../../include/linux/mm.h ../../include/signal.h \ - ../../include/linux/kernel.h ../../include/linux/tty.h \ - ../../include/asm/io.h ../../include/asm/segment.h \ - ../../include/asm/system.h diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/console.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/console.c deleted file mode 100644 index 3f76f61..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/console.c +++ /dev/null @@ -1,710 +0,0 @@ -/* - * linux/kernel/console.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * console.c - * - * This module implements the console io functions - * 'void con_init(void)' - * 'void con_write(struct tty_queue * queue)' - * Hopefully this will be a rather complete VT102 implementation. - * - * Beeping thanks to John T Kohl. - */ - -/* - * NOTE!!! We sometimes disable and enable interrupts for a short while - * (to put a word in video IO), but this will work even for keyboard - * interrupts. We know interrupts aren't enabled when getting a keyboard - * interrupt, as we use trap-gates. Hopefully all is well. - */ - -/* - * Code to check for different video-cards mostly by Galen Hunt, - * - */ - -#include -#include -#include -#include - -/* - * These are set up by the setup-routine at boot-time: - */ - -#define ORIG_X (*(unsigned char *)0x90000) -#define ORIG_Y (*(unsigned char *)0x90001) -#define ORIG_VIDEO_PAGE (*(unsigned short *)0x90004) -#define ORIG_VIDEO_MODE ((*(unsigned short *)0x90006) & 0xff) -#define ORIG_VIDEO_COLS (((*(unsigned short *)0x90006) & 0xff00) >> 8) -#define ORIG_VIDEO_LINES (25) -#define ORIG_VIDEO_EGA_AX (*(unsigned short *)0x90008) -#define ORIG_VIDEO_EGA_BX (*(unsigned short *)0x9000a) -#define ORIG_VIDEO_EGA_CX (*(unsigned short *)0x9000c) - -#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ -#define VIDEO_TYPE_CGA 0x11 /* CGA Display */ -#define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */ -#define VIDEO_TYPE_EGAC 0x21 /* EGA/VGA in Color Mode */ - -#define NPAR 16 - -extern void keyboard_interrupt(void); - -static unsigned char video_type; /* Type of display being used */ -static unsigned long video_num_columns; /* Number of text columns */ -static unsigned long video_size_row; /* Bytes per row */ -static unsigned long video_num_lines; /* Number of test lines */ -static unsigned char video_page; /* Initial video page */ -static unsigned long video_mem_start; /* Start of video RAM */ -static unsigned long video_mem_end; /* End of video RAM (sort of) */ -static unsigned short video_port_reg; /* Video register select port */ -static unsigned short video_port_val; /* Video register value port */ -static unsigned short video_erase_char; /* Char+Attrib to erase with */ - -static unsigned long origin; /* Used for EGA/VGA fast scroll */ -static unsigned long scr_end; /* Used for EGA/VGA fast scroll */ -static unsigned long pos; -static unsigned long x,y; -static unsigned long top,bottom; -static unsigned long state=0; -static unsigned long npar,par[NPAR]; -static unsigned long ques=0; -static unsigned char attr=0x07; - -static void sysbeep(void); - -/* - * this is what the terminal answers to a ESC-Z or csi0c - * query (= vt100 response). - */ -#define RESPONSE "\033[?1;2c" - -/* NOTE! gotoxy thinks x==video_num_columns is ok */ -static inline void gotoxy(unsigned int new_x,unsigned int new_y) -{ - if (new_x > video_num_columns || new_y >= video_num_lines) - return; - x=new_x; - y=new_y; - pos=origin + y*video_size_row + (x<<1); -} - -static inline void set_origin(void) -{ - cli(); - outb_p(12, video_port_reg); - outb_p(0xff&((origin-video_mem_start)>>9), video_port_val); - outb_p(13, video_port_reg); - outb_p(0xff&((origin-video_mem_start)>>1), video_port_val); - sti(); -} - -static void scrup(void) -{ - if (video_type == VIDEO_TYPE_EGAC || video_type == VIDEO_TYPE_EGAM) - { - if (!top && bottom == video_num_lines) { - origin += video_size_row; - pos += video_size_row; - scr_end += video_size_row; - if (scr_end > video_mem_end) { - __asm__("cld\n\t" - "rep\n\t" - "movsl\n\t" - "movl _video_num_columns,%1\n\t" - "rep\n\t" - "stosw" - ::"a" (video_erase_char), - "c" ((video_num_lines-1)*video_num_columns>>1), - "D" (video_mem_start), - "S" (origin) - ); - scr_end -= origin-video_mem_start; - pos -= origin-video_mem_start; - origin = video_mem_start; - } else { - __asm__("cld\n\t" - "rep\n\t" - "stosw" - ::"a" (video_erase_char), - "c" (video_num_columns), - "D" (scr_end-video_size_row) - ); - } - set_origin(); - } else { - __asm__("cld\n\t" - "rep\n\t" - "movsl\n\t" - "movl _video_num_columns,%%ecx\n\t" - "rep\n\t" - "stosw" - ::"a" (video_erase_char), - "c" ((bottom-top-1)*video_num_columns>>1), - "D" (origin+video_size_row*top), - "S" (origin+video_size_row*(top+1)) - ); - } - } - else /* Not EGA/VGA */ - { - __asm__("cld\n\t" - "rep\n\t" - "movsl\n\t" - "movl _video_num_columns,%%ecx\n\t" - "rep\n\t" - "stosw" - ::"a" (video_erase_char), - "c" ((bottom-top-1)*video_num_columns>>1), - "D" (origin+video_size_row*top), - "S" (origin+video_size_row*(top+1)) - ); - } -} - -static void scrdown(void) -{ - if (video_type == VIDEO_TYPE_EGAC || video_type == VIDEO_TYPE_EGAM) - { - __asm__("std\n\t" - "rep\n\t" - "movsl\n\t" - "addl $2,%%edi\n\t" /* %edi has been decremented by 4 */ - "movl _video_num_columns,%%ecx\n\t" - "rep\n\t" - "stosw" - ::"a" (video_erase_char), - "c" ((bottom-top-1)*video_num_columns>>1), - "D" (origin+video_size_row*bottom-4), - "S" (origin+video_size_row*(bottom-1)-4) - ); - } - else /* Not EGA/VGA */ - { - __asm__("std\n\t" - "rep\n\t" - "movsl\n\t" - "addl $2,%%edi\n\t" /* %edi has been decremented by 4 */ - "movl _video_num_columns,%%ecx\n\t" - "rep\n\t" - "stosw" - ::"a" (video_erase_char), - "c" ((bottom-top-1)*video_num_columns>>1), - "D" (origin+video_size_row*bottom-4), - "S" (origin+video_size_row*(bottom-1)-4) - ); - } -} - -static void lf(void) -{ - if (y+1top) { - y--; - pos -= video_size_row; - return; - } - scrdown(); -} - -static void cr(void) -{ - pos -= x<<1; - x=0; -} - -static void del(void) -{ - if (x) { - pos -= 2; - x--; - *(unsigned short *)pos = video_erase_char; - } -} - -static void csi_J(int par) -{ - long count; - long start; - - switch (par) { - case 0: /* erase from cursor to end of display */ - count = (scr_end-pos)>>1; - start = pos; - break; - case 1: /* erase from start to cursor */ - count = (pos-origin)>>1; - start = origin; - break; - case 2: /* erase whole display */ - count = video_num_columns * video_num_lines; - start = origin; - break; - default: - return; - } - __asm__("cld\n\t" - "rep\n\t" - "stosw\n\t" - ::"c" (count), - "D" (start),"a" (video_erase_char) - ); -} - -static void csi_K(int par) -{ - long count; - long start; - - switch (par) { - case 0: /* erase from cursor to end of line */ - if (x>=video_num_columns) - return; - count = video_num_columns-x; - start = pos; - break; - case 1: /* erase from start of line to cursor */ - start = pos - (x<<1); - count = (x>9), video_port_val); - outb_p(15, video_port_reg); - outb_p(0xff&((pos-video_mem_start)>>1), video_port_val); - sti(); -} - -static void respond(struct tty_struct * tty) -{ - char * p = RESPONSE; - - cli(); - while (*p) { - PUTCH(*p,tty->read_q); - p++; - } - sti(); - copy_to_cooked(tty); -} - -static void insert_char(void) -{ - int i=x; - unsigned short tmp, old = video_erase_char; - unsigned short * p = (unsigned short *) pos; - - while (i++=video_num_columns) - return; - i = x; - while (++i < video_num_columns) { - *p = *(p+1); - p++; - } - *p = video_erase_char; -} - -static void delete_line(void) -{ - int oldtop,oldbottom; - - oldtop=top; - oldbottom=bottom; - top=y; - bottom = video_num_lines; - scrup(); - top=oldtop; - bottom=oldbottom; -} - -static void csi_at(unsigned int nr) -{ - if (nr > video_num_columns) - nr = video_num_columns; - else if (!nr) - nr = 1; - while (nr--) - insert_char(); -} - -static void csi_L(unsigned int nr) -{ - if (nr > video_num_lines) - nr = video_num_lines; - else if (!nr) - nr = 1; - while (nr--) - insert_line(); -} - -static void csi_P(unsigned int nr) -{ - if (nr > video_num_columns) - nr = video_num_columns; - else if (!nr) - nr = 1; - while (nr--) - delete_char(); -} - -static void csi_M(unsigned int nr) -{ - if (nr > video_num_lines) - nr = video_num_lines; - else if (!nr) - nr=1; - while (nr--) - delete_line(); -} - -static int saved_x=0; -static int saved_y=0; - -static void save_cur(void) -{ - saved_x=x; - saved_y=y; -} - -static void restore_cur(void) -{ - gotoxy(saved_x, saved_y); -} - -void con_write(struct tty_struct * tty) -{ - int nr; - char c; - - nr = CHARS(tty->write_q); - while (nr--) { - GETCH(tty->write_q,c); - switch(state) { - case 0: - if (c>31 && c<127) { - if (x>=video_num_columns) { - x -= video_num_columns; - pos -= video_size_row; - lf(); - } - __asm__("movb _attr,%%ah\n\t" - "movw %%ax,%1\n\t" - ::"a" (c),"m" (*(short *)pos) - ); - pos += 2; - x++; - } else if (c==27) - state=1; - else if (c==10 || c==11 || c==12) - lf(); - else if (c==13) - cr(); - else if (c==ERASE_CHAR(tty)) - del(); - else if (c==8) { - if (x) { - x--; - pos -= 2; - } - } else if (c==9) { - c=8-(x&7); - x += c; - pos += c<<1; - if (x>video_num_columns) { - x -= video_num_columns; - pos -= video_size_row; - lf(); - } - c=9; - } else if (c==7) - sysbeep(); - break; - case 1: - state=0; - if (c=='[') - state=2; - else if (c=='E') - gotoxy(0,y+1); - else if (c=='M') - ri(); - else if (c=='D') - lf(); - else if (c=='Z') - respond(tty); - else if (x=='7') - save_cur(); - else if (x=='8') - restore_cur(); - break; - case 2: - for(npar=0;npar='0' && c<='9') { - par[npar]=10*par[npar]+c-'0'; - break; - } else state=4; - case 4: - state=0; - switch(c) { - case 'G': case '`': - if (par[0]) par[0]--; - gotoxy(par[0],y); - break; - case 'A': - if (!par[0]) par[0]++; - gotoxy(x,y-par[0]); - break; - case 'B': case 'e': - if (!par[0]) par[0]++; - gotoxy(x,y+par[0]); - break; - case 'C': case 'a': - if (!par[0]) par[0]++; - gotoxy(x+par[0],y); - break; - case 'D': - if (!par[0]) par[0]++; - gotoxy(x-par[0],y); - break; - case 'E': - if (!par[0]) par[0]++; - gotoxy(0,y+par[0]); - break; - case 'F': - if (!par[0]) par[0]++; - gotoxy(0,y-par[0]); - break; - case 'd': - if (par[0]) par[0]--; - gotoxy(x,par[0]); - break; - case 'H': case 'f': - if (par[0]) par[0]--; - if (par[1]) par[1]--; - gotoxy(par[1],par[0]); - break; - case 'J': - csi_J(par[0]); - break; - case 'K': - csi_K(par[0]); - break; - case 'L': - csi_L(par[0]); - break; - case 'M': - csi_M(par[0]); - break; - case 'P': - csi_P(par[0]); - break; - case '@': - csi_at(par[0]); - break; - case 'm': - csi_m(); - break; - case 'r': - if (par[0]) par[0]--; - if (!par[1]) par[1] = video_num_lines; - if (par[0] < par[1] && - par[1] <= video_num_lines) { - top=par[0]; - bottom=par[1]; - } - break; - case 's': - save_cur(); - break; - case 'u': - restore_cur(); - break; - } - } - } - set_cursor(); -} - -/* - * void con_init(void); - * - * This routine initalizes console interrupts, and does nothing - * else. If you want the screen to clear, call tty_write with - * the appropriate escape-sequece. - * - * Reads the information preserved by setup.s to determine the current display - * type and sets everything accordingly. - */ -void con_init(void) -{ - register unsigned char a; - char *display_desc = "????"; - char *display_ptr; - - video_num_columns = ORIG_VIDEO_COLS; - video_size_row = video_num_columns * 2; - video_num_lines = ORIG_VIDEO_LINES; - video_page = ORIG_VIDEO_PAGE; - video_erase_char = 0x0720; - - if (ORIG_VIDEO_MODE == 7) /* Is this a monochrome display? */ - { - video_mem_start = 0xb0000; - video_port_reg = 0x3b4; - video_port_val = 0x3b5; - if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) - { - video_type = VIDEO_TYPE_EGAM; - video_mem_end = 0xb8000; - display_desc = "EGAm"; - } - else - { - video_type = VIDEO_TYPE_MDA; - video_mem_end = 0xb2000; - display_desc = "*MDA"; - } - } - else /* If not, it is color. */ - { - video_mem_start = 0xb8000; - video_port_reg = 0x3d4; - video_port_val = 0x3d5; - if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) - { - video_type = VIDEO_TYPE_EGAC; - video_mem_end = 0xbc000; - display_desc = "EGAc"; - } - else - { - video_type = VIDEO_TYPE_CGA; - video_mem_end = 0xba000; - display_desc = "*CGA"; - } - } - - /* Let the user known what kind of display driver we are using */ - - display_ptr = ((char *)video_mem_start) + video_size_row - 8; - while (*display_desc) - { - *display_ptr++ = *display_desc++; - display_ptr++; - } - - /* Initialize the variables used for scrolling (mostly EGA/VGA) */ - - origin = video_mem_start; - scr_end = video_mem_start + video_num_lines * video_size_row; - top = 0; - bottom = video_num_lines; - - gotoxy(ORIG_X,ORIG_Y); - set_trap_gate(0x21,&keyboard_interrupt); - outb_p(inb_p(0x21)&0xfd,0x21); - a=inb_p(0x61); - outb_p(a|0x80,0x61); - outb(a,0x61); -} -/* from bsd-net-2: */ - -void sysbeepstop(void) -{ - /* disable counter 2 */ - outb(inb_p(0x61)&0xFC, 0x61); -} - -int beepcount = 0; - -static void sysbeep(void) -{ - /* enable counter 2 */ - outb_p(inb_p(0x61)|3, 0x61); - /* set command for counter 2, 2 byte write */ - outb_p(0xB6, 0x43); - /* send 0x637 for 750 HZ */ - outb_p(0x37, 0x42); - outb(0x06, 0x42); - /* 1/8 second */ - beepcount = HZ/8; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/keyboard.S b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/keyboard.S deleted file mode 100644 index 91f327b..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/keyboard.S +++ /dev/null @@ -1,433 +0,0 @@ -/* - * linux/kernel/keyboard.S - * - * (C) 1991 Linus Torvalds - */ - -/* - * Thanks to Alfred Leung for US keyboard patches - * Wolfgang Thiel for German keyboard patches - * Marc Corsini for the French keyboard - */ - -#include - -.text -.globl _keyboard_interrupt - -/* - * these are for the keyboard read functions - */ -size = 1024 /* must be a power of two ! And MUST be the same - as in tty_io.c !!!! */ -head = 4 -tail = 8 -proc_list = 12 -buf = 16 - -mode: .byte 0 /* caps, alt, ctrl and shift mode */ -leds: .byte 2 /* num-lock, caps, scroll-lock mode (nom-lock on) */ -e0: .byte 0 - -/* - * con_int is the real interrupt routine that reads the - * keyboard scan-code and converts it into the appropriate - * ascii character(s). - */ -_keyboard_interrupt: - pushl %eax - pushl %ebx - pushl %ecx - pushl %edx - push %ds - push %es - movl $0x10,%eax - mov %ax,%ds - mov %ax,%es - xor %al,%al /* %eax is scan code */ - inb $0x60,%al - cmpb $0xe0,%al - je set_e0 - cmpb $0xe1,%al - je set_e1 - call key_table(,%eax,4) - movb $0,e0 -e0_e1: inb $0x61,%al - jmp 1f -1: jmp 1f -1: orb $0x80,%al - jmp 1f -1: jmp 1f -1: outb %al,$0x61 - jmp 1f -1: jmp 1f -1: andb $0x7F,%al - outb %al,$0x61 - movb $0x20,%al - outb %al,$0x20 - pushl $0 - call _do_tty_interrupt - addl $4,%esp - pop %es - pop %ds - popl %edx - popl %ecx - popl %ebx - popl %eax - iret -set_e0: movb $1,e0 - jmp e0_e1 -set_e1: movb $2,e0 - jmp e0_e1 - -/* - * This routine fills the buffer with max 8 bytes, taken from - * %ebx:%eax. (%edx is high). The bytes are written in the - * order %al,%ah,%eal,%eah,%bl,%bh ... until %eax is zero. - */ -put_queue: - pushl %ecx - pushl %edx - movl _table_list,%edx # read-queue for console - movl head(%edx),%ecx -1: movb %al,buf(%edx,%ecx) - incl %ecx - andl $size-1,%ecx - cmpl tail(%edx),%ecx # buffer full - discard everything - je 3f - shrdl $8,%ebx,%eax - je 2f - shrl $8,%ebx - jmp 1b -2: movl %ecx,head(%edx) - movl proc_list(%edx),%ecx - testl %ecx,%ecx - je 3f - movl $0,(%ecx) -3: popl %edx - popl %ecx - ret - -ctrl: movb $0x04,%al - jmp 1f -alt: movb $0x10,%al -1: cmpb $0,e0 - je 2f - addb %al,%al -2: orb %al,mode - ret -unctrl: movb $0x04,%al - jmp 1f -unalt: movb $0x10,%al -1: cmpb $0,e0 - je 2f - addb %al,%al -2: notb %al - andb %al,mode - ret - -lshift: - orb $0x01,mode - ret -unlshift: - andb $0xfe,mode - ret -rshift: - orb $0x02,mode - ret -unrshift: - andb $0xfd,mode - ret - -caps: testb $0x80,mode - jne 1f - xorb $4,leds - xorb $0x40,mode - orb $0x80,mode -set_leds: - call kb_wait - movb $0xed,%al /* set leds command */ - outb %al,$0x60 - call kb_wait - movb leds,%al - outb %al,$0x60 - ret -uncaps: andb $0x7f,mode - ret -scroll: - xorb $1,leds - jmp set_leds -num: xorb $2,leds - jmp set_leds - -/* - * curosr-key/numeric keypad cursor keys are handled here. - * checking for numeric keypad etc. - */ -cursor: - subb $0x47,%al - jb 1f - cmpb $12,%al - ja 1f - jne cur2 /* check for ctrl-alt-del */ - testb $0x0c,mode - je cur2 - testb $0x30,mode - jne reboot -cur2: cmpb $0x01,e0 /* e0 forces cursor movement */ - je cur - testb $0x02,leds /* not num-lock forces cursor */ - je cur - testb $0x03,mode /* shift forces cursor */ - jne cur - xorl %ebx,%ebx - movb num_table(%eax),%al - jmp put_queue -1: ret - -cur: movb cur_table(%eax),%al - cmpb $'9,%al - ja ok_cur - movb $'~,%ah -ok_cur: shll $16,%eax - movw $0x5b1b,%ax - xorl %ebx,%ebx - jmp put_queue - - -num_table: - .ascii "789 456 1230," -cur_table: - .ascii "HA5 DGC YB623" - -/* - * this routine handles function keys - */ -func: - pushl %eax - pushl %ecx - pushl %edx - call _show_stat - popl %edx - popl %ecx - popl %eax - subb $0x3B,%al - jb end_func - cmpb $9,%al - jbe ok_func - subb $18,%al - cmpb $10,%al - jb end_func - cmpb $11,%al - ja end_func -ok_func: - cmpl $4,%ecx /* check that there is enough room */ - jl end_func - movl func_table(,%eax,4),%eax - xorl %ebx,%ebx - jmp put_queue -end_func: - ret - -/* - * function keys send F1:'esc [ [ A' F2:'esc [ [ B' etc. - */ -func_table: - .long 0x415b5b1b,0x425b5b1b,0x435b5b1b,0x445b5b1b - .long 0x455b5b1b,0x465b5b1b,0x475b5b1b,0x485b5b1b - .long 0x495b5b1b,0x4a5b5b1b,0x4b5b5b1b,0x4c5b5b1b - - -#if defined(KBD_US) - -key_map: - .byte 0,27 - .ascii "1234567890-=" - .byte 127,9 - .ascii "qwertyuiop[]" - .byte 13,0 - .ascii "asdfghjkl;'" - .byte '`,0 - .ascii "\\zxcvbnm,./" - .byte 0,'*,0,32 /* 36-39 */ - .fill 16,1,0 /* 3A-49 */ - .byte '-,0,0,0,'+ /* 4A-4E */ - .byte 0,0,0,0,0,0,0 /* 4F-55 */ - .byte '< - .fill 10,1,0 - - -shift_map: - .byte 0,27 - .ascii "!@#$%^&*()_+" - .byte 127,9 - .ascii "QWERTYUIOP{}" - .byte 13,0 - .ascii "ASDFGHJKL:\"" - .byte '~,0 - .ascii "|ZXCVBNM<>?" - .byte 0,'*,0,32 /* 36-39 */ - .fill 16,1,0 /* 3A-49 */ - .byte '-,0,0,0,'+ /* 4A-4E */ - .byte 0,0,0,0,0,0,0 /* 4F-55 */ - .byte '> - .fill 10,1,0 - -alt_map: - .byte 0,0 - .ascii "\0@\0$\0\0{[]}\\\0" - .byte 0,0 - .byte 0,0,0,0,0,0,0,0,0,0,0 - .byte '~,13,0 - .byte 0,0,0,0,0,0,0,0,0,0,0 - .byte 0,0 - .byte 0,0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0 /* 36-39 */ - .fill 16,1,0 /* 3A-49 */ - .byte 0,0,0,0,0 /* 4A-4E */ - .byte 0,0,0,0,0,0,0 /* 4F-55 */ - .byte '| - .fill 10,1,0 -#else -#error "KBD-type not defined" -#endif -/* - * do_self handles "normal" keys, ie keys that don't change meaning - * and which have just one character returns. - */ -do_self: - lea alt_map,%ebx - testb $0x20,mode /* alt-gr */ - jne 1f - lea shift_map,%ebx - testb $0x03,mode - jne 1f - lea key_map,%ebx -1: movb (%ebx,%eax),%al - orb %al,%al - je none - testb $0x4c,mode /* ctrl or caps */ - je 2f - cmpb $'a,%al - jb 2f - cmpb $'},%al - ja 2f - subb $32,%al -2: testb $0x0c,mode /* ctrl */ - je 3f - cmpb $64,%al - jb 3f - cmpb $64+32,%al - jae 3f - subb $64,%al -3: testb $0x10,mode /* left alt */ - je 4f - orb $0x80,%al -4: andl $0xff,%eax - xorl %ebx,%ebx - call put_queue -none: ret - -/* - * minus has a routine of it's own, as a 'E0h' before - * the scan code for minus means that the numeric keypad - * slash was pushed. - */ -minus: cmpb $1,e0 - jne do_self - movl $'/,%eax - xorl %ebx,%ebx - jmp put_queue - -/* - * This table decides which routine to call when a scan-code has been - * gotten. Most routines just call do_self, or none, depending if - * they are make or break. - */ -key_table: - .long none,do_self,do_self,do_self /* 00-03 s0 esc 1 2 */ - .long do_self,do_self,do_self,do_self /* 04-07 3 4 5 6 */ - .long do_self,do_self,do_self,do_self /* 08-0B 7 8 9 0 */ - .long do_self,do_self,do_self,do_self /* 0C-0F + ' bs tab */ - .long do_self,do_self,do_self,do_self /* 10-13 q w e r */ - .long do_self,do_self,do_self,do_self /* 14-17 t y u i */ - .long do_self,do_self,do_self,do_self /* 18-1B o p } ^ */ - .long do_self,ctrl,do_self,do_self /* 1C-1F enter ctrl a s */ - .long do_self,do_self,do_self,do_self /* 20-23 d f g h */ - .long do_self,do_self,do_self,do_self /* 24-27 j k l | */ - .long do_self,do_self,lshift,do_self /* 28-2B { para lshift , */ - .long do_self,do_self,do_self,do_self /* 2C-2F z x c v */ - .long do_self,do_self,do_self,do_self /* 30-33 b n m , */ - .long do_self,minus,rshift,do_self /* 34-37 . - rshift * */ - .long alt,do_self,caps,func /* 38-3B alt sp caps f1 */ - .long func,func,func,func /* 3C-3F f2 f3 f4 f5 */ - .long func,func,func,func /* 40-43 f6 f7 f8 f9 */ - .long func,num,scroll,cursor /* 44-47 f10 num scr home */ - .long cursor,cursor,do_self,cursor /* 48-4B up pgup - left */ - .long cursor,cursor,do_self,cursor /* 4C-4F n5 right + end */ - .long cursor,cursor,cursor,cursor /* 50-53 dn pgdn ins del */ - .long none,none,do_self,func /* 54-57 sysreq ? < f11 */ - .long func,none,none,none /* 58-5B f12 ? ? ? */ - .long none,none,none,none /* 5C-5F ? ? ? ? */ - .long none,none,none,none /* 60-63 ? ? ? ? */ - .long none,none,none,none /* 64-67 ? ? ? ? */ - .long none,none,none,none /* 68-6B ? ? ? ? */ - .long none,none,none,none /* 6C-6F ? ? ? ? */ - .long none,none,none,none /* 70-73 ? ? ? ? */ - .long none,none,none,none /* 74-77 ? ? ? ? */ - .long none,none,none,none /* 78-7B ? ? ? ? */ - .long none,none,none,none /* 7C-7F ? ? ? ? */ - .long none,none,none,none /* 80-83 ? br br br */ - .long none,none,none,none /* 84-87 br br br br */ - .long none,none,none,none /* 88-8B br br br br */ - .long none,none,none,none /* 8C-8F br br br br */ - .long none,none,none,none /* 90-93 br br br br */ - .long none,none,none,none /* 94-97 br br br br */ - .long none,none,none,none /* 98-9B br br br br */ - .long none,unctrl,none,none /* 9C-9F br unctrl br br */ - .long none,none,none,none /* A0-A3 br br br br */ - .long none,none,none,none /* A4-A7 br br br br */ - .long none,none,unlshift,none /* A8-AB br br unlshift br */ - .long none,none,none,none /* AC-AF br br br br */ - .long none,none,none,none /* B0-B3 br br br br */ - .long none,none,unrshift,none /* B4-B7 br br unrshift br */ - .long unalt,none,uncaps,none /* B8-BB unalt br uncaps br */ - .long none,none,none,none /* BC-BF br br br br */ - .long none,none,none,none /* C0-C3 br br br br */ - .long none,none,none,none /* C4-C7 br br br br */ - .long none,none,none,none /* C8-CB br br br br */ - .long none,none,none,none /* CC-CF br br br br */ - .long none,none,none,none /* D0-D3 br br br br */ - .long none,none,none,none /* D4-D7 br br br br */ - .long none,none,none,none /* D8-DB br ? ? ? */ - .long none,none,none,none /* DC-DF ? ? ? ? */ - .long none,none,none,none /* E0-E3 e0 e1 ? ? */ - .long none,none,none,none /* E4-E7 ? ? ? ? */ - .long none,none,none,none /* E8-EB ? ? ? ? */ - .long none,none,none,none /* EC-EF ? ? ? ? */ - .long none,none,none,none /* F0-F3 ? ? ? ? */ - .long none,none,none,none /* F4-F7 ? ? ? ? */ - .long none,none,none,none /* F8-FB ? ? ? ? */ - .long none,none,none,none /* FC-FF ? ? ? ? */ - -/* - * kb_wait waits for the keyboard controller buffer to empty. - * there is no timeout - if the buffer doesn't empty, we hang. - */ -kb_wait: - pushl %eax -1: inb $0x64,%al - testb $0x02,%al - jne 1b - popl %eax - ret -/* - * This routine reboots the machine by asking the keyboard - * controller to pulse the reset-line low. - */ -reboot: - call kb_wait - movw $0x1234,0x472 /* don't do memory check */ - movb $0xfc,%al /* pulse reset and A20 low */ - outb %al,$0x64 -die: jmp die diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/rs_io.s b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/rs_io.s deleted file mode 100644 index b300643..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/rs_io.s +++ /dev/null @@ -1,147 +0,0 @@ -/* - * linux/kernel/rs_io.s - * - * (C) 1991 Linus Torvalds - */ - -/* - * rs_io.s - * - * This module implements the rs232 io interrupts. - */ - -.text -.globl _rs1_interrupt,_rs2_interrupt - -size = 1024 /* must be power of two ! - and must match the value - in tty_io.c!!! */ - -/* these are the offsets into the read/write buffer structures */ -rs_addr = 0 -head = 4 -tail = 8 -proc_list = 12 -buf = 16 - -startup = 256 /* chars left in write queue when we restart it */ - -/* - * These are the actual interrupt routines. They look where - * the interrupt is coming from, and take appropriate action. - */ -.align 2 -_rs1_interrupt: - pushl $_table_list+8 - jmp rs_int -.align 2 -_rs2_interrupt: - pushl $_table_list+16 -rs_int: - pushl %edx - pushl %ecx - pushl %ebx - pushl %eax - push %es - push %ds /* as this is an interrupt, we cannot */ - pushl $0x10 /* know that bs is ok. Load it */ - pop %ds - pushl $0x10 - pop %es - movl 24(%esp),%edx - movl (%edx),%edx - movl rs_addr(%edx),%edx - addl $2,%edx /* interrupt ident. reg */ -rep_int: - xorl %eax,%eax - inb %dx,%al - testb $1,%al - jne end - cmpb $6,%al /* this shouldn't happen, but ... */ - ja end - movl 24(%esp),%ecx - pushl %edx - subl $2,%edx - call jmp_table(,%eax,2) /* NOTE! not *4, bit0 is 0 already */ - popl %edx - jmp rep_int -end: movb $0x20,%al - outb %al,$0x20 /* EOI */ - pop %ds - pop %es - popl %eax - popl %ebx - popl %ecx - popl %edx - addl $4,%esp # jump over _table_list entry - iret - -jmp_table: - .long modem_status,write_char,read_char,line_status - -.align 2 -modem_status: - addl $6,%edx /* clear intr by reading modem status reg */ - inb %dx,%al - ret - -.align 2 -line_status: - addl $5,%edx /* clear intr by reading line status reg. */ - inb %dx,%al - ret - -.align 2 -read_char: - inb %dx,%al - movl %ecx,%edx - subl $_table_list,%edx - shrl $3,%edx - movl (%ecx),%ecx # read-queue - movl head(%ecx),%ebx - movb %al,buf(%ecx,%ebx) - incl %ebx - andl $size-1,%ebx - cmpl tail(%ecx),%ebx - je 1f - movl %ebx,head(%ecx) -1: pushl %edx - call _do_tty_interrupt - addl $4,%esp - ret - -.align 2 -write_char: - movl 4(%ecx),%ecx # write-queue - movl head(%ecx),%ebx - subl tail(%ecx),%ebx - andl $size-1,%ebx # nr chars in queue - je write_buffer_empty - cmpl $startup,%ebx - ja 1f - movl proc_list(%ecx),%ebx # wake up sleeping process - testl %ebx,%ebx # is there any? - je 1f - movl $0,(%ebx) -1: movl tail(%ecx),%ebx - movb buf(%ecx,%ebx),%al - outb %al,%dx - incl %ebx - andl $size-1,%ebx - movl %ebx,tail(%ecx) - cmpl head(%ecx),%ebx - je write_buffer_empty - ret -.align 2 -write_buffer_empty: - movl proc_list(%ecx),%ebx # wake up sleeping process - testl %ebx,%ebx # is there any? - je 1f - movl $0,(%ebx) -1: incl %edx - inb %dx,%al - jmp 1f -1: jmp 1f -1: andb $0xd,%al /* disable transmit interrupt */ - outb %al,%dx - ret diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/serial.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/serial.c deleted file mode 100644 index aba25df..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/serial.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * linux/kernel/serial.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * serial.c - * - * This module implements the rs232 io functions - * void rs_write(struct tty_struct * queue); - * void rs_init(void); - * and all interrupts pertaining to serial IO. - */ - -#include -#include -#include -#include - -#define WAKEUP_CHARS (TTY_BUF_SIZE/4) - -extern void rs1_interrupt(void); -extern void rs2_interrupt(void); - -static void init(int port) -{ - outb_p(0x80,port+3); /* set DLAB of line control reg */ - outb_p(0x30,port); /* LS of divisor (48 -> 2400 bps */ - outb_p(0x00,port+1); /* MS of divisor */ - outb_p(0x03,port+3); /* reset DLAB */ - outb_p(0x0b,port+4); /* set DTR,RTS, OUT_2 */ - outb_p(0x0d,port+1); /* enable all intrs but writes */ - (void)inb(port); /* read data port to reset things (?) */ -} - -void rs_init(void) -{ - set_intr_gate(0x24,rs1_interrupt); - set_intr_gate(0x23,rs2_interrupt); - init(tty_table[1].read_q.data); - init(tty_table[2].read_q.data); - outb(inb_p(0x21)&0xE7,0x21); -} - -/* - * This routine gets called when tty_write has put something into - * the write_queue. It must check wheter the queue is empty, and - * set the interrupt register accordingly - * - * void _rs_write(struct tty_struct * tty); - */ -void rs_write(struct tty_struct * tty) -{ - cli(); - if (!EMPTY(tty->write_q)) - outb(inb_p(tty->write_q.data+1)|0x02,tty->write_q.data+1); - sti(); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/tty_io.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/tty_io.c deleted file mode 100644 index ed14fa8..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/tty_io.c +++ /dev/null @@ -1,350 +0,0 @@ -/* - * linux/kernel/tty_io.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * 'tty_io.c' gives an orthogonal feeling to tty's, be they consoles - * or rs-channels. It also implements echoing, cooked mode etc. - * - * Kill-line thanks to John T Kohl. - */ -#include -#include -#include - -#define ALRMMASK (1<<(SIGALRM-1)) -#define KILLMASK (1<<(SIGKILL-1)) -#define INTMASK (1<<(SIGINT-1)) -#define QUITMASK (1<<(SIGQUIT-1)) -#define TSTPMASK (1<<(SIGTSTP-1)) - -#include -#include -#include -#include - -#define _L_FLAG(tty,f) ((tty)->termios.c_lflag & f) -#define _I_FLAG(tty,f) ((tty)->termios.c_iflag & f) -#define _O_FLAG(tty,f) ((tty)->termios.c_oflag & f) - -#define L_CANON(tty) _L_FLAG((tty),ICANON) -#define L_ISIG(tty) _L_FLAG((tty),ISIG) -#define L_ECHO(tty) _L_FLAG((tty),ECHO) -#define L_ECHOE(tty) _L_FLAG((tty),ECHOE) -#define L_ECHOK(tty) _L_FLAG((tty),ECHOK) -#define L_ECHOCTL(tty) _L_FLAG((tty),ECHOCTL) -#define L_ECHOKE(tty) _L_FLAG((tty),ECHOKE) - -#define I_UCLC(tty) _I_FLAG((tty),IUCLC) -#define I_NLCR(tty) _I_FLAG((tty),INLCR) -#define I_CRNL(tty) _I_FLAG((tty),ICRNL) -#define I_NOCR(tty) _I_FLAG((tty),IGNCR) - -#define O_POST(tty) _O_FLAG((tty),OPOST) -#define O_NLCR(tty) _O_FLAG((tty),ONLCR) -#define O_CRNL(tty) _O_FLAG((tty),OCRNL) -#define O_NLRET(tty) _O_FLAG((tty),ONLRET) -#define O_LCUC(tty) _O_FLAG((tty),OLCUC) - -struct tty_struct tty_table[] = { - { - {ICRNL, /* change incoming CR to NL */ - OPOST|ONLCR, /* change outgoing NL to CRNL */ - 0, - ISIG | ICANON | ECHO | ECHOCTL | ECHOKE, - 0, /* console termio */ - INIT_C_CC}, - 0, /* initial pgrp */ - 0, /* initial stopped */ - con_write, - {0,0,0,0,""}, /* console read-queue */ - {0,0,0,0,""}, /* console write-queue */ - {0,0,0,0,""} /* console secondary queue */ - },{ - {0, /* no translation */ - 0, /* no translation */ - B2400 | CS8, - 0, - 0, - INIT_C_CC}, - 0, - 0, - rs_write, - {0x3f8,0,0,0,""}, /* rs 1 */ - {0x3f8,0,0,0,""}, - {0,0,0,0,""} - },{ - {0, /* no translation */ - 0, /* no translation */ - B2400 | CS8, - 0, - 0, - INIT_C_CC}, - 0, - 0, - rs_write, - {0x2f8,0,0,0,""}, /* rs 2 */ - {0x2f8,0,0,0,""}, - {0,0,0,0,""} - } -}; - -/* - * these are the tables used by the machine code handlers. - * you can implement pseudo-tty's or something by changing - * them. Currently not done. - */ -struct tty_queue * table_list[]={ - &tty_table[0].read_q, &tty_table[0].write_q, - &tty_table[1].read_q, &tty_table[1].write_q, - &tty_table[2].read_q, &tty_table[2].write_q - }; - -void tty_init(void) -{ - rs_init(); - con_init(); -} - -void tty_intr(struct tty_struct * tty, int mask) -{ - int i; - - if (tty->pgrp <= 0) - return; - for (i=0;ipgrp==tty->pgrp) - task[i]->signal |= mask; -} - -static void sleep_if_empty(struct tty_queue * queue) -{ - cli(); - while (!current->signal && EMPTY(*queue)) - interruptible_sleep_on(&queue->proc_list); - sti(); -} - -static void sleep_if_full(struct tty_queue * queue) -{ - if (!FULL(*queue)) - return; - cli(); - while (!current->signal && LEFT(*queue)<128) - interruptible_sleep_on(&queue->proc_list); - sti(); -} - -void wait_for_keypress(void) -{ - sleep_if_empty(&tty_table[0].secondary); -} - -void copy_to_cooked(struct tty_struct * tty) -{ - signed char c; - - while (!EMPTY(tty->read_q) && !FULL(tty->secondary)) { - GETCH(tty->read_q,c); - if (c==13) - if (I_CRNL(tty)) - c=10; - else if (I_NOCR(tty)) - continue; - else ; - else if (c==10 && I_NLCR(tty)) - c=13; - if (I_UCLC(tty)) - c=tolower(c); - if (L_CANON(tty)) { - if (c==KILL_CHAR(tty)) { - /* deal with killing the input line */ - while(!(EMPTY(tty->secondary) || - (c=LAST(tty->secondary))==10 || - c==EOF_CHAR(tty))) { - if (L_ECHO(tty)) { - if (c<32) - PUTCH(127,tty->write_q); - PUTCH(127,tty->write_q); - tty->write(tty); - } - DEC(tty->secondary.head); - } - continue; - } - if (c==ERASE_CHAR(tty)) { - if (EMPTY(tty->secondary) || - (c=LAST(tty->secondary))==10 || - c==EOF_CHAR(tty)) - continue; - if (L_ECHO(tty)) { - if (c<32) - PUTCH(127,tty->write_q); - PUTCH(127,tty->write_q); - tty->write(tty); - } - DEC(tty->secondary.head); - continue; - } - if (c==STOP_CHAR(tty)) { - tty->stopped=1; - continue; - } - if (c==START_CHAR(tty)) { - tty->stopped=0; - continue; - } - } - if (L_ISIG(tty)) { - if (c==INTR_CHAR(tty)) { - tty_intr(tty,INTMASK); - continue; - } - if (c==QUIT_CHAR(tty)) { - tty_intr(tty,QUITMASK); - continue; - } - } - if (c==10 || c==EOF_CHAR(tty)) - tty->secondary.data++; - if (L_ECHO(tty)) { - if (c==10) { - PUTCH(10,tty->write_q); - PUTCH(13,tty->write_q); - } else if (c<32) { - if (L_ECHOCTL(tty)) { - PUTCH('^',tty->write_q); - PUTCH(c+64,tty->write_q); - } - } else - PUTCH(c,tty->write_q); - tty->write(tty); - } - PUTCH(c,tty->secondary); - } - wake_up(&tty->secondary.proc_list); -} - -int tty_read(unsigned channel, char * buf, int nr) -{ - struct tty_struct * tty; - char c, * b=buf; - int minimum,time,flag=0; - long oldalarm; - - if (channel>2 || nr<0) return -1; - tty = &tty_table[channel]; - oldalarm = current->alarm; - time = 10L*tty->termios.c_cc[VTIME]; - minimum = tty->termios.c_cc[VMIN]; - if (time && !minimum) { - minimum=1; - if ((flag=(!oldalarm || time+jiffiesalarm = time+jiffies; - } - if (minimum>nr) - minimum=nr; - while (nr>0) { - if (flag && (current->signal & ALRMMASK)) { - current->signal &= ~ALRMMASK; - break; - } - if (current->signal) - break; - if (EMPTY(tty->secondary) || (L_CANON(tty) && - !tty->secondary.data && LEFT(tty->secondary)>20)) { - sleep_if_empty(&tty->secondary); - continue; - } - do { - GETCH(tty->secondary,c); - if (c==EOF_CHAR(tty) || c==10) - tty->secondary.data--; - if (c==EOF_CHAR(tty) && L_CANON(tty)) - return (b-buf); - else { - put_fs_byte(c,b++); - if (!--nr) - break; - } - } while (nr>0 && !EMPTY(tty->secondary)); - if (time && !L_CANON(tty)) { - if ((flag=(!oldalarm || time+jiffiesalarm = time+jiffies; - else - current->alarm = oldalarm; - } - if (L_CANON(tty)) { - if (b-buf) - break; - } else if (b-buf >= minimum) - break; - } - current->alarm = oldalarm; - if (current->signal && !(b-buf)) - return -EINTR; - return (b-buf); -} - -int tty_write(unsigned channel, char * buf, int nr) -{ - static int cr_flag=0; - struct tty_struct * tty; - char c, *b=buf; - - if (channel>2 || nr<0) return -1; - tty = channel + tty_table; - while (nr>0) { - sleep_if_full(&tty->write_q); - if (current->signal) - break; - while (nr>0 && !FULL(tty->write_q)) { - c=get_fs_byte(b); - if (O_POST(tty)) { - if (c=='\r' && O_CRNL(tty)) - c='\n'; - else if (c=='\n' && O_NLRET(tty)) - c='\r'; - if (c=='\n' && !cr_flag && O_NLCR(tty)) { - cr_flag = 1; - PUTCH(13,tty->write_q); - continue; - } - if (O_LCUC(tty)) - c=toupper(c); - } - b++; nr--; - cr_flag = 0; - PUTCH(c,tty->write_q); - } - tty->write(tty); - if (nr>0) - schedule(); - } - return (b-buf); -} - -/* - * Jeh, sometimes I really like the 386. - * This routine is called from an interrupt, - * and there should be absolutely no problem - * with sleeping even in an interrupt (I hope). - * Of course, if somebody proves me wrong, I'll - * hate intel for all time :-). We'll have to - * be careful and see to reinstating the interrupt - * chips before calling this, though. - * - * I don't think we sleep here under normal circumstances - * anyway, which is good, as the task sleeping might be - * totally innocent. - */ -void do_tty_interrupt(int tty) -{ - copy_to_cooked(tty_table+tty); -} - -void chr_dev_init(void) -{ -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/tty_ioctl.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/tty_ioctl.c deleted file mode 100644 index e4e3745..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/tty_ioctl.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * linux/kernel/chr_drv/tty_ioctl.c - * - * (C) 1991 Linus Torvalds - */ - -#include -#include - -#include -#include -#include - -#include -#include -#include - -static unsigned short quotient[] = { - 0, 2304, 1536, 1047, 857, - 768, 576, 384, 192, 96, - 64, 48, 24, 12, 6, 3 -}; - -static void change_speed(struct tty_struct * tty) -{ - unsigned short port,quot; - - if (!(port = tty->read_q.data)) - return; - quot = quotient[tty->termios.c_cflag & CBAUD]; - cli(); - outb_p(0x80,port+3); /* set DLAB */ - outb_p(quot & 0xff,port); /* LS of divisor */ - outb_p(quot >> 8,port+1); /* MS of divisor */ - outb(0x03,port+3); /* reset DLAB */ - sti(); -} - -static void flush(struct tty_queue * queue) -{ - cli(); - queue->head = queue->tail; - sti(); -} - -static void wait_until_sent(struct tty_struct * tty) -{ - /* do nothing - not implemented */ -} - -static void send_break(struct tty_struct * tty) -{ - /* do nothing - not implemented */ -} - -static int get_termios(struct tty_struct * tty, struct termios * termios) -{ - int i; - - verify_area(termios, sizeof (*termios)); - for (i=0 ; i< (sizeof (*termios)) ; i++) - put_fs_byte( ((char *)&tty->termios)[i] , i+(char *)termios ); - return 0; -} - -static int set_termios(struct tty_struct * tty, struct termios * termios) -{ - int i; - - for (i=0 ; i< (sizeof (*termios)) ; i++) - ((char *)&tty->termios)[i]=get_fs_byte(i+(char *)termios); - change_speed(tty); - return 0; -} - -static int get_termio(struct tty_struct * tty, struct termio * termio) -{ - int i; - struct termio tmp_termio; - - verify_area(termio, sizeof (*termio)); - tmp_termio.c_iflag = tty->termios.c_iflag; - tmp_termio.c_oflag = tty->termios.c_oflag; - tmp_termio.c_cflag = tty->termios.c_cflag; - tmp_termio.c_lflag = tty->termios.c_lflag; - tmp_termio.c_line = tty->termios.c_line; - for(i=0 ; i < NCC ; i++) - tmp_termio.c_cc[i] = tty->termios.c_cc[i]; - for (i=0 ; i< (sizeof (*termio)) ; i++) - put_fs_byte( ((char *)&tmp_termio)[i] , i+(char *)termio ); - return 0; -} - -/* - * This only works as the 386 is low-byt-first - */ -static int set_termio(struct tty_struct * tty, struct termio * termio) -{ - int i; - struct termio tmp_termio; - - for (i=0 ; i< (sizeof (*termio)) ; i++) - ((char *)&tmp_termio)[i]=get_fs_byte(i+(char *)termio); - *(unsigned short *)&tty->termios.c_iflag = tmp_termio.c_iflag; - *(unsigned short *)&tty->termios.c_oflag = tmp_termio.c_oflag; - *(unsigned short *)&tty->termios.c_cflag = tmp_termio.c_cflag; - *(unsigned short *)&tty->termios.c_lflag = tmp_termio.c_lflag; - tty->termios.c_line = tmp_termio.c_line; - for(i=0 ; i < NCC ; i++) - tty->termios.c_cc[i] = tmp_termio.c_cc[i]; - change_speed(tty); - return 0; -} - -int tty_ioctl(int dev, int cmd, int arg) -{ - struct tty_struct * tty; - if (MAJOR(dev) == 5) { - dev=current->tty; - if (dev<0) - panic("tty_ioctl: dev<0"); - } else - dev=MINOR(dev); - tty = dev + tty_table; - switch (cmd) { - case TCGETS: - return get_termios(tty,(struct termios *) arg); - case TCSETSF: - flush(&tty->read_q); /* fallthrough */ - case TCSETSW: - wait_until_sent(tty); /* fallthrough */ - case TCSETS: - return set_termios(tty,(struct termios *) arg); - case TCGETA: - return get_termio(tty,(struct termio *) arg); - case TCSETAF: - flush(&tty->read_q); /* fallthrough */ - case TCSETAW: - wait_until_sent(tty); /* fallthrough */ - case TCSETA: - return set_termio(tty,(struct termio *) arg); - case TCSBRK: - if (!arg) { - wait_until_sent(tty); - send_break(tty); - } - return 0; - case TCXONC: - return -EINVAL; /* not implemented */ - case TCFLSH: - if (arg==0) - flush(&tty->read_q); - else if (arg==1) - flush(&tty->write_q); - else if (arg==2) { - flush(&tty->read_q); - flush(&tty->write_q); - } else - return -EINVAL; - return 0; - case TIOCEXCL: - return -EINVAL; /* not implemented */ - case TIOCNXCL: - return -EINVAL; /* not implemented */ - case TIOCSCTTY: - return -EINVAL; /* set controlling term NI */ - case TIOCGPGRP: - verify_area((void *) arg,4); - put_fs_long(tty->pgrp,(unsigned long *) arg); - return 0; - case TIOCSPGRP: - tty->pgrp=get_fs_long((unsigned long *) arg); - return 0; - case TIOCOUTQ: - verify_area((void *) arg,4); - put_fs_long(CHARS(tty->write_q),(unsigned long *) arg); - return 0; - case TIOCINQ: - verify_area((void *) arg,4); - put_fs_long(CHARS(tty->secondary), - (unsigned long *) arg); - return 0; - case TIOCSTI: - return -EINVAL; /* not implemented */ - case TIOCGWINSZ: - return -EINVAL; /* not implemented */ - case TIOCSWINSZ: - return -EINVAL; /* not implemented */ - case TIOCMGET: - return -EINVAL; /* not implemented */ - case TIOCMBIS: - return -EINVAL; /* not implemented */ - case TIOCMBIC: - return -EINVAL; /* not implemented */ - case TIOCMSET: - return -EINVAL; /* not implemented */ - case TIOCGSOFTCAR: - return -EINVAL; /* not implemented */ - case TIOCSSOFTCAR: - return -EINVAL; /* not implemented */ - default: - return -EINVAL; - } -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/tty_ioctl.s b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/tty_ioctl.s deleted file mode 100644 index 821f31b..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/chr_drv/tty_ioctl.s +++ /dev/null @@ -1,446 +0,0 @@ - .file "tty_ioctl.c" - .data - .align 32 -_quotient: - .word 0 - .word 2304 - .word 1536 - .word 1047 - .word 857 - .word 768 - .word 576 - .word 384 - .word 192 - .word 96 - .word 64 - .word 48 - .word 24 - .word 12 - .word 6 - .word 3 - .text - .p2align 2,,3 - .def _change_speed; .scl 3; .type 32; .endef -_change_speed: - pushl %edi - pushl %esi - pushl %ebx - movl 16(%esp), %eax - movw 48(%eax), %si - testw %si, %si - je L1 - movl 8(%eax), %eax - andl $15, %eax - movw _quotient(%eax,%eax), %cx -/APP - cli -/NO_APP - movzwl %si, %edi - leal 3(%edi), %ebx - movl $128, %eax - movl %ebx, %edx -/APP - outb %al,%dx - jmp 1f -1: jmp 1f -1: -/NO_APP - movzbl %cl, %eax - movl %esi, %edx -/APP - outb %al,%dx - jmp 1f -1: jmp 1f -1: -/NO_APP - movzbl %ch, %ecx - leal 1(%edi), %edx - movl %ecx, %eax -/APP - outb %al,%dx - jmp 1f -1: jmp 1f -1: -/NO_APP - movl %ebx, %edx - movl $3, %eax -/APP - outb %al,%dx - sti -/NO_APP -L1: - popl %ebx - popl %esi - popl %edi - ret - .p2align 2,,3 - .def _flush; .scl 3; .type 32; .endef -_flush: - movl 4(%esp), %edx -/APP - cli -/NO_APP - movl 8(%edx), %eax - movl %eax, 4(%edx) -/APP - sti -/NO_APP - ret - .p2align 2,,3 - .def _wait_until_sent; .scl 3; .type 32; .endef -_wait_until_sent: - ret - .p2align 2,,3 - .def _send_break; .scl 3; .type 32; .endef -_send_break: - ret - .p2align 2,,3 - .def _get_termios; .scl 3; .type 32; .endef -_get_termios: - pushl %esi - pushl %ebx - subl $12, %esp - movl 24(%esp), %esi - movl 28(%esp), %ebx - pushl $36 - pushl %ebx - call _verify_area - xorl %edx, %edx - addl $16, %esp - .p2align 2,,3 -L12: - movb (%edx,%esi), %al -/APP - movb %al,%fs:(%edx,%ebx) -/NO_APP - incl %edx - cmpl $35, %edx - jbe L12 - popl %edx - popl %ebx - xorl %eax, %eax - popl %esi - ret - .p2align 2,,3 - .def _set_termios; .scl 3; .type 32; .endef -_set_termios: - pushl %ebx - subl $8, %esp - movl 16(%esp), %ebx - movl 20(%esp), %ecx - xorl %edx, %edx - .p2align 2,,3 -L21: -/APP - movb %fs:(%edx,%ecx),%al -/NO_APP - movb %al, (%edx,%ebx) - incl %edx - cmpl $35, %edx - jbe L21 - subl $12, %esp - pushl %ebx - call _change_speed - addl $24, %esp - xorl %eax, %eax - popl %ebx - ret - .p2align 2,,3 - .def _get_termio; .scl 3; .type 32; .endef -_get_termio: - pushl %esi - pushl %ebx - subl $44, %esp - movl 56(%esp), %esi - movl 60(%esp), %ebx - pushl $18 - pushl %ebx - call _verify_area - movw (%esi), %ax - movw %ax, 16(%esp) - movw 4(%esi), %ax - movw %ax, 18(%esp) - movw 8(%esi), %ax - movw %ax, 20(%esp) - movw 12(%esi), %ax - movw %ax, 22(%esp) - movb 16(%esi), %al - movb %al, 24(%esp) - xorl %edx, %edx - addl $16, %esp - .p2align 2,,3 -L29: - movb 17(%edx,%esi), %al - movb %al, 9(%esp,%edx) - incl %edx - cmpl $7, %edx - jle L29 - xorl %edx, %edx - .p2align 2,,3 -L35: - movb (%esp,%edx), %al -/APP - movb %al,%fs:(%edx,%ebx) -/NO_APP - incl %edx - cmpl $17, %edx - jbe L35 - addl $36, %esp - popl %ebx - xorl %eax, %eax - popl %esi - ret - .p2align 2,,3 - .def _set_termio; .scl 3; .type 32; .endef -_set_termio: - pushl %ebx - subl $40, %esp - movl 48(%esp), %ebx - movl 52(%esp), %ecx - xorl %edx, %edx - .p2align 2,,3 -L46: -/APP - movb %fs:(%edx,%ecx),%al -/NO_APP - movb %al, (%esp,%edx) - incl %edx - cmpl $17, %edx - jbe L46 - movl (%esp), %eax - movw %ax, (%ebx) - movw 2(%esp), %ax - movw %ax, 4(%ebx) - movl 4(%esp), %eax - movw %ax, 8(%ebx) - movw 6(%esp), %ax - movw %ax, 12(%ebx) - movb 8(%esp), %al - movb %al, 16(%ebx) - xorl %edx, %edx - .p2align 2,,3 -L51: - movb 9(%esp,%edx), %al - movb %al, 17(%edx,%ebx) - incl %edx - cmpl $7, %edx - jle L51 - subl $12, %esp - pushl %ebx - call _change_speed - addl $56, %esp - xorl %eax, %eax - popl %ebx - ret -LC0: - .ascii "tty_ioctl: dev<0\0" - .p2align 2,,3 -.globl _tty_ioctl - .def _tty_ioctl; .scl 2; .type 32; .endef -_tty_ioctl: - pushl %edi - pushl %esi - pushl %ebx - movl 16(%esp), %ebx - movl %ebx, %eax - shrl $8, %eax - cmpl $5, %eax - movl 20(%esp), %esi - movl 24(%esp), %edi - je L107 - andl $255, %ebx -L59: - leal (%ebx,%ebx,4), %eax - leal (%eax,%eax,4), %eax - sall $2, %eax - subl %ebx, %eax - leal -21505(%esi), %edx - sall $5, %eax - cmpl $26, %edx - leal _tty_table(%eax), %ebx - movl $-22, %eax - ja L56 - jmp *L100(,%edx,4) - .p2align 2 - .align 4 -L100: - .long L61 - .long L64 - .long L63 - .long L62 - .long L65 - .long L68 - .long L67 - .long L66 - .long L69 - .long L98 - .long L72 - .long L98 - .long L98 - .long L98 - .long L82 - .long L84 - .long L86 - .long L98 - .long L98 - .long L98 - .long L98 - .long L98 - .long L98 - .long L98 - .long L98 - .long L98 - .long L88 -L61: - movl %edi, 20(%esp) - movl %ebx, 16(%esp) - popl %ebx - popl %esi - popl %edi - jmp _get_termios -L64: - movl %edi, 20(%esp) - movl %ebx, 16(%esp) - popl %ebx - popl %esi - popl %edi - jmp _set_termios -L63: - subl $12, %esp - pushl %ebx - call _wait_until_sent - addl $16, %esp - jmp L64 -L62: - subl $12, %esp - leal 48(%ebx), %eax - pushl %eax - call _flush - addl $16, %esp - jmp L63 -L65: - movl %edi, 20(%esp) - movl %ebx, 16(%esp) - popl %ebx - popl %esi - popl %edi - jmp _get_termio -L68: - movl %edi, 20(%esp) - movl %ebx, 16(%esp) - popl %ebx - popl %esi - popl %edi - jmp _set_termio -L67: - subl $12, %esp - pushl %ebx - call _wait_until_sent - addl $16, %esp - jmp L68 -L66: - subl $12, %esp - leal 48(%ebx), %eax - pushl %eax - call _flush - addl $16, %esp - jmp L67 -L69: - testl %edi, %edi - jne L104 - subl $12, %esp - pushl %ebx - call _wait_until_sent - movl %ebx, (%esp) - call _send_break -L105: - addl $16, %esp -L104: - xorl %eax, %eax - .p2align 2,,3 -L56: - popl %ebx - popl %esi - popl %edi - ret -L72: - testl %edi, %edi - je L108 - cmpl $1, %edi - je L109 - cmpl $2, %edi - je L110 - .p2align 2,,3 -L98: - movl $-22, %eax - jmp L56 -L110: - subl $12, %esp - leal 48(%ebx), %eax - pushl %eax - call _flush - popl %ecx -L101: - leal 1088(%ebx), %eax -L102: - pushl %eax - call _flush - jmp L105 -L109: - subl $12, %esp - jmp L101 -L108: - subl $12, %esp - leal 48(%ebx), %eax - jmp L102 -L82: - subl $8, %esp - pushl $4 - pushl %edi - call _verify_area - addl $16, %esp - movl 36(%ebx), %eax -L106: -/APP - movl %eax,%fs:(%edi) -/NO_APP - jmp L104 -L84: -/APP - movl %fs:(%edi),%eax -/NO_APP - movl %eax, 36(%ebx) - jmp L104 -L86: - subl $8, %esp - pushl $4 - pushl %edi - call _verify_area - movl 1092(%ebx), %eax - addl $16, %esp - subl 1096(%ebx), %eax -L103: - andl $1023, %eax - jmp L106 -L88: - subl $8, %esp - pushl $4 - pushl %edi - call _verify_area - movl 2132(%ebx), %eax - addl $16, %esp - subl 2136(%ebx), %eax - jmp L103 - .p2align 2,,3 -L107: - movl _current, %eax - movl 616(%eax), %ebx - testl %ebx, %ebx - jns L59 - subl $12, %esp - pushl $LC0 - call _panic - addl $16, %esp - jmp L59 - .def _panic; .scl 2; .type 32; .endef - .def _verify_area; .scl 2; .type 32; .endef diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/exit.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/exit.c deleted file mode 100644 index b22de34..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/exit.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - * linux/kernel/exit.c - * - * (C) 1991 Linus Torvalds - */ - -#include -#include -#include - -#include -#include -#include -#include - -int sys_pause(void); -int sys_close(int fd); - -void release(struct task_struct * p) -{ - int i; - - if (!p) - return; - for (i=1 ; i32) - return -EINVAL; - if (priv || (current->euid==p->euid) || suser()) - p->signal |= (1<<(sig-1)); - else - return -EPERM; - return 0; -} - -static void kill_session(void) -{ - struct task_struct **p = NR_TASKS + task; - - while (--p > &FIRST_TASK) { - if (*p && (*p)->session == current->session) - (*p)->signal |= 1<<(SIGHUP-1); - } -} - -/* - * XXX need to check permissions needed to send signals to process - * groups, etc. etc. kill() permissions semantics are tricky! - */ -int sys_kill(int pid,int sig) -{ - struct task_struct **p = NR_TASKS + task; - int err, retval = 0; - - if (!pid) while (--p > &FIRST_TASK) { - if (*p && (*p)->pgrp == current->pid) - if ((err=send_sig(sig,*p,1))) - retval = err; - } else if (pid>0) while (--p > &FIRST_TASK) { - if (*p && (*p)->pid == pid) - if ((err=send_sig(sig,*p,0))) - retval = err; - } else if (pid == -1) while (--p > &FIRST_TASK) { - if ((err = send_sig(sig,*p,0))) - retval = err; - } else while (--p > &FIRST_TASK) - if (*p && (*p)->pgrp == -pid) - if ((err = send_sig(sig,*p,0))) - retval = err; - return retval; -} - -static void tell_father(int pid) -{ - int i; - - if (pid) - for (i=0;ipid != pid) - continue; - task[i]->signal |= (1<<(SIGCHLD-1)); - return; - } -/* if we don't find any fathers, we just release ourselves */ -/* This is not really OK. Must change it to make father 1 */ - printk("BAD BAD - no father found\n\r"); - release(current); -} - -int do_exit(long code) -{ - int i; - free_page_tables(get_base(current->ldt[1]),get_limit(0x0f)); - free_page_tables(get_base(current->ldt[2]),get_limit(0x17)); - for (i=0 ; ifather == current->pid) { - task[i]->father = 1; - if (task[i]->state == TASK_ZOMBIE) - /* assumption task[1] is always init */ - (void) send_sig(SIGCHLD, task[1], 1); - } - for (i=0 ; ifilp[i]) - sys_close(i); - iput(current->pwd); - current->pwd=NULL; - iput(current->root); - current->root=NULL; - iput(current->executable); - current->executable=NULL; - if (current->leader && current->tty >= 0) - tty_table[current->tty].pgrp = 0; - if (last_task_used_math == current) - last_task_used_math = NULL; - if (current->leader) - kill_session(); - current->state = TASK_ZOMBIE; - current->exit_code = code; - tell_father(current->father); - schedule(); - return (-1); /* just to suppress warnings */ -} - -int sys_exit(int error_code) -{ - return do_exit((error_code&0xff)<<8); -} - -int sys_waitpid(pid_t pid,unsigned long * stat_addr, int options) -{ - int flag, code; - struct task_struct ** p; - - verify_area(stat_addr,4); -repeat: - flag=0; - for(p = &LAST_TASK ; p > &FIRST_TASK ; --p) { - if (!*p || *p == current) - continue; - if ((*p)->father != current->pid) - continue; - if (pid>0) { - if ((*p)->pid != pid) - continue; - } else if (!pid) { - if ((*p)->pgrp != current->pgrp) - continue; - } else if (pid != -1) { - if ((*p)->pgrp != -pid) - continue; - } - switch ((*p)->state) { - case TASK_STOPPED: - if (!(options & WUNTRACED)) - continue; - put_fs_long(0x7f,stat_addr); - return (*p)->pid; - case TASK_ZOMBIE: - current->cutime += (*p)->utime; - current->cstime += (*p)->stime; - flag = (*p)->pid; - code = (*p)->exit_code; - release(*p); - put_fs_long(code,stat_addr); - return flag; - default: - flag=1; - continue; - } - } - if (flag) { - if (options & WNOHANG) - return 0; - current->state=TASK_INTERRUPTIBLE; - schedule(); - if (!(current->signal &= ~(1<<(SIGCHLD-1)))) - goto repeat; - else - return -EINTR; - } - return -ECHILD; -} - - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/fork.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/fork.c deleted file mode 100644 index 2486b13..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/fork.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * linux/kernel/fork.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * 'fork.c' contains the help-routines for the 'fork' system call - * (see also system_call.s), and some misc functions ('verify_area'). - * Fork is rather simple, once you get the hang of it, but the memory - * management can be a bitch. See 'mm/mm.c': 'copy_page_tables()' - */ -#include - -#include -#include -#include -#include - -extern void write_verify(unsigned long address); - -long last_pid=0; - -void verify_area(void * addr,int size) -{ - unsigned long start; - - start = (unsigned long) addr; - size += start & 0xfff; - start &= 0xfffff000; - start += get_base(current->ldt[2]); - while (size>0) { - size -= 4096; - write_verify(start); - start += 4096; - } -} - -int copy_mem(int nr,struct task_struct * p) -{ - unsigned long old_data_base,new_data_base,data_limit; - unsigned long old_code_base,new_code_base,code_limit; - - code_limit=get_limit(0x0f); - data_limit=get_limit(0x17); - old_code_base = get_base(current->ldt[1]); - old_data_base = get_base(current->ldt[2]); - if (old_data_base != old_code_base) - panic("We don't support separate I&D"); - if (data_limit < code_limit) - panic("Bad data_limit"); - new_data_base = new_code_base = nr * 0x4000000; - p->start_code = new_code_base; - set_base(p->ldt[1],new_code_base); - set_base(p->ldt[2],new_data_base); - if (copy_page_tables(old_data_base,new_data_base,data_limit)) { - printk("free_page_tables: from copy_mem\n"); - free_page_tables(new_data_base,data_limit); - return -ENOMEM; - } - return 0; -} - -/* - * Ok, this is the main fork-routine. It copies the system process - * information (task[nr]) and sets up the necessary registers. It - * also copies the data segment in it's entirety. - */ -int copy_process(int nr,long ebp,long edi,long esi,long gs,long none, - long ebx,long ecx,long edx, - long fs,long es,long ds, - long eip,long cs,long eflags,long esp,long ss) -{ - struct task_struct *p; - int i; - struct file *f; - - p = (struct task_struct *) get_free_page(); - if (!p) - return -EAGAIN; - task[nr] = p; - *p = *current; /* NOTE! this doesn't copy the supervisor stack */ - p->state = TASK_UNINTERRUPTIBLE; - p->pid = last_pid; - p->father = current->pid; - p->counter = p->priority; - p->signal = 0; - p->alarm = 0; - p->leader = 0; /* process leadership doesn't inherit */ - p->utime = p->stime = 0; - p->cutime = p->cstime = 0; - p->start_time = jiffies; - p->tss.back_link = 0; - p->tss.esp0 = PAGE_SIZE + (long) p; - p->tss.ss0 = 0x10; - p->tss.eip = eip; - p->tss.eflags = eflags; - p->tss.eax = 0; - p->tss.ecx = ecx; - p->tss.edx = edx; - p->tss.ebx = ebx; - p->tss.esp = esp; - p->tss.ebp = ebp; - p->tss.esi = esi; - p->tss.edi = edi; - p->tss.es = es & 0xffff; - p->tss.cs = cs & 0xffff; - p->tss.ss = ss & 0xffff; - p->tss.ds = ds & 0xffff; - p->tss.fs = fs & 0xffff; - p->tss.gs = gs & 0xffff; - p->tss.ldt = _LDT(nr); - p->tss.trace_bitmap = 0x80000000; - if (last_task_used_math == current) - __asm__("clts ; fnsave %0"::"m" (p->tss.i387)); - if (copy_mem(nr,p)) { - task[nr] = NULL; - free_page((long) p); - return -EAGAIN; - } - for (i=0; ifilp[i])) - f->f_count++; - if (current->pwd) - current->pwd->i_count++; - if (current->root) - current->root->i_count++; - if (current->executable) - current->executable->i_count++; - set_tss_desc(gdt+(nr<<1)+FIRST_TSS_ENTRY,&(p->tss)); - set_ldt_desc(gdt+(nr<<1)+FIRST_LDT_ENTRY,&(p->ldt)); - p->state = TASK_RUNNING; /* do this last, just in case */ - return last_pid; -} - -int find_empty_process(void) -{ - int i; - - repeat: - if ((++last_pid)<0) last_pid=1; - for(i=0 ; ipid == last_pid) goto repeat; - for(i=1 ; i tmp_make - (for i in *.c;do echo -n `echo $$i | sed 's,\.c,\.s,'`" "; \ - $(CPP) -M $$i;done) >> tmp_make - cp tmp_make Makefile - -### Dependencies: diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/math/math_emulate.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/math/math_emulate.c deleted file mode 100644 index 825e528..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/math/math_emulate.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * linux/kernel/math/math_emulate.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * This directory should contain the math-emulation code. - * Currently only results in a signal. - */ - -#include - -#include -#include -#include - -void math_emulate(long edi, long esi, long ebp, long sys_call_ret, - long eax,long ebx,long ecx,long edx, - unsigned short fs,unsigned short es,unsigned short ds, - unsigned long eip,unsigned short cs,unsigned long eflags, - unsigned short ss, unsigned long esp) -{ - unsigned char first, second; - -/* 0x0007 means user code space */ - if (cs != 0x000F) { - printk("math_emulate: %04x:%08x\n\r",cs,eip); - panic("Math emulation needed in kernel"); - } - first = get_fs_byte((char *)((*&eip)++)); - second = get_fs_byte((char *)((*&eip)++)); - printk("%04x:%08x %02x %02x\n\r",cs,eip-2,first,second); - current->signal |= 1<<(SIGFPE-1); -} - -void math_error(void) -{ - __asm__("fnclex"); - if (last_task_used_math) - last_task_used_math->signal |= 1<<(SIGFPE-1); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/mktime.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/mktime.c deleted file mode 100644 index a67db96..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/mktime.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * linux/kernel/mktime.c - * - * (C) 1991 Linus Torvalds - */ - -#include - -/* - * This isn't the library routine, it is only used in the kernel. - * as such, we don't care about years<1970 etc, but assume everything - * is ok. Similarly, TZ etc is happily ignored. We just do everything - * as easily as possible. Let's find something public for the library - * routines (although I think minix times is public). - */ -/* - * PS. I hate whoever though up the year 1970 - couldn't they have gotten - * a leap-year instead? I also hate Gregorius, pope or no. I'm grumpy. - */ -#define MINUTE 60 -#define HOUR (60*MINUTE) -#define DAY (24*HOUR) -#define YEAR (365*DAY) - -/* interestingly, we assume leap-years */ -static int month[12] = { - 0, - DAY*(31), - DAY*(31+29), - DAY*(31+29+31), - DAY*(31+29+31+30), - DAY*(31+29+31+30+31), - DAY*(31+29+31+30+31+30), - DAY*(31+29+31+30+31+30+31), - DAY*(31+29+31+30+31+30+31+31), - DAY*(31+29+31+30+31+30+31+31+30), - DAY*(31+29+31+30+31+30+31+31+30+31), - DAY*(31+29+31+30+31+30+31+31+30+31+30) -}; - -long kernel_mktime(struct tm * tm) -{ - long res; - int year; - - year = tm->tm_year - 70; -/* magic offsets (y+1) needed to get leapyears right.*/ - res = YEAR*year + DAY*((year+1)/4); - res += month[tm->tm_mon]; -/* and (y+2) here. If it wasn't a leap-year, we have to adjust */ - if (tm->tm_mon>1 && ((year+2)%4)) - res -= DAY; - res += DAY*(tm->tm_mday-1); - res += HOUR*tm->tm_hour; - res += MINUTE*tm->tm_min; - res += tm->tm_sec; - return res; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/panic.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/panic.c deleted file mode 100644 index 566467c..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/panic.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * linux/kernel/panic.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * This function is used through-out the kernel (includeinh mm and fs) - * to indicate a major problem. - */ -#define PANIC - -#include -#include - -void sys_sync(void); /* it's really int */ - -volatile void panic(const char * s) -{ - printk("Kernel panic: %s\n\r",s); - if (current == task[0]) - printk("In swapper task - not syncing\n\r"); - else - sys_sync(); - for(;;); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/printk.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/printk.c deleted file mode 100644 index c464d43..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/printk.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * linux/kernel/printk.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * When in kernel-mode, we cannot use printf, as fs is liable to - * point to 'interesting' things. Make a printf with fs-saving, and - * all is well. - */ -#include -#include - -#include - -static char buf[1024]; - -extern int vsprintf(char * buf, const char * fmt, va_list args); - -int printk(const char *fmt, ...) -{ - va_list args; - int i; - - va_start(args, fmt); - i=vsprintf(buf,fmt,args); - va_end(args); - __asm__("push %%fs\n\t" - "push %%ds\n\t" - "pop %%fs\n\t" - "pushl %0\n\t" - "pushl $_buf\n\t" - "pushl $0\n\t" - "call _tty_write\n\t" - "addl $8,%%esp\n\t" - "popl %0\n\t" - "pop %%fs" - ::"r" (i):"ax","cx","dx"); - return i; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/sched.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/sched.c deleted file mode 100644 index 15d839b..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/sched.c +++ /dev/null @@ -1,412 +0,0 @@ -/* - * linux/kernel/sched.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * 'sched.c' is the main kernel file. It contains scheduling primitives - * (sleep_on, wakeup, schedule etc) as well as a number of simple system - * call functions (type getpid(), which just extracts a field from - * current-task - */ -#include -#include -#include -#include -#include -#include -#include - -#include - -#define _S(nr) (1<<((nr)-1)) -#define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP))) - -void show_task(int nr,struct task_struct * p) -{ - int i,j = 4096-sizeof(struct task_struct); - - printk("%d: pid=%d, state=%d, ",nr,p->pid,p->state); - i=0; - while (i>2 ] ; - -struct { - long * a; - short b; - } stack_start = { & user_stack [PAGE_SIZE>>2] , 0x10 }; -/* - * 'math_state_restore()' saves the current math information in the - * old math state array, and gets the new ones from the current task - */ -void math_state_restore() -{ - if (last_task_used_math == current) - return; - __asm__("fwait"); - if (last_task_used_math) { - __asm__("fnsave %0"::"m" (last_task_used_math->tss.i387)); - } - last_task_used_math=current; - if (current->used_math) { - __asm__("frstor %0"::"m" (current->tss.i387)); - } else { - __asm__("fninit"::); - current->used_math=1; - } -} - -/* - * 'schedule()' is the scheduler function. This is GOOD CODE! There - * probably won't be any reason to change this, as it should work well - * in all circumstances (ie gives IO-bound processes good response etc). - * The one thing you might take a look at is the signal-handler code here. - * - * NOTE!! Task 0 is the 'idle' task, which gets called when no other - * tasks can run. It can not be killed, and it cannot sleep. The 'state' - * information in task[0] is never used. - */ -void schedule(void) -{ - int i,next,c; - struct task_struct ** p; - -/* check alarm, wake up any interruptible tasks that have got a signal */ - - for(p = &LAST_TASK ; p > &FIRST_TASK ; --p) - if (*p) { - if ((*p)->alarm && (*p)->alarm < jiffies) { - (*p)->signal |= (1<<(SIGALRM-1)); - (*p)->alarm = 0; - } - if (((*p)->signal & ~(_BLOCKABLE & (*p)->blocked)) && - (*p)->state==TASK_INTERRUPTIBLE) - (*p)->state=TASK_RUNNING; - } - -/* this is the scheduler proper: */ - - while (1) { - c = -1; - next = 0; - i = NR_TASKS; - p = &task[NR_TASKS]; - while (--i) { - if (!*--p) - continue; - if ((*p)->state == TASK_RUNNING && (*p)->counter > c) - c = (*p)->counter, next = i; - } - if (c) break; - for(p = &LAST_TASK ; p > &FIRST_TASK ; --p) - if (*p) - (*p)->counter = ((*p)->counter >> 1) + - (*p)->priority; - } - switch_to(next); -} - -int sys_pause(void) -{ - current->state = TASK_INTERRUPTIBLE; - schedule(); - return 0; -} - -void sleep_on(struct task_struct **p) -{ - struct task_struct *tmp; - - if (!p) - return; - if (current == &(init_task.task)) - panic("task[0] trying to sleep"); - tmp = *p; - *p = current; - current->state = TASK_UNINTERRUPTIBLE; - schedule(); - if (tmp) - tmp->state=0; -} - -void interruptible_sleep_on(struct task_struct **p) -{ - struct task_struct *tmp; - - if (!p) - return; - if (current == &(init_task.task)) - panic("task[0] trying to sleep"); - tmp=*p; - *p=current; -repeat: current->state = TASK_INTERRUPTIBLE; - schedule(); - if (*p && *p != current) { - (**p).state=0; - goto repeat; - } - *p=NULL; - if (tmp) - tmp->state=0; -} - -void wake_up(struct task_struct **p) -{ - if (p && *p) { - (**p).state=0; - *p=NULL; - } -} - -/* - * OK, here are some floppy things that shouldn't be in the kernel - * proper. They are here because the floppy needs a timer, and this - * was the easiest way of doing it. - */ -static struct task_struct * wait_motor[4] = {NULL,NULL,NULL,NULL}; -static int mon_timer[4]={0,0,0,0}; -static int moff_timer[4]={0,0,0,0}; -unsigned char current_DOR = 0x0C; - -int ticks_to_floppy_on(unsigned int nr) -{ - extern unsigned char selected; - unsigned char mask = 0x10 << nr; - - if (nr>3) - panic("floppy_on: nr>3"); - moff_timer[nr]=10000; /* 100 s = very big :-) */ - cli(); /* use floppy_off to turn it off */ - mask |= current_DOR; - if (!selected) { - mask &= 0xFC; - mask |= nr; - } - if (mask != current_DOR) { - outb(mask,FD_DOR); - if ((mask ^ current_DOR) & 0xf0) - mon_timer[nr] = HZ/2; - else if (mon_timer[nr] < 2) - mon_timer[nr] = 2; - current_DOR = mask; - } - sti(); - return mon_timer[nr]; -} - -void floppy_on(unsigned int nr) -{ - cli(); - while (ticks_to_floppy_on(nr)) - sleep_on(nr+wait_motor); - sti(); -} - -void floppy_off(unsigned int nr) -{ - moff_timer[nr]=3*HZ; -} - -void do_floppy_timer(void) -{ - int i; - unsigned char mask = 0x10; - - for (i=0 ; i<4 ; i++,mask <<= 1) { - if (!(mask & current_DOR)) - continue; - if (mon_timer[i]) { - if (!--mon_timer[i]) - wake_up(i+wait_motor); - } else if (!moff_timer[i]) { - current_DOR &= ~mask; - outb(current_DOR,FD_DOR); - } else - moff_timer[i]--; - } -} - -#define TIME_REQUESTS 64 - -static struct timer_list { - long jiffies; - void (*fn)(); - struct timer_list * next; -} timer_list[TIME_REQUESTS], * next_timer = NULL; - -void add_timer(long jiffies, void (*fn)(void)) -{ - struct timer_list * p; - - if (!fn) - return; - cli(); - if (jiffies <= 0) - (fn)(); - else { - for (p = timer_list ; p < timer_list + TIME_REQUESTS ; p++) - if (!p->fn) - break; - if (p >= timer_list + TIME_REQUESTS) - panic("No more time requests free"); - p->fn = fn; - p->jiffies = jiffies; - p->next = next_timer; - next_timer = p; - while (p->next && p->next->jiffies < p->jiffies) { - p->jiffies -= p->next->jiffies; - fn = p->fn; - p->fn = p->next->fn; - p->next->fn = fn; - jiffies = p->jiffies; - p->jiffies = p->next->jiffies; - p->next->jiffies = jiffies; - p = p->next; - } - } - sti(); -} - -void do_timer(long cpl) -{ - extern int beepcount; - extern void sysbeepstop(void); - - if (beepcount) - if (!--beepcount) - sysbeepstop(); - - if (cpl) - current->utime++; - else - current->stime++; - - if (next_timer) { - next_timer->jiffies--; - while (next_timer && next_timer->jiffies <= 0) { - void (*fn)(void); - - fn = next_timer->fn; - next_timer->fn = NULL; - next_timer = next_timer->next; - (fn)(); - } - } - if (current_DOR & 0xf0) - do_floppy_timer(); - if ((--current->counter)>0) return; - current->counter=0; - if (!cpl) return; - schedule(); -} - -int sys_alarm(long seconds) -{ - int old = current->alarm; - - if (old) - old = (old - jiffies) / HZ; - current->alarm = (seconds>0)?(jiffies+HZ*seconds):0; - return (old); -} - -int sys_getpid(void) -{ - return current->pid; -} - -int sys_getppid(void) -{ - return current->father; -} - -int sys_getuid(void) -{ - return current->uid; -} - -int sys_geteuid(void) -{ - return current->euid; -} - -int sys_getgid(void) -{ - return current->gid; -} - -int sys_getegid(void) -{ - return current->egid; -} - -int sys_nice(long increment) -{ - if (current->priority-increment>0) - current->priority -= increment; - return 0; -} - -void sched_init(void) -{ - int i; - struct desc_struct * p; - - if (sizeof(struct sigaction) != 16) - panic("Struct sigaction MUST be 16 bytes"); - set_tss_desc(gdt+FIRST_TSS_ENTRY,&(init_task.task.tss)); - set_ldt_desc(gdt+FIRST_LDT_ENTRY,&(init_task.task.ldt)); - p = gdt+2+FIRST_TSS_ENTRY; - for(i=1;ia=p->b=0; - p++; - p->a=p->b=0; - p++; - } -/* Clear NT, so that we won't have troubles with that later on */ - __asm__("pushfl ; andl $0xffffbfff,(%esp) ; popfl"); - ltr(0); - lldt(0); - outb_p(0x36,0x43); /* binary, mode 3, LSB/MSB, ch 0 */ - outb_p(LATCH & 0xff , 0x40); /* LSB */ - outb(LATCH >> 8 , 0x40); /* MSB */ - set_intr_gate(0x20,&timer_interrupt); - outb(inb_p(0x21)&~0x01,0x21); - set_system_gate(0x80,&system_call); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/signal.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/signal.c deleted file mode 100644 index 055fc20..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/signal.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * linux/kernel/signal.c - * - * (C) 1991 Linus Torvalds - */ - -#include -#include -#include - -#include - -volatile void do_exit(int error_code); - -int sys_sgetmask() -{ - return current->blocked; -} - -int sys_ssetmask(int newmask) -{ - int old=current->blocked; - - current->blocked = newmask & ~(1<<(SIGKILL-1)); - return old; -} - -static inline void save_old(char * from,char * to) -{ - int i; - - verify_area(to, sizeof(struct sigaction)); - for (i=0 ; i< sizeof(struct sigaction) ; i++) { - put_fs_byte(*from,to); - from++; - to++; - } -} - -static inline void get_new(char * from,char * to) -{ - int i; - - for (i=0 ; i< sizeof(struct sigaction) ; i++) - *(to++) = get_fs_byte(from++); -} - -int sys_signal(int signum, long handler, long restorer) -{ - struct sigaction tmp; - - if (signum<1 || signum>32 || signum==SIGKILL) - return -1; - tmp.sa_handler = (void (*)(int)) handler; - tmp.sa_mask = 0; - tmp.sa_flags = SA_ONESHOT | SA_NOMASK; - tmp.sa_restorer = (void (*)(void)) restorer; - handler = (long) current->sigaction[signum-1].sa_handler; - current->sigaction[signum-1] = tmp; - return handler; -} - -int sys_sigaction(int signum, const struct sigaction * action, - struct sigaction * oldaction) -{ - struct sigaction tmp; - - if (signum<1 || signum>32 || signum==SIGKILL) - return -1; - tmp = current->sigaction[signum-1]; - get_new((char *) action, - (char *) (signum-1+current->sigaction)); - if (oldaction) - save_old((char *) &tmp,(char *) oldaction); - if (current->sigaction[signum-1].sa_flags & SA_NOMASK) - current->sigaction[signum-1].sa_mask = 0; - else - current->sigaction[signum-1].sa_mask |= (1<<(signum-1)); - return 0; -} - -void do_signal(long signr,long eax, long ebx, long ecx, long edx, - long fs, long es, long ds, - long eip, long cs, long eflags, - unsigned long * esp, long ss) -{ - unsigned long sa_handler; - long old_eip=eip; - struct sigaction * sa = current->sigaction + signr - 1; - int longs; - unsigned long * tmp_esp; - - sa_handler = (unsigned long) sa->sa_handler; - if (sa_handler==1) - return; - if (!sa_handler) { - if (signr==SIGCHLD) - return; - else - do_exit(1<<(signr-1)); - } - if (sa->sa_flags & SA_ONESHOT) - sa->sa_handler = NULL; - *(&eip) = sa_handler; - longs = (sa->sa_flags & SA_NOMASK)?7:8; - *(&esp) -= longs; - verify_area(esp,longs*4); - tmp_esp=esp; - put_fs_long((long) sa->sa_restorer,tmp_esp++); - put_fs_long(signr,tmp_esp++); - if (!(sa->sa_flags & SA_NOMASK)) - put_fs_long(current->blocked,tmp_esp++); - put_fs_long(eax,tmp_esp++); - put_fs_long(ecx,tmp_esp++); - put_fs_long(edx,tmp_esp++); - put_fs_long(eflags,tmp_esp++); - put_fs_long(old_eip,tmp_esp++); - current->blocked |= sa->sa_mask; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/sys.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/sys.c deleted file mode 100644 index 2c01e67..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/sys.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * linux/kernel/sys.c - * - * (C) 1991 Linus Torvalds - */ - -#include - -#include -#include -#include -#include -#include -#include - -int sys_ftime() -{ - return -ENOSYS; -} - -int sys_break() -{ - return -ENOSYS; -} - -int sys_ptrace() -{ - return -ENOSYS; -} - -int sys_stty() -{ - return -ENOSYS; -} - -int sys_gtty() -{ - return -ENOSYS; -} - -int sys_rename() -{ - return -ENOSYS; -} - -int sys_prof() -{ - return -ENOSYS; -} - -int sys_setregid(int rgid, int egid) -{ - if (rgid>0) { - if ((current->gid == rgid) || - suser()) - current->gid = rgid; - else - return(-EPERM); - } - if (egid>0) { - if ((current->gid == egid) || - (current->egid == egid) || - (current->sgid == egid) || - suser()) - current->egid = egid; - else - return(-EPERM); - } - return 0; -} - -int sys_setgid(int gid) -{ - return(sys_setregid(gid, gid)); -} - -int sys_acct() -{ - return -ENOSYS; -} - -int sys_phys() -{ - return -ENOSYS; -} - -int sys_lock() -{ - return -ENOSYS; -} - -int sys_mpx() -{ - return -ENOSYS; -} - -int sys_ulimit() -{ - return -ENOSYS; -} - -int sys_time(long * tloc) -{ - int i; - - i = CURRENT_TIME; - if (tloc) { - verify_area(tloc,4); - put_fs_long(i,(unsigned long *)tloc); - } - return i; -} - -/* - * Unprivileged users may change the real user id to the effective uid - * or vice versa. - */ -int sys_setreuid(int ruid, int euid) -{ - int old_ruid = current->uid; - - if (ruid>0) { - if ((current->euid==ruid) || - (old_ruid == ruid) || - suser()) - current->uid = ruid; - else - return(-EPERM); - } - if (euid>0) { - if ((old_ruid == euid) || - (current->euid == euid) || - suser()) - current->euid = euid; - else { - current->uid = old_ruid; - return(-EPERM); - } - } - return 0; -} - -int sys_setuid(int uid) -{ - return(sys_setreuid(uid, uid)); -} - -int sys_stime(long * tptr) -{ - if (!suser()) - return -EPERM; - startup_time = get_fs_long((unsigned long *)tptr) - jiffies/HZ; - return 0; -} - -int sys_times(struct tms * tbuf) -{ - if (tbuf) { - verify_area(tbuf,sizeof *tbuf); - put_fs_long(current->utime,(unsigned long *)&tbuf->tms_utime); - put_fs_long(current->stime,(unsigned long *)&tbuf->tms_stime); - put_fs_long(current->cutime,(unsigned long *)&tbuf->tms_cutime); - put_fs_long(current->cstime,(unsigned long *)&tbuf->tms_cstime); - } - return jiffies; -} - -int sys_brk(unsigned long end_data_seg) -{ - if (end_data_seg >= current->end_code && - end_data_seg < current->start_stack - 16384) - current->brk = end_data_seg; - return current->brk; -} - -/* - * This needs some heave checking ... - * I just haven't get the stomach for it. I also don't fully - * understand sessions/pgrp etc. Let somebody who does explain it. - */ -int sys_setpgid(int pid, int pgid) -{ - int i; - - if (!pid) - pid = current->pid; - if (!pgid) - pgid = current->pid; - for (i=0 ; ipid==pid) { - if (task[i]->leader) - return -EPERM; - if (task[i]->session != current->session) - return -EPERM; - task[i]->pgrp = pgid; - return 0; - } - return -ESRCH; -} - -int sys_getpgrp(void) -{ - return current->pgrp; -} - -int sys_setsid(void) -{ - if (current->leader && !suser()) - return -EPERM; - current->leader = 1; - current->session = current->pgrp = current->pid; - current->tty = -1; - return current->pgrp; -} - -int sys_uname(struct utsname * name) -{ - static struct utsname thisname = { - "linux .0","nodename","release ","version ","machine " - }; - int i; - - if (!name) return -ERROR; - verify_area(name,sizeof *name); - for(i=0;iumask; - - current->umask = mask & 0777; - return (old); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/system_call.s b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/system_call.s deleted file mode 100644 index c96826c..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/system_call.s +++ /dev/null @@ -1,285 +0,0 @@ -/* - * linux/kernel/system_call.s - * - * (C) 1991 Linus Torvalds - */ - -/* - * system_call.s contains the system-call low-level handling routines. - * This also contains the timer-interrupt handler, as some of the code is - * the same. The hd- and flopppy-interrupts are also here. - * - * NOTE: This code handles signal-recognition, which happens every time - * after a timer-interrupt and after each system call. Ordinary interrupts - * don't handle signal-recognition, as that would clutter them up totally - * unnecessarily. - * - * Stack layout in 'ret_from_system_call': - * - * 0(%esp) - %eax - * 4(%esp) - %ebx - * 8(%esp) - %ecx - * C(%esp) - %edx - * 10(%esp) - %fs - * 14(%esp) - %es - * 18(%esp) - %ds - * 1C(%esp) - %eip - * 20(%esp) - %cs - * 24(%esp) - %eflags - * 28(%esp) - %oldesp - * 2C(%esp) - %oldss - */ - -SIG_CHLD = 17 - -EAX = 0x00 -EBX = 0x04 -ECX = 0x08 -EDX = 0x0C -FS = 0x10 -ES = 0x14 -DS = 0x18 -EIP = 0x1C -CS = 0x20 -EFLAGS = 0x24 -OLDESP = 0x28 -OLDSS = 0x2C - -state = 0 # these are offsets into the task-struct. -counter = 4 -priority = 8 -signal = 12 -sigaction = 16 # MUST be 16 (=len of sigaction) -blocked = (33*16) - -# offsets within sigaction -sa_handler = 0 -sa_mask = 4 -sa_flags = 8 -sa_restorer = 12 - -nr_system_calls = 72 - -/* - * Ok, I get parallel printer interrupts while using the floppy for some - * strange reason. Urgel. Now I just ignore them. - */ -.globl _system_call,_sys_fork,_timer_interrupt,_sys_execve -.globl _hd_interrupt,_floppy_interrupt,_parallel_interrupt -.globl _device_not_available, _coprocessor_error - -.align 2 -bad_sys_call: - movl $-1,%eax - iret -.align 2 -reschedule: - pushl $ret_from_sys_call - jmp _schedule -.align 2 -_system_call: - cmpl $nr_system_calls-1,%eax - ja bad_sys_call - push %ds - push %es - push %fs - pushl %edx - pushl %ecx # push %ebx,%ecx,%edx as parameters - pushl %ebx # to the system call - movl $0x10,%edx # set up ds,es to kernel space - mov %dx,%ds - mov %dx,%es - movl $0x17,%edx # fs points to local data space - mov %dx,%fs - call _sys_call_table(,%eax,4) - pushl %eax - movl _current,%eax - cmpl $0,state(%eax) # state - jne reschedule - cmpl $0,counter(%eax) # counter - je reschedule -ret_from_sys_call: - movl _current,%eax # task[0] cannot have signals - cmpl _task,%eax - je 3f - cmpw $0x0f,CS(%esp) # was old code segment supervisor ? - jne 3f - cmpw $0x17,OLDSS(%esp) # was stack segment = 0x17 ? - jne 3f - movl signal(%eax),%ebx - movl blocked(%eax),%ecx - notl %ecx - andl %ebx,%ecx - bsfl %ecx,%ecx - je 3f - btrl %ecx,%ebx - movl %ebx,signal(%eax) - incl %ecx - pushl %ecx - call _do_signal - popl %eax -3: popl %eax - popl %ebx - popl %ecx - popl %edx - pop %fs - pop %es - pop %ds - iret - -.align 2 -_coprocessor_error: - push %ds - push %es - push %fs - pushl %edx - pushl %ecx - pushl %ebx - pushl %eax - movl $0x10,%eax - mov %ax,%ds - mov %ax,%es - movl $0x17,%eax - mov %ax,%fs - pushl $ret_from_sys_call - jmp _math_error - -.align 2 -_device_not_available: - push %ds - push %es - push %fs - pushl %edx - pushl %ecx - pushl %ebx - pushl %eax - movl $0x10,%eax - mov %ax,%ds - mov %ax,%es - movl $0x17,%eax - mov %ax,%fs - pushl $ret_from_sys_call - clts # clear TS so that we can use math - movl %cr0,%eax - testl $0x4,%eax # EM (math emulation bit) - je _math_state_restore - pushl %ebp - pushl %esi - pushl %edi - call _math_emulate - popl %edi - popl %esi - popl %ebp - ret - -.align 2 -_timer_interrupt: - push %ds # save ds,es and put kernel data space - push %es # into them. %fs is used by _system_call - push %fs - pushl %edx # we save %eax,%ecx,%edx as gcc doesn't - pushl %ecx # save those across function calls. %ebx - pushl %ebx # is saved as we use that in ret_sys_call - pushl %eax - movl $0x10,%eax - mov %ax,%ds - mov %ax,%es - movl $0x17,%eax - mov %ax,%fs - incl _jiffies - movb $0x20,%al # EOI to interrupt controller #1 - outb %al,$0x20 - movl CS(%esp),%eax - andl $3,%eax # %eax is CPL (0 or 3, 0=supervisor) - pushl %eax - call _do_timer # 'do_timer(long CPL)' does everything from - addl $4,%esp # task switching to accounting ... - jmp ret_from_sys_call - -.align 2 -_sys_execve: - lea EIP(%esp),%eax - pushl %eax - call _do_execve - addl $4,%esp - ret - -.align 2 -_sys_fork: - call _find_empty_process - testl %eax,%eax - js 1f - push %gs - pushl %esi - pushl %edi - pushl %ebp - pushl %eax - call _copy_process - addl $20,%esp -1: ret - -_hd_interrupt: - pushl %eax - pushl %ecx - pushl %edx - push %ds - push %es - push %fs - movl $0x10,%eax - mov %ax,%ds - mov %ax,%es - movl $0x17,%eax - mov %ax,%fs - movb $0x20,%al - outb %al,$0xA0 # EOI to interrupt controller #1 - jmp 1f # give port chance to breathe -1: jmp 1f -1: xorl %edx,%edx - xchgl _do_hd,%edx - testl %edx,%edx - jne 1f - movl $_unexpected_hd_interrupt,%edx -1: outb %al,$0x20 - call *%edx # "interesting" way of handling intr. - pop %fs - pop %es - pop %ds - popl %edx - popl %ecx - popl %eax - iret - -_floppy_interrupt: - pushl %eax - pushl %ecx - pushl %edx - push %ds - push %es - push %fs - movl $0x10,%eax - mov %ax,%ds - mov %ax,%es - movl $0x17,%eax - mov %ax,%fs - movb $0x20,%al - outb %al,$0x20 # EOI to interrupt controller #1 - xorl %eax,%eax - xchgl _do_floppy,%eax - testl %eax,%eax - jne 1f - movl $_unexpected_floppy_interrupt,%eax -1: call *%eax # "interesting" way of handling intr. - pop %fs - pop %es - pop %ds - popl %edx - popl %ecx - popl %eax - iret - -_parallel_interrupt: - pushl %eax - movb $0x20,%al - outb %al,$0x20 - popl %eax - iret diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/traps.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/traps.c deleted file mode 100644 index 3629a13..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/traps.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * linux/kernel/traps.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * 'Traps.c' handles hardware traps and faults after we have saved some - * state in 'asm.s'. Currently mostly a debugging-aid, will be extended - * to mainly kill the offending process (probably by giving it a signal, - * but possibly by killing it outright if necessary). - */ -#include - -#include -#include -#include -#include -#include -#include - -#define get_seg_byte(seg,addr) ({ \ -register char __res; \ -__asm__("push %%fs;mov %%ax,%%fs;movb %%fs:%2,%%al;pop %%fs" \ - :"=a" (__res):"0" (seg),"m" (*(addr))); \ -__res;}) - -#define get_seg_long(seg,addr) ({ \ -register unsigned long __res; \ -__asm__("push %%fs;mov %%ax,%%fs;movl %%fs:%2,%%eax;pop %%fs" \ - :"=a" (__res):"0" (seg),"m" (*(addr))); \ -__res;}) - -#define _fs() ({ \ -register unsigned short __res; \ -__asm__("mov %%fs,%%ax":"=a" (__res):); \ -__res;}) - -int do_exit(long code); - -void page_exception(void); - -void divide_error(void); -void debug(void); -void nmi(void); -void int3(void); -void overflow(void); -void bounds(void); -void invalid_op(void); -void device_not_available(void); -void double_fault(void); -void coprocessor_segment_overrun(void); -void invalid_TSS(void); -void segment_not_present(void); -void stack_segment(void); -void general_protection(void); -void page_fault(void); -void coprocessor_error(void); -void reserved(void); -void parallel_interrupt(void); -void irq13(void); - -static void die(char * str,long esp_ptr,long nr) -{ - long * esp = (long *) esp_ptr; - int i; - - printk("%s: %04x\n\r",str,nr&0xffff); - printk("EIP:\t%04x:%p\nEFLAGS:\t%p\nESP:\t%04x:%p\n", - esp[1],esp[0],esp[2],esp[4],esp[3]); - printk("fs: %04x\n",_fs()); - printk("base: %p, limit: %p\n",get_base(current->ldt[1]),get_limit(0x17)); - if (esp[4] == 0x17) { - printk("Stack: "); - for (i=0;i<4;i++) - printk("%p ",get_seg_long(0x17,i+(long *)esp[3])); - printk("\n"); - } - str(i); - printk("Pid: %d, process nr: %d\n\r",current->pid,0xffff & i); - for(i=0;i<10;i++) - printk("%02x ",0xff & get_seg_byte(esp[1],(i+(char *)esp[0]))); - printk("\n\r"); - do_exit(11); /* play segment exception */ -} - -void do_double_fault(long esp, long error_code) -{ - die("double fault",esp,error_code); -} - -void do_general_protection(long esp, long error_code) -{ - die("general protection",esp,error_code); -} - -void do_divide_error(long esp, long error_code) -{ - die("divide error",esp,error_code); -} - -void do_int3(long * esp, long error_code, - long fs,long es,long ds, - long ebp,long esi,long edi, - long edx,long ecx,long ebx,long eax) -{ - int tr; - - __asm__("str %%ax":"=a" (tr):"0" (0)); - printk("eax\t\tebx\t\tecx\t\tedx\n\r%8x\t%8x\t%8x\t%8x\n\r", - eax,ebx,ecx,edx); - printk("esi\t\tedi\t\tebp\t\tesp\n\r%8x\t%8x\t%8x\t%8x\n\r", - esi,edi,ebp,(long) esp); - printk("\n\rds\tes\tfs\ttr\n\r%4x\t%4x\t%4x\t%4x\n\r", - ds,es,fs,tr); - printk("EIP: %8x CS: %4x EFLAGS: %8x\n\r",esp[0],esp[1],esp[2]); -} - -void do_nmi(long esp, long error_code) -{ - die("nmi",esp,error_code); -} - -void do_debug(long esp, long error_code) -{ - die("debug",esp,error_code); -} - -void do_overflow(long esp, long error_code) -{ - die("overflow",esp,error_code); -} - -void do_bounds(long esp, long error_code) -{ - die("bounds",esp,error_code); -} - -void do_invalid_op(long esp, long error_code) -{ - die("invalid operand",esp,error_code); -} - -void do_device_not_available(long esp, long error_code) -{ - die("device not available",esp,error_code); -} - -void do_coprocessor_segment_overrun(long esp, long error_code) -{ - die("coprocessor segment overrun",esp,error_code); -} - -void do_invalid_TSS(long esp,long error_code) -{ - die("invalid TSS",esp,error_code); -} - -void do_segment_not_present(long esp,long error_code) -{ - die("segment not present",esp,error_code); -} - -void do_stack_segment(long esp,long error_code) -{ - die("stack segment",esp,error_code); -} - -void do_coprocessor_error(long esp, long error_code) -{ - if (last_task_used_math != current) - return; - die("coprocessor error",esp,error_code); -} - -void do_reserved(long esp, long error_code) -{ - die("reserved (15,17-47) error",esp,error_code); -} - -void trap_init(void) -{ - int i; - - set_trap_gate(0,÷_error); - set_trap_gate(1,&debug); - set_trap_gate(2,&nmi); - set_system_gate(3,&int3); /* int3-5 can be called from all */ - set_system_gate(4,&overflow); - set_system_gate(5,&bounds); - set_trap_gate(6,&invalid_op); - set_trap_gate(7,&device_not_available); - set_trap_gate(8,&double_fault); - set_trap_gate(9,&coprocessor_segment_overrun); - set_trap_gate(10,&invalid_TSS); - set_trap_gate(11,&segment_not_present); - set_trap_gate(12,&stack_segment); - set_trap_gate(13,&general_protection); - set_trap_gate(14,&page_fault); - set_trap_gate(15,&reserved); - set_trap_gate(16,&coprocessor_error); - for (i=17;i<48;i++) - set_trap_gate(i,&reserved); - set_trap_gate(45,&irq13); - outb_p(inb_p(0x21)&0xfb,0x21); - outb(inb_p(0xA1)&0xdf,0xA1); - set_trap_gate(39,¶llel_interrupt); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/traps.s b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/traps.s deleted file mode 100644 index 283c7a7..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/traps.s +++ /dev/null @@ -1,631 +0,0 @@ - .file "traps.c" - .text -LC0: - .ascii "%s: %04x\12\15\0" - .align 32 -LC1: - .ascii "EIP:\11%04x:%p\12EFLAGS:\11%p\12ESP:\11%04x:%p\12\0" -LC2: - .ascii "fs: %04x\12\0" -LC3: - .ascii "base: %p, limit: %p\12\0" -LC7: - .ascii "Pid: %d, process nr: %d\12\15\0" -LC8: - .ascii "%02x \0" -LC9: - .ascii "\12\15\0" -LC4: - .ascii "Stack: \0" -LC5: - .ascii "%p \0" -LC6: - .ascii "\12\0" - .p2align 2,,3 - .def _die; .scl 3; .type 32; .endef -_die: - pushl %edi - pushl %esi - pushl %ebx - movl 20(%esp), %esi - pushl %ebx - movzwl 28(%esp), %eax - pushl %eax - pushl 24(%esp) - pushl $LC0 - call _printk - popl %edx - popl %ecx - pushl 12(%esi) - pushl 16(%esi) - pushl 8(%esi) - pushl (%esi) - pushl 4(%esi) - pushl $LC1 - call _printk -/APP - mov %fs,%ax -/NO_APP - addl $24, %esp - movzwl %ax, %eax - pushl %eax - pushl $LC2 - call _printk - addl $12, %esp - movl $23, %edx - movl _current, %eax -/APP - lsll %edx,%ecx - incl %ecx -/NO_APP - addl $728, %eax -/APP - movb 7(%eax),%dh - movb 4(%eax),%dl - shll $16,%edx - movw 2(%eax),%dx -/NO_APP - pushl %ecx - pushl %edx - pushl $LC3 - call _printk - addl $16, %esp - cmpl $23, 16(%esi) - je L18 -L3: - xorl %edx, %edx - movl %edx, %eax -/APP - str %ax - subl $32,%eax - shrl $4,%eax -/NO_APP - movl %eax, %ebx - pushl %eax - movzwl %bx,%eax - pushl %eax - movl _current, %eax - pushl 556(%eax) - pushl $LC7 - call _printk - xorl %ebx, %ebx - addl $16, %esp - .p2align 2,,3 -L13: - movl 4(%esi), %eax - movl (%esi), %edx -/APP - push %fs;mov %ax,%fs;movb %fs:(%ebx,%edx),%al;pop %fs -/NO_APP - subl $8, %esp - movzbl %al, %eax - pushl %eax - pushl $LC8 - incl %ebx - call _printk - addl $16, %esp - cmpl $9, %ebx - jle L13 - subl $12, %esp - pushl $LC9 - call _printk - addl $16, %esp - movl $11, 16(%esp) - popl %ebx - popl %esi - popl %edi - jmp _do_exit -L18: - subl $12, %esp - pushl $LC4 - call _printk - xorl %ebx, %ebx - addl $16, %esp - movl $23, %edi -L8: - subl $8, %esp - movl 12(%esi), %edx - movl %edi, %eax -/APP - push %fs;mov %ax,%fs;movl %fs:(%edx,%ebx,4),%eax;pop %fs -/NO_APP - pushl %eax - pushl $LC5 - incl %ebx - call _printk - addl $16, %esp - cmpl $3, %ebx - jle L8 - subl $12, %esp - pushl $LC6 - call _printk - addl $16, %esp - jmp L3 -LC10: - .ascii "double fault\0" - .p2align 2,,3 -.globl _do_double_fault - .def _do_double_fault; .scl 2; .type 32; .endef -_do_double_fault: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC10 - call _die - addl $28, %esp - ret -LC11: - .ascii "general protection\0" - .p2align 2,,3 -.globl _do_general_protection - .def _do_general_protection; .scl 2; .type 32; .endef -_do_general_protection: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC11 - call _die - addl $28, %esp - ret -LC12: - .ascii "divide error\0" - .p2align 2,,3 -.globl _do_divide_error - .def _do_divide_error; .scl 2; .type 32; .endef -_do_divide_error: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC12 - call _die - addl $28, %esp - ret - .align 32 -LC13: - .ascii "eax\11\11ebx\11\11ecx\11\11edx\12\15%8x\11%8x\11%8x\11%8x\12\15\0" - .align 32 -LC14: - .ascii "esi\11\11edi\11\11ebp\11\11esp\12\15%8x\11%8x\11%8x\11%8x\12\15\0" - .align 32 -LC15: - .ascii "\12\15ds\11es\11fs\11tr\12\15%4x\11%4x\11%4x\11%4x\12\15\0" - .align 32 -LC16: - .ascii "EIP: %8x CS: %4x EFLAGS: %8x\12\15\0" - .p2align 2,,3 -.globl _do_int3 - .def _do_int3; .scl 2; .type 32; .endef -_do_int3: - pushl %ebp - pushl %edi - pushl %esi - pushl %ebx - subl $40, %esp - movl 68(%esp), %eax - movl %eax, 36(%esp) - movl 72(%esp), %eax - movl %eax, 32(%esp) - movl 76(%esp), %eax - movl %eax, 28(%esp) - movl 84(%esp), %eax - movl 60(%esp), %esi - movl 80(%esp), %ebp - movl 88(%esp), %edi - movl %eax, 24(%esp) - pushl 92(%esp) - pushl 100(%esp) - pushl 108(%esp) - pushl 116(%esp) - xorl %ebx, %ebx - movl %ebx, %eax - pushl $LC13 -/APP - str %ax -/NO_APP - movl %eax, %ebx - call _printk - addl $20, %esp - pushl %esi - pushl %ebp - pushl %edi - pushl 36(%esp) - pushl $LC14 - call _printk - addl $20, %esp - pushl %ebx - pushl 40(%esp) - pushl 40(%esp) - pushl 40(%esp) - pushl $LC15 - call _printk - movl 8(%esi), %eax - movl %eax, 92(%esp) - movl 4(%esi), %eax - movl %eax, 88(%esp) - movl (%esi), %eax - movl %eax, 84(%esp) - movl $LC16, 80(%esp) - addl $60, %esp - popl %ebx - popl %esi - popl %edi - popl %ebp - jmp _printk -LC17: - .ascii "nmi\0" - .p2align 2,,3 -.globl _do_nmi - .def _do_nmi; .scl 2; .type 32; .endef -_do_nmi: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC17 - call _die - addl $28, %esp - ret -LC18: - .ascii "debug\0" - .p2align 2,,3 -.globl _do_debug - .def _do_debug; .scl 2; .type 32; .endef -_do_debug: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC18 - call _die - addl $28, %esp - ret -LC19: - .ascii "overflow\0" - .p2align 2,,3 -.globl _do_overflow - .def _do_overflow; .scl 2; .type 32; .endef -_do_overflow: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC19 - call _die - addl $28, %esp - ret -LC20: - .ascii "bounds\0" - .p2align 2,,3 -.globl _do_bounds - .def _do_bounds; .scl 2; .type 32; .endef -_do_bounds: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC20 - call _die - addl $28, %esp - ret -LC21: - .ascii "invalid operand\0" - .p2align 2,,3 -.globl _do_invalid_op - .def _do_invalid_op; .scl 2; .type 32; .endef -_do_invalid_op: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC21 - call _die - addl $28, %esp - ret -LC22: - .ascii "device not available\0" - .p2align 2,,3 -.globl _do_device_not_available - .def _do_device_not_available; .scl 2; .type 32; .endef -_do_device_not_available: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC22 - call _die - addl $28, %esp - ret -LC23: - .ascii "coprocessor segment overrun\0" - .p2align 2,,3 -.globl _do_coprocessor_segment_overrun - .def _do_coprocessor_segment_overrun; .scl 2; .type 32; .endef -_do_coprocessor_segment_overrun: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC23 - call _die - addl $28, %esp - ret -LC24: - .ascii "invalid TSS\0" - .p2align 2,,3 -.globl _do_invalid_TSS - .def _do_invalid_TSS; .scl 2; .type 32; .endef -_do_invalid_TSS: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC24 - call _die - addl $28, %esp - ret -LC25: - .ascii "segment not present\0" - .p2align 2,,3 -.globl _do_segment_not_present - .def _do_segment_not_present; .scl 2; .type 32; .endef -_do_segment_not_present: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC25 - call _die - addl $28, %esp - ret -LC26: - .ascii "stack segment\0" - .p2align 2,,3 -.globl _do_stack_segment - .def _do_stack_segment; .scl 2; .type 32; .endef -_do_stack_segment: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC26 - call _die - addl $28, %esp - ret -LC27: - .ascii "coprocessor error\0" - .p2align 2,,3 -.globl _do_coprocessor_error - .def _do_coprocessor_error; .scl 2; .type 32; .endef -_do_coprocessor_error: - subl $12, %esp - movl _current, %eax - cmpl %eax, _last_task_used_math - je L35 -L33: - addl $12, %esp - ret - .p2align 2,,3 -L35: - pushl %eax - pushl 24(%esp) - pushl 24(%esp) - pushl $LC27 - call _die - addl $16, %esp - jmp L33 -LC28: - .ascii "reserved (15,17-47) error\0" - .p2align 2,,3 -.globl _do_reserved - .def _do_reserved; .scl 2; .type 32; .endef -_do_reserved: - subl $16, %esp - pushl 24(%esp) - pushl 24(%esp) - pushl $LC28 - call _die - addl $28, %esp - ret - .p2align 2,,3 -.globl _trap_init - .def _trap_init; .scl 2; .type 32; .endef -_trap_init: - pushl %ebp - pushl %edi - pushl %esi - pushl %ebx - movl $_divide_error, %edx - movl $524288, %eax -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt - movl %edx,_idt+4 -/NO_APP - movl $_debug, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+8 - movl %edx,_idt+12 -/NO_APP - movl $_nmi, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+16 - movl %edx,_idt+20 -/NO_APP - movl $_int3, %edx -/APP - movw %dx,%ax - movw $-4352,%dx - movl %eax,_idt+24 - movl %edx,_idt+28 -/NO_APP - movl $_overflow, %edx -/APP - movw %dx,%ax - movw $-4352,%dx - movl %eax,_idt+32 - movl %edx,_idt+36 -/NO_APP - movl $_bounds, %edx -/APP - movw %dx,%ax - movw $-4352,%dx - movl %eax,_idt+40 - movl %edx,_idt+44 -/NO_APP - movl $_invalid_op, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+48 - movl %edx,_idt+52 -/NO_APP - movl $_device_not_available, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+56 - movl %edx,_idt+60 -/NO_APP - movl $_double_fault, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+64 - movl %edx,_idt+68 -/NO_APP - movl $_coprocessor_segment_overrun, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+72 - movl %edx,_idt+76 -/NO_APP - movl $_invalid_TSS, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+80 - movl %edx,_idt+84 -/NO_APP - movl $_segment_not_present, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+88 - movl %edx,_idt+92 -/NO_APP - movl $_stack_segment, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+96 - movl %edx,_idt+100 -/NO_APP - movl $_general_protection, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+104 - movl %edx,_idt+108 -/NO_APP - movl $_page_fault, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+112 - movl %edx,_idt+116 -/NO_APP - movl $_reserved, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+120 - movl %edx,_idt+124 -/NO_APP - movl $_coprocessor_error, %edx -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+128 - movl %edx,_idt+132 -/NO_APP - movl $17, %edi - movl $_idt, %esi - movl $_idt+4, %ebx - movl $_reserved, %ecx - movl $524288, %ebp - .p2align 2,,3 -L42: - movl %ecx, %edx - movl %ebp, %eax -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,(%esi,%edi,8) - movl %edx,(%ebx,%edi,8) -/NO_APP - incl %edi - cmpl $47, %edi - jle L42 - movl $_irq13, %edx - movl $524288, %eax -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+360 - movl %edx,_idt+364 -/NO_APP - movl $33, %edx -/APP - inb %dx,%al - jmp 1f -1: jmp 1f -1: -/NO_APP - andl $251, %eax -/APP - outb %al,%dx - jmp 1f -1: jmp 1f -1: -/NO_APP - movl $161, %edx -/APP - inb %dx,%al - jmp 1f -1: jmp 1f -1: -/NO_APP - andl $223, %eax -/APP - outb %al,%dx -/NO_APP - movl $_parallel_interrupt, %edx - movl $524288, %eax -/APP - movw %dx,%ax - movw $-28928,%dx - movl %eax,_idt+312 - movl %edx,_idt+316 -/NO_APP - popl %ebx - popl %esi - popl %edi - popl %ebp - ret - .def _parallel_interrupt; .scl 2; .type 32; .endef - .def _irq13; .scl 2; .type 32; .endef - .def _coprocessor_error; .scl 2; .type 32; .endef - .def _reserved; .scl 2; .type 32; .endef - .def _page_fault; .scl 2; .type 32; .endef - .def _general_protection; .scl 2; .type 32; .endef - .def _stack_segment; .scl 2; .type 32; .endef - .def _segment_not_present; .scl 2; .type 32; .endef - .def _invalid_TSS; .scl 2; .type 32; .endef - .def _coprocessor_segment_overrun; .scl 2; .type 32; .endef - .def _double_fault; .scl 2; .type 32; .endef - .def _device_not_available; .scl 2; .type 32; .endef - .def _invalid_op; .scl 2; .type 32; .endef - .def _bounds; .scl 2; .type 32; .endef - .def _overflow; .scl 2; .type 32; .endef - .def _int3; .scl 2; .type 32; .endef - .def _nmi; .scl 2; .type 32; .endef - .def _debug; .scl 2; .type 32; .endef - .def _divide_error; .scl 2; .type 32; .endef - .def _do_exit; .scl 2; .type 32; .endef - .def _printk; .scl 2; .type 32; .endef diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/vsprintf.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/vsprintf.c deleted file mode 100644 index ab70f23..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/kernel/vsprintf.c +++ /dev/null @@ -1,235 +0,0 @@ -/* - * linux/kernel/vsprintf.c - * - * (C) 1991 Linus Torvalds - */ - -/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ -/* - * Wirzenius wrote this portably, Torvalds fucked it up :-) - */ - -#include -#include - -/* we use this so that we can do without the ctype library */ -#define is_digit(c) ((c) >= '0' && (c) <= '9') - -static int skip_atoi(const char **s) -{ - int i=0; - - while (is_digit(**s)) - i = i*10 + *((*s)++) - '0'; - return i; -} - -#define ZEROPAD 1 /* pad with zero */ -#define SIGN 2 /* unsigned/signed long */ -#define PLUS 4 /* show plus */ -#define SPACE 8 /* space if plus */ -#define LEFT 16 /* left justified */ -#define SPECIAL 32 /* 0x */ -#define SMALL 64 /* use 'abcdef' instead of 'ABCDEF' */ - -#define do_div(n,base) ({ \ -int __res; \ -__asm__("divl %4":"=a" (n),"=d" (__res):"0" (n),"1" (0),"r" (base)); \ -__res; }) - -static char * number(char * str, int num, int base, int size, int precision - ,int type) -{ - char c,sign,tmp[36]; - const char *digits="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - int i; - - if (type&SMALL) digits="0123456789abcdefghijklmnopqrstuvwxyz"; - if (type&LEFT) type &= ~ZEROPAD; - if (base<2 || base>36) - return 0; - c = (type & ZEROPAD) ? '0' : ' ' ; - if (type&SIGN && num<0) { - sign='-'; - num = -num; - } else - sign=(type&PLUS) ? '+' : ((type&SPACE) ? ' ' : 0); - if (sign) size--; - if (type&SPECIAL) { - if (base==16) size -= 2; - else if (base==8) size--; - } - i=0; - if (num==0) - tmp[i++]='0'; - else while (num!=0) - tmp[i++]=digits[do_div(num,base)]; - if (i>precision) precision=i; - size -= precision; - if (!(type&(ZEROPAD+LEFT))) - while(size-->0) - *str++ = ' '; - if (sign) - *str++ = sign; - if (type&SPECIAL) { - if (base==8) - *str++ = '0'; - else if (base==16) { - *str++ = '0'; - *str++ = digits[33]; - } - } - if (!(type&LEFT)) - while(size-->0) - *str++ = c; - while(i0) - *str++ = tmp[i]; - while(size-->0) - *str++ = ' '; - return str; -} - -int vsprintf(char *buf, const char *fmt, va_list args) -{ - int len; - int i; - char * str; - char *s; - int *ip; - - int flags; /* flags to number() */ - - int field_width; /* width of output field */ - int precision; /* min. # of digits for integers; max - number of chars for from string */ - int qualifier; /* 'h', 'l', or 'L' for integer fields */ - - for (str=buf ; *fmt ; ++fmt) { - if (*fmt != '%') { - *str++ = *fmt; - continue; - } - - /* process flags */ - flags = 0; - repeat: - ++fmt; /* this also skips first '%' */ - switch (*fmt) { - case '-': flags |= LEFT; goto repeat; - case '+': flags |= PLUS; goto repeat; - case ' ': flags |= SPACE; goto repeat; - case '#': flags |= SPECIAL; goto repeat; - case '0': flags |= ZEROPAD; goto repeat; - } - - /* get field width */ - field_width = -1; - if (is_digit(*fmt)) - field_width = skip_atoi(&fmt); - else if (*fmt == '*') { - /* it's the next argument */ - field_width = va_arg(args, int); - if (field_width < 0) { - field_width = -field_width; - flags |= LEFT; - } - } - - /* get the precision */ - precision = -1; - if (*fmt == '.') { - ++fmt; - if (is_digit(*fmt)) - precision = skip_atoi(&fmt); - else if (*fmt == '*') { - /* it's the next argument */ - precision = va_arg(args, int); - } - if (precision < 0) - precision = 0; - } - - /* get the conversion qualifier */ - qualifier = -1; - if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L') { - qualifier = *fmt; - ++fmt; - } - - switch (*fmt) { - case 'c': - if (!(flags & LEFT)) - while (--field_width > 0) - *str++ = ' '; - *str++ = (unsigned char) va_arg(args, int); - while (--field_width > 0) - *str++ = ' '; - break; - - case 's': - s = va_arg(args, char *); - len = strlen(s); - if (precision < 0) - precision = len; - else if (len > precision) - len = precision; - - if (!(flags & LEFT)) - while (len < field_width--) - *str++ = ' '; - for (i = 0; i < len; ++i) - *str++ = *s++; - while (len < field_width--) - *str++ = ' '; - break; - - case 'o': - str = number(str, va_arg(args, unsigned long), 8, - field_width, precision, flags); - break; - - case 'p': - if (field_width == -1) { - field_width = 8; - flags |= ZEROPAD; - } - str = number(str, - (unsigned long) va_arg(args, void *), 16, - field_width, precision, flags); - break; - - case 'x': - flags |= SMALL; - case 'X': - str = number(str, va_arg(args, unsigned long), 16, - field_width, precision, flags); - break; - - case 'd': - case 'i': - flags |= SIGN; - case 'u': - str = number(str, va_arg(args, unsigned long), 10, - field_width, precision, flags); - break; - - case 'n': - ip = va_arg(args, int *); - *ip = (str - buf); - break; - - default: - if (*fmt != '%') - *str++ = '%'; - if (*fmt) - *str++ = *fmt; - else - --fmt; - break; - } - } - *str = '\0'; - return str-buf; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/Makefile b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/Makefile deleted file mode 100644 index 8916215..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/Makefile +++ /dev/null @@ -1,73 +0,0 @@ -# -# Makefile for some libs needed in the kernel. -# -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# - -AR =ar -AS =as -LD =ld -LDFLAGS =-s -x -CC =gcc -mcpu=i386 -CFLAGS =-Wall -O -fstrength-reduce -fomit-frame-pointer \ - -finline-functions -nostdinc -I../include -CPP =gcc -E -nostdinc -I../include - -.c.s: - $(CC) $(CFLAGS) \ - -S -o $*.s $< -.s.o: - $(AS) -o $*.o $< -.c.o: - $(CC) $(CFLAGS) \ - -c -o $*.o $< - -OBJS = ctype.o _exit.o open.o close.o errno.o write.o dup.o setsid.o \ - execve.o wait.o string.o malloc.o - -lib.a: $(OBJS) - $(AR) rcs lib.a $(OBJS) - sync - -clean: - rm -f core *.o *.a tmp_make - for i in *.c;do rm -f `basename $$i .c`.s;done - -dep: - sed '/\#\#\# Dependencies/q' < Makefile > tmp_make - (for i in *.c;do echo -n `echo $$i | sed 's,\.c,\.s,'`" "; \ - $(CPP) -M $$i;done) >> tmp_make - cp tmp_make Makefile - -### Dependencies: -_exit.s _exit.o : _exit.c ../include/unistd.h ../include/sys/stat.h \ - ../include/sys/types.h ../include/sys/times.h ../include/sys/utsname.h \ - ../include/utime.h -close.s close.o : close.c ../include/unistd.h ../include/sys/stat.h \ - ../include/sys/types.h ../include/sys/times.h ../include/sys/utsname.h \ - ../include/utime.h -ctype.s ctype.o : ctype.c ../include/ctype.h -dup.s dup.o : dup.c ../include/unistd.h ../include/sys/stat.h \ - ../include/sys/types.h ../include/sys/times.h ../include/sys/utsname.h \ - ../include/utime.h -errno.s errno.o : errno.c -execve.s execve.o : execve.c ../include/unistd.h ../include/sys/stat.h \ - ../include/sys/types.h ../include/sys/times.h ../include/sys/utsname.h \ - ../include/utime.h -malloc.s malloc.o : malloc.c ../include/linux/kernel.h ../include/linux/mm.h \ - ../include/asm/system.h -open.s open.o : open.c ../include/unistd.h ../include/sys/stat.h \ - ../include/sys/types.h ../include/sys/times.h ../include/sys/utsname.h \ - ../include/utime.h ../include/stdarg.h -setsid.s setsid.o : setsid.c ../include/unistd.h ../include/sys/stat.h \ - ../include/sys/types.h ../include/sys/times.h ../include/sys/utsname.h \ - ../include/utime.h -string.s string.o : string.c ../include/string.h -wait.s wait.o : wait.c ../include/unistd.h ../include/sys/stat.h \ - ../include/sys/types.h ../include/sys/times.h ../include/sys/utsname.h \ - ../include/utime.h ../include/sys/wait.h -write.s write.o : write.c ../include/unistd.h ../include/sys/stat.h \ - ../include/sys/types.h ../include/sys/times.h ../include/sys/utsname.h \ - ../include/utime.h diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/_exit.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/_exit.c deleted file mode 100644 index c0c9d69..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/_exit.c +++ /dev/null @@ -1,13 +0,0 @@ -/* - * linux/lib/_exit.c - * - * (C) 1991 Linus Torvalds - */ - -#define __LIBRARY__ -#include - -volatile void _exit(int exit_code) -{ - __asm__("int $0x80"::"a" (__NR_exit),"b" (exit_code)); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/close.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/close.c deleted file mode 100644 index afd8364..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/close.c +++ /dev/null @@ -1,10 +0,0 @@ -/* - * linux/lib/close.c - * - * (C) 1991 Linus Torvalds - */ - -#define __LIBRARY__ -#include - -_syscall1(int,close,int,fd) diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/ctype.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/ctype.c deleted file mode 100644 index 877e629..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/ctype.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * linux/lib/ctype.c - * - * (C) 1991 Linus Torvalds - */ - -#include - -char _ctmp; -unsigned char _ctype[] = {0x00, /* EOF */ -_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */ -_C,_C|_S,_C|_S,_C|_S,_C|_S,_C|_S,_C,_C, /* 8-15 */ -_C,_C,_C,_C,_C,_C,_C,_C, /* 16-23 */ -_C,_C,_C,_C,_C,_C,_C,_C, /* 24-31 */ -_S|_SP,_P,_P,_P,_P,_P,_P,_P, /* 32-39 */ -_P,_P,_P,_P,_P,_P,_P,_P, /* 40-47 */ -_D,_D,_D,_D,_D,_D,_D,_D, /* 48-55 */ -_D,_D,_P,_P,_P,_P,_P,_P, /* 56-63 */ -_P,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U|_X,_U, /* 64-71 */ -_U,_U,_U,_U,_U,_U,_U,_U, /* 72-79 */ -_U,_U,_U,_U,_U,_U,_U,_U, /* 80-87 */ -_U,_U,_U,_P,_P,_P,_P,_P, /* 88-95 */ -_P,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L|_X,_L, /* 96-103 */ -_L,_L,_L,_L,_L,_L,_L,_L, /* 104-111 */ -_L,_L,_L,_L,_L,_L,_L,_L, /* 112-119 */ -_L,_L,_L,_P,_P,_P,_P,_C, /* 120-127 */ -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 128-143 */ -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 144-159 */ -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 160-175 */ -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 176-191 */ -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 192-207 */ -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 208-223 */ -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 224-239 */ -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* 240-255 */ - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/dup.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/dup.c deleted file mode 100644 index dd13414..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/dup.c +++ /dev/null @@ -1,10 +0,0 @@ -/* - * linux/lib/dup.c - * - * (C) 1991 Linus Torvalds - */ - -#define __LIBRARY__ -#include - -_syscall1(int,dup,int,fd) diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/errno.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/errno.c deleted file mode 100644 index 50aca2e..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/errno.c +++ /dev/null @@ -1,7 +0,0 @@ -/* - * linux/lib/errno.c - * - * (C) 1991 Linus Torvalds - */ - -int errno; diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/execve.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/execve.c deleted file mode 100644 index a89726d..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/execve.c +++ /dev/null @@ -1,10 +0,0 @@ -/* - * linux/lib/execve.c - * - * (C) 1991 Linus Torvalds - */ - -#define __LIBRARY__ -#include - -_syscall3(int,execve,const char *,file,char **,argv,char **,envp) diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/malloc.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/malloc.c deleted file mode 100644 index d48ae06..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/malloc.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * malloc.c --- a general purpose kernel memory allocator for Linux. - * - * Written by Theodore Ts'o (tytso@mit.edu), 11/29/91 - * - * This routine is written to be as fast as possible, so that it - * can be called from the interrupt level. - * - * Limitations: maximum size of memory we can allocate using this routine - * is 4k, the size of a page in Linux. - * - * The general game plan is that each page (called a bucket) will only hold - * objects of a given size. When all of the object on a page are released, - * the page can be returned to the general free pool. When malloc() is - * called, it looks for the smallest bucket size which will fulfill its - * request, and allocate a piece of memory from that bucket pool. - * - * Each bucket has as its control block a bucket descriptor which keeps - * track of how many objects are in use on that page, and the free list - * for that page. Like the buckets themselves, bucket descriptors are - * stored on pages requested from get_free_page(). However, unlike buckets, - * pages devoted to bucket descriptor pages are never released back to the - * system. Fortunately, a system should probably only need 1 or 2 bucket - * descriptor pages, since a page can hold 256 bucket descriptors (which - * corresponds to 1 megabyte worth of bucket pages.) If the kernel is using - * that much allocated memory, it's probably doing something wrong. :-) - * - * Note: malloc() and free() both call get_free_page() and free_page() - * in sections of code where interrupts are turned off, to allow - * malloc() and free() to be safely called from an interrupt routine. - * (We will probably need this functionality when networking code, - * particularily things like NFS, is added to Linux.) However, this - * presumes that get_free_page() and free_page() are interrupt-level - * safe, which they may not be once paging is added. If this is the - * case, we will need to modify malloc() to keep a few unused pages - * "pre-allocated" so that it can safely draw upon those pages if - * it is called from an interrupt routine. - * - * Another concern is that get_free_page() should not sleep; if it - * does, the code is carefully ordered so as to avoid any race - * conditions. The catch is that if malloc() is called re-entrantly, - * there is a chance that unecessary pages will be grabbed from the - * system. Except for the pages for the bucket descriptor page, the - * extra pages will eventually get released back to the system, though, - * so it isn't all that bad. - */ - -#include -#include -#include - -struct bucket_desc { /* 16 bytes */ - void *page; - struct bucket_desc *next; - void *freeptr; - unsigned short refcnt; - unsigned short bucket_size; -}; - -struct _bucket_dir { /* 8 bytes */ - int size; - struct bucket_desc *chain; -}; - -/* - * The following is the where we store a pointer to the first bucket - * descriptor for a given size. - * - * If it turns out that the Linux kernel allocates a lot of objects of a - * specific size, then we may want to add that specific size to this list, - * since that will allow the memory to be allocated more efficiently. - * However, since an entire page must be dedicated to each specific size - * on this list, some amount of temperance must be exercised here. - * - * Note that this list *must* be kept in order. - */ -struct _bucket_dir bucket_dir[] = { - { 16, (struct bucket_desc *) 0}, - { 32, (struct bucket_desc *) 0}, - { 64, (struct bucket_desc *) 0}, - { 128, (struct bucket_desc *) 0}, - { 256, (struct bucket_desc *) 0}, - { 512, (struct bucket_desc *) 0}, - { 1024, (struct bucket_desc *) 0}, - { 2048, (struct bucket_desc *) 0}, - { 4096, (struct bucket_desc *) 0}, - { 0, (struct bucket_desc *) 0}}; /* End of list marker */ - -/* - * This contains a linked list of free bucket descriptor blocks - */ -struct bucket_desc *free_bucket_desc = (struct bucket_desc *) 0; - -/* - * This routine initializes a bucket description page. - */ -static inline void init_bucket_desc() -{ - struct bucket_desc *bdesc, *first; - int i; - - first = bdesc = (struct bucket_desc *) get_free_page(); - if (!bdesc) - panic("Out of memory in init_bucket_desc()"); - for (i = PAGE_SIZE/sizeof(struct bucket_desc); i > 1; i--) { - bdesc->next = bdesc+1; - bdesc++; - } - /* - * This is done last, to avoid race conditions in case - * get_free_page() sleeps and this routine gets called again.... - */ - bdesc->next = free_bucket_desc; - free_bucket_desc = first; -} - -void *malloc(unsigned int len) -{ - struct _bucket_dir *bdir; - struct bucket_desc *bdesc; - void *retval; - - /* - * First we search the bucket_dir to find the right bucket change - * for this request. - */ - for (bdir = bucket_dir; bdir->size; bdir++) - if (bdir->size >= len) - break; - if (!bdir->size) { - printk("malloc called with impossibly large argument (%d)\n", - len); - panic("malloc: bad arg"); - } - /* - * Now we search for a bucket descriptor which has free space - */ - cli(); /* Avoid race conditions */ - for (bdesc = bdir->chain; bdesc; bdesc = bdesc->next) - if (bdesc->freeptr) - break; - /* - * If we didn't find a bucket with free space, then we'll - * allocate a new one. - */ - if (!bdesc) { - char *cp; - int i; - - if (!free_bucket_desc) - init_bucket_desc(); - bdesc = free_bucket_desc; - free_bucket_desc = bdesc->next; - bdesc->refcnt = 0; - bdesc->bucket_size = bdir->size; - bdesc->page = bdesc->freeptr = (void *) cp = get_free_page(); - if (!cp) - panic("Out of memory in kernel malloc()"); - /* Set up the chain of free objects */ - for (i=PAGE_SIZE/bdir->size; i > 1; i--) { - *((char **) cp) = cp + bdir->size; - cp += bdir->size; - } - *((char **) cp) = 0; - bdesc->next = bdir->chain; /* OK, link it in! */ - bdir->chain = bdesc; - } - retval = (void *) bdesc->freeptr; - bdesc->freeptr = *((void **) retval); - bdesc->refcnt++; - sti(); /* OK, we're safe again */ - return(retval); -} - -/* - * Here is the free routine. If you know the size of the object that you - * are freeing, then free_s() will use that information to speed up the - * search for the bucket descriptor. - * - * We will #define a macro so that "free(x)" is becomes "free_s(x, 0)" - */ -void free_s(void *obj, int size) -{ - void *page; - struct _bucket_dir *bdir; - struct bucket_desc *bdesc, *prev; - bdesc = prev = 0; - /* Calculate what page this object lives in */ - page = (void *) ((unsigned long) obj & 0xfffff000); - /* Now search the buckets looking for that page */ - for (bdir = bucket_dir; bdir->size; bdir++) { - prev = 0; - /* If size is zero then this conditional is always false */ - if (bdir->size < size) - continue; - for (bdesc = bdir->chain; bdesc; bdesc = bdesc->next) { - if (bdesc->page == page) - goto found; - prev = bdesc; - } - } - panic("Bad address passed to kernel free_s()"); -found: - cli(); /* To avoid race conditions */ - *((void **)obj) = bdesc->freeptr; - bdesc->freeptr = obj; - bdesc->refcnt--; - if (bdesc->refcnt == 0) { - /* - * We need to make sure that prev is still accurate. It - * may not be, if someone rudely interrupted us.... - */ - if ((prev && (prev->next != bdesc)) || - (!prev && (bdir->chain != bdesc))) - for (prev = bdir->chain; prev; prev = prev->next) - if (prev->next == bdesc) - break; - if (prev) - prev->next = bdesc->next; - else { - if (bdir->chain != bdesc) - panic("malloc bucket chains corrupted"); - bdir->chain = bdesc->next; - } - free_page((unsigned long) bdesc->page); - bdesc->next = free_bucket_desc; - free_bucket_desc = bdesc; - } - sti(); - return; -} - diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/open.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/open.c deleted file mode 100644 index 8c3fc58..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/open.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * linux/lib/open.c - * - * (C) 1991 Linus Torvalds - */ - -#define __LIBRARY__ -#include -#include - -int open(const char * filename, int flag, ...) -{ - register int res; - va_list arg; - - va_start(arg,flag); - __asm__("int $0x80" - :"=a" (res) - :"0" (__NR_open),"b" (filename),"c" (flag), - "d" (va_arg(arg,int))); - if (res>=0) - return res; - errno = -res; - return -1; -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/setsid.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/setsid.c deleted file mode 100644 index 68516c7..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/setsid.c +++ /dev/null @@ -1,10 +0,0 @@ -/* - * linux/lib/setsid.c - * - * (C) 1991 Linus Torvalds - */ - -#define __LIBRARY__ -#include - -_syscall0(pid_t,setsid) diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/string.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/string.c deleted file mode 100644 index 1182e63..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/string.c +++ /dev/null @@ -1,14 +0,0 @@ -/* - * linux/lib/string.c - * - * (C) 1991 Linus Torvalds - */ - -#ifndef __GNUC__ -#error I want gcc! -#endif - -#define extern -#define inline -#define __LIBRARY__ -#include diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/wait.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/wait.c deleted file mode 100644 index 2815c16..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/wait.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * linux/lib/wait.c - * - * (C) 1991 Linus Torvalds - */ - -#define __LIBRARY__ -#include -#include - -_syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) - -pid_t wait(int * wait_stat) -{ - return waitpid(-1,wait_stat,0); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/write.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/write.c deleted file mode 100644 index df52e74..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/lib/write.c +++ /dev/null @@ -1,10 +0,0 @@ -/* - * linux/lib/write.c - * - * (C) 1991 Linus Torvalds - */ - -#define __LIBRARY__ -#include - -_syscall3(int,write,int,fd,const char *,buf,off_t,count) diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/mm/Makefile b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/mm/Makefile deleted file mode 100644 index d53d91d..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/mm/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -CC =gcc -mcpu=i386 -CFLAGS =-Wall -O -fstrength-reduce -fomit-frame-pointer \ - -finline-functions -nostdinc -I../include -AS =as -AR =ar -LD =ld -CPP =gcc -E -nostdinc -I../include - -.c.o: - $(CC) $(CFLAGS) \ - -c -o $*.o $< -.s.o: - $(AS) -o $*.o $< -.c.s: - $(CC) $(CFLAGS) \ - -S -o $*.s $< - -OBJS = memory.o page.o - -all: mm.o - -mm.o: $(OBJS) - $(LD) -r -o mm.o $(OBJS) - -clean: - rm -f core *.o *.a tmp_make - for i in *.c;do rm -f `basename $$i .c`.s;done - -dep: - sed '/\#\#\# Dependencies/q' < Makefile > tmp_make - (for i in *.c;do $(CPP) -M $$i;done) >> tmp_make - cp tmp_make Makefile - -### Dependencies: -memory.o: memory.c ../include/signal.h ../include/sys/types.h \ - ../include/asm/system.h ../include/linux/sched.h \ - ../include/linux/head.h ../include/linux/fs.h ../include/linux/mm.h \ - ../include/linux/kernel.h diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/mm/memory.c b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/mm/memory.c deleted file mode 100644 index 43f601b..0000000 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/mm/memory.c +++ /dev/null @@ -1,431 +0,0 @@ -/* - * linux/mm/memory.c - * - * (C) 1991 Linus Torvalds - */ - -/* - * demand-loading started 01.12.91 - seems it is high on the list of - * things wanted, and it should be easy to implement. - Linus - */ - -/* - * Ok, demand-loading was easy, shared pages a little bit tricker. Shared - * pages started 02.12.91, seems to work. - Linus. - * - * Tested sharing by executing about 30 /bin/sh: under the old kernel it - * would have taken more than the 6M I have free, but it worked well as - * far as I could see. - * - * Also corrected some "invalidate()"s - I wasn't doing enough of them. - */ - -#include - -#include - -#include -#include -#include - -volatile void do_exit(long code); - -static inline volatile void oom(void) -{ - printk("out of memory\n\r"); - do_exit(SIGSEGV); -} - -#define invalidate() \ -__asm__("movl %%eax,%%cr3"::"a" (0)) - -/* these are not to be changed without changing head.s etc */ -#define LOW_MEM 0x100000 -#define PAGING_MEMORY (15*1024*1024) -#define PAGING_PAGES (PAGING_MEMORY>>12) -#define MAP_NR(addr) (((addr)-LOW_MEM)>>12) -#define USED 100 - -#define CODE_SPACE(addr) ((((addr)+4095)&~4095) < \ -current->start_code + current->end_code) - -static long HIGH_MEMORY = 0; - -#define copy_page(from,to) \ -__asm__("cld ; rep ; movsl"::"S" (from),"D" (to),"c" (1024)) - -static unsigned char mem_map [ PAGING_PAGES ] = {0,}; - -/* - * Get physical address of first (actually last :-) free page, and mark it - * used. If no free pages left, return 0. - */ -unsigned long get_free_page(void) -{ -register unsigned long __res asm("ax"); - -__asm__("std ; repne ; scasb\n\t" - "jne 1f\n\t" - "movb $1,1(%%edi)\n\t" - "sall $12,%%ecx\n\t" - "addl %2,%%ecx\n\t" - "movl %%ecx,%%edx\n\t" - "movl $1024,%%ecx\n\t" - "leal 4092(%%edx),%%edi\n\t" - "rep ; stosl\n\t" - "movl %%edx,%%eax\n" - "1:" - :"=a" (__res) - :"0" (0),"i" (LOW_MEM),"c" (PAGING_PAGES), - "D" (mem_map+PAGING_PAGES-1) - ); -return __res; -} - -/* - * Free a page of memory at physical address 'addr'. Used by - * 'free_page_tables()' - */ -void free_page(unsigned long addr) -{ - if (addr < LOW_MEM) return; - if (addr >= HIGH_MEMORY) - panic("trying to free nonexistent page"); - addr -= LOW_MEM; - addr >>= 12; - if (mem_map[addr]--) return; - mem_map[addr]=0; - panic("trying to free free page"); -} - -/* - * This function frees a continuos block of page tables, as needed - * by 'exit()'. As does copy_page_tables(), this handles only 4Mb blocks. - */ -int free_page_tables(unsigned long from,unsigned long size) -{ - unsigned long *pg_table; - unsigned long * dir, nr; - - if (from & 0x3fffff) - panic("free_page_tables called with wrong alignment"); - if (!from) - panic("Trying to free up swapper memory space"); - size = (size + 0x3fffff) >> 22; - dir = (unsigned long *) ((from>>20) & 0xffc); /* _pg_dir = 0 */ - for ( ; size-->0 ; dir++) { - if (!(1 & *dir)) - continue; - pg_table = (unsigned long *) (0xfffff000 & *dir); - for (nr=0 ; nr<1024 ; nr++) { - if (1 & *pg_table) - free_page(0xfffff000 & *pg_table); - *pg_table = 0; - pg_table++; - } - free_page(0xfffff000 & *dir); - *dir = 0; - } - invalidate(); - return 0; -} - -/* - * Well, here is one of the most complicated functions in mm. It - * copies a range of linerar addresses by copying only the pages. - * Let's hope this is bug-free, 'cause this one I don't want to debug :-) - * - * Note! We don't copy just any chunks of memory - addresses have to - * be divisible by 4Mb (one page-directory entry), as this makes the - * function easier. It's used only by fork anyway. - * - * NOTE 2!! When from==0 we are copying kernel space for the first - * fork(). Then we DONT want to copy a full page-directory entry, as - * that would lead to some serious memory waste - we just copy the - * first 160 pages - 640kB. Even that is more than we need, but it - * doesn't take any more memory - we don't copy-on-write in the low - * 1 Mb-range, so the pages can be shared with the kernel. Thus the - * special case for nr=xxxx. - */ -int copy_page_tables(unsigned long from,unsigned long to,long size) -{ - unsigned long * from_page_table; - unsigned long * to_page_table; - unsigned long this_page; - unsigned long * from_dir, * to_dir; - unsigned long nr; - - if ((from&0x3fffff) || (to&0x3fffff)) - panic("copy_page_tables called with wrong alignment"); - from_dir = (unsigned long *) ((from>>20) & 0xffc); /* _pg_dir = 0 */ - to_dir = (unsigned long *) ((to>>20) & 0xffc); - size = ((unsigned) (size+0x3fffff)) >> 22; - for( ; size-->0 ; from_dir++,to_dir++) { - if (1 & *to_dir) - panic("copy_page_tables: already exist"); - if (!(1 & *from_dir)) - continue; - from_page_table = (unsigned long *) (0xfffff000 & *from_dir); - if (!(to_page_table = (unsigned long *) get_free_page())) - return -1; /* Out of memory, see freeing */ - *to_dir = ((unsigned long) to_page_table) | 7; - nr = (from==0)?0xA0:1024; - for ( ; nr-- > 0 ; from_page_table++,to_page_table++) { - this_page = *from_page_table; - if (!(1 & this_page)) - continue; - this_page &= ~2; - *to_page_table = this_page; - if (this_page > LOW_MEM) { - *from_page_table = this_page; - this_page -= LOW_MEM; - this_page >>= 12; - mem_map[this_page]++; - } - } - } - invalidate(); - return 0; -} - -/* - * This function puts a page in memory at the wanted address. - * It returns the physical address of the page gotten, 0 if - * out of memory (either when trying to access page-table or - * page.) - */ -unsigned long put_page(unsigned long page,unsigned long address) -{ - unsigned long tmp, *page_table; - -/* NOTE !!! This uses the fact that _pg_dir=0 */ - - if (page < LOW_MEM || page >= HIGH_MEMORY) - printk("Trying to put page %p at %p\n",page,address); - if (mem_map[(page-LOW_MEM)>>12] != 1) - printk("mem_map disagrees with %p at %p\n",page,address); - page_table = (unsigned long *) ((address>>20) & 0xffc); - if ((*page_table)&1) - page_table = (unsigned long *) (0xfffff000 & *page_table); - else { - if (!(tmp=get_free_page())) - return 0; - *page_table = tmp|7; - page_table = (unsigned long *) tmp; - } - page_table[(address>>12) & 0x3ff] = page | 7; -/* no need for invalidate */ - return page; -} - -void un_wp_page(unsigned long * table_entry) -{ - unsigned long old_page,new_page; - - old_page = 0xfffff000 & *table_entry; - if (old_page >= LOW_MEM && mem_map[MAP_NR(old_page)]==1) { - *table_entry |= 2; - invalidate(); - return; - } - if (!(new_page=get_free_page())) - oom(); - if (old_page >= LOW_MEM) - mem_map[MAP_NR(old_page)]--; - *table_entry = new_page | 7; - invalidate(); - copy_page(old_page,new_page); -} - -/* - * This routine handles present pages, when users try to write - * to a shared page. It is done by copying the page to a new address - * and decrementing the shared-page counter for the old page. - * - * If it's in code space we exit with a segment error. - */ -void do_wp_page(unsigned long error_code,unsigned long address) -{ -#if 0 -/* we cannot do this yet: the estdio library writes to code space */ -/* stupid, stupid. I really want the libc.a from GNU */ - if (CODE_SPACE(address)) - do_exit(SIGSEGV); -#endif - un_wp_page((unsigned long *) - (((address>>10) & 0xffc) + (0xfffff000 & - *((unsigned long *) ((address>>20) &0xffc))))); - -} - -void write_verify(unsigned long address) -{ - unsigned long page; - - if (!( (page = *((unsigned long *) ((address>>20) & 0xffc)) )&1)) - return; - page &= 0xfffff000; - page += ((address>>10) & 0xffc); - if ((3 & *(unsigned long *) page) == 1) /* non-writeable, present */ - un_wp_page((unsigned long *) page); - return; -} - -void get_empty_page(unsigned long address) -{ - unsigned long tmp; - - if (!(tmp=get_free_page()) || !put_page(tmp,address)) { - free_page(tmp); /* 0 is ok - ignored */ - oom(); - } -} - -/* - * try_to_share() checks the page at address "address" in the task "p", - * to see if it exists, and if it is clean. If so, share it with the current - * task. - * - * NOTE! This assumes we have checked that p != current, and that they - * share the same executable. - */ -static int try_to_share(unsigned long address, struct task_struct * p) -{ - unsigned long from; - unsigned long to; - unsigned long from_page; - unsigned long to_page; - unsigned long phys_addr; - - from_page = to_page = ((address>>20) & 0xffc); - from_page += ((p->start_code>>20) & 0xffc); - to_page += ((current->start_code>>20) & 0xffc); -/* is there a page-directory at from? */ - from = *(unsigned long *) from_page; - if (!(from & 1)) - return 0; - from &= 0xfffff000; - from_page = from + ((address>>10) & 0xffc); - phys_addr = *(unsigned long *) from_page; -/* is the page clean and present? */ - if ((phys_addr & 0x41) != 0x01) - return 0; - phys_addr &= 0xfffff000; - if (phys_addr >= HIGH_MEMORY || phys_addr < LOW_MEM) - return 0; - to = *(unsigned long *) to_page; - if (!(to & 1)) { - if ((to = get_free_page())) - *(unsigned long *) to_page = to | 7; - else - oom(); - } - to &= 0xfffff000; - to_page = to + ((address>>10) & 0xffc); - if (1 & *(unsigned long *) to_page) - panic("try_to_share: to_page already exists"); -/* share them: write-protect */ - *(unsigned long *) from_page &= ~2; - *(unsigned long *) to_page = *(unsigned long *) from_page; - invalidate(); - phys_addr -= LOW_MEM; - phys_addr >>= 12; - mem_map[phys_addr]++; - return 1; -} - -/* - * share_page() tries to find a process that could share a page with - * the current one. Address is the address of the wanted page relative - * to the current data space. - * - * We first check if it is at all feasible by checking executable->i_count. - * It should be >1 if there are other tasks sharing this inode. - */ -static int share_page(unsigned long address) -{ - struct task_struct ** p; - - if (!current->executable) - return 0; - if (current->executable->i_count < 2) - return 0; - for (p = &LAST_TASK ; p > &FIRST_TASK ; --p) { - if (!*p) - continue; - if (current == *p) - continue; - if ((*p)->executable != current->executable) - continue; - if (try_to_share(address,*p)) - return 1; - } - return 0; -} - -void do_no_page(unsigned long error_code,unsigned long address) -{ - int nr[4]; - unsigned long tmp; - unsigned long page; - int block,i; - - address &= 0xfffff000; - tmp = address - current->start_code; - if (!current->executable || tmp >= current->end_data) { - get_empty_page(address); - return; - } - if (share_page(tmp)) - return; - if (!(page = get_free_page())) - oom(); -/* remember that 1 block is used for header */ - block = 1 + tmp/BLOCK_SIZE; - for (i=0 ; i<4 ; block++,i++) - nr[i] = bmap(current->executable,block); - bread_page(page,current->executable->i_dev,nr); - i = tmp + 4096 - current->end_data; - tmp = page + 4096; - while (i-- > 0) { - tmp--; - *(char *)tmp = 0; - } - if (put_page(page,address)) - return; - free_page(page); - oom(); -} - -void mem_init(long start_mem, long end_mem) -{ - int i; - - HIGH_MEMORY = end_mem; - for (i=0 ; i>= 12; - while (end_mem-->0) - mem_map[i++]=0; -} - -void calc_mem(void) -{ - int i,j,k,free=0; - long * pg_tbl; - - for(i=0 ; i /* fprintf */ -#include -#include /* contains exit */ -#include /* unistd.h needs this */ -#include -//#include -#include /* contains read/write */ -#include - -#define MINIX_HEADER 32 -#define GCC_HEADER 1024 - -#define SYS_SIZE 0x3000 - -#define DEFAULT_MAJOR_ROOT 2 -#define DEFAULT_MINOR_ROOT 0x1d - -/* max nr of sectors of setup: don't change unless you also change - * bootsect etc */ -#define SETUP_SECTS 4 - -#define STRINGIFY(x) #x - -#define MAJOR(a) (((unsigned)(a))>>8) -#define MINOR(a) ((a)&0xff) - -void die(char * str) -{ - fprintf(stderr,"%s\n",str); - exit(1); -} - -void usage(void) -{ - die("Usage: build bootsect setup system [rootdev] [> image]"); -} - -int main(int argc, char ** argv) -{ - int i,c,id; - char buf[1024]; - char major_root, minor_root; - struct stat sb; - int size=512+4*512; - FILE* imageFile = fopen("Boot.img","wb"); - - if ((argc != 4) && (argc != 5)) - usage(); - if (argc == 5) { - if (strcmp(argv[4], "FLOPPY")) { - if (stat(argv[4], &sb)) { - perror(argv[4]); - die("Couldn't stat root device."); - } - major_root = MAJOR(sb.st_rdev); - minor_root = MINOR(sb.st_rdev); - } else { - major_root = 0; - minor_root = 0; - } - } else { - major_root = DEFAULT_MAJOR_ROOT; - minor_root = DEFAULT_MINOR_ROOT; - } - fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root); - if ((major_root != 2) && (major_root != 3) && - (major_root != 0)) { - fprintf(stderr, "Illegal root device (major = %d)\n", - major_root); - die("Bad root device --- major #"); - } - - - for (i=0;i0 ; i+=c ) - if (write(1,buf,c)!=c) - die("Write call failed"); - close (id); - */ - for (i=0 ; (c=read(id,buf,sizeof buf))>0 ; i+=c ) - { - if (fwrite(buf,1,c,imageFile)!=c) - { - die("Write call failed"); - } - } - close (id); - - if (i > SETUP_SECTS*512) - { - die("Setup exceeds " STRINGIFY(SETUP_SECTS)" sectors - rewrite build/boot/setup"); - } - fprintf(stderr,"Setup is %d bytes.\n",i); - for (c=0 ; c sizeof(buf)) - { - c = sizeof(buf); - } -// if (write(1,buf,c) != c) - if( c != fwrite(buf,1,c,imageFile) ) - { - die("Write call failed"); - } - i += c; - } - - if ( (id=open(argv[3],O_RDONLY|O_BINARY,0) ) < 0 ) - { - die("Unable to open 'system'"); - } -// if (read(id,buf,GCC_HEADER) != GCC_HEADER) -// die("Unable to read header of 'system'"); -// if (((long *) buf)[5] != 0) -// die("Non-GCC header of 'system'"); - for (i=0 ; (c=read(id,buf,sizeof buf))>0 ; i+=c ) - { - if (fwrite(buf,1,c,imageFile)!= c) - die("Write call failed"); - } - close(id); - size+=i; - fprintf(stderr,"System is %d bytes.\n",i); - if (i > SYS_SIZE*16) - die("System is too big"); - memset(buf,0,sizeof(buf)); - - fprintf(stderr,"total size is %d bytes.\n",1440*1024); - - //1475084 - //1474560 - while(size<1440*1024) - { - c = 1440*1024 - size; - if( c > sizeof(buf) ) - { - c = sizeof(buf); - } - c = fwrite(buf,1,c,imageFile); - size+=c; - } - - fclose(imageFile); - return(0); -} diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/tools/build.exe b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/tools/build.exe deleted file mode 100644 index d6dacf2..0000000 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/tools/build.exe and /dev/null differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/tools/trans.exe b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/tools/trans.exe deleted file mode 100644 index bfecea1..0000000 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11-With-PE-Loader/tools/trans.exe and /dev/null differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/bochsout.txt b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/bochsout.txt index 2bf77ce..b107565 100644 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/bochsout.txt +++ b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/bochsout.txt @@ -33,10 +33,10 @@ 00000000000i[ ] SB16 support: yes 00000000000i[ ] USB support: yes 00000000000i[ ] VGA extension support: vbe cirrus -00000000000i[MEM0 ] allocated memory at 03A73020. after alignment, vector=03A74000 +00000000000i[MEM0 ] allocated memory at 0369D020. after alignment, vector=0369E000 00000000000i[MEM0 ] 32.00MB -00000000000i[MEM0 ] rom at 0xfffe0000/131072 ('C:\software\Bochs-2.3.6/BIOS-bochs-latest') -00000000000i[MEM0 ] rom at 0xc0000/32768 ('C:\software\Bochs-2.3.6/VGABIOS-elpin-2.40') +00000000000i[MEM0 ] rom at 0xfffe0000/131072 ('../bochs-2.3.6/BIOS-bochs-latest') +00000000000i[MEM0 ] rom at 0xc0000/32768 ('../bochs-2.3.6/VGABIOS-elpin-2.40') 00000000000i[APIC?] set APIC ID to 0 00000000000i[APIC0] 80686 00000000000i[APIC0] local apic in CPU apicid=00 initializing @@ -44,7 +44,7 @@ 00000000000i[IOAP ] set APIC ID to 1 00000000000i[MEM0 ] Register memory access handlers: fec00000-fec00fff 00000000000i[CMOS ] Using local time for initial clock -00000000000i[CMOS ] Setting initial clock to: Fri Nov 12 23:17:12 2021 (time0=1636730232) +00000000000i[CMOS ] Setting initial clock to: Sat Nov 13 23:31:13 2021 (time0=1636817473) 00000000000i[DMA ] channel 4 used by cascade 00000000000i[DMA ] channel 2 used by Floppy Drive 00000000000i[FDD ] fd0: 'boot.img' ro=0, h=2,t=80,spt=18 @@ -55,7 +55,7 @@ 00000000000i[WGUI ] Desktop Window dimensions: 1920 x 1080 00000000000i[WGUI ] Number of Mouse Buttons = 16 00000000000i[WGUI ] IME disabled -00000000000i[KMAP ] Loading keymap from 'C:\software\Bochs-2.3.6/keymaps/x11-pc-us.map' +00000000000i[KMAP ] Loading keymap from '../bochs-2.3.6/keymaps/x11-pc-us.map' 00000000000i[KMAP ] Loaded 168 symbols 00000000000i[MEM0 ] Register memory access handlers: e0000000-e07fffff 00000000000i[CLVGA] VBE Bochs Display Extension Enabled @@ -144,3 +144,34 @@ 00013120815i[BIOS ] Booting from 0000:7c00 00021974806e[DEV ] write to port 0x03f2 with len 2 ignored 00021979699i[BIOS ] int13_harddisk: function 15, unmapped device for ELDL=81 +00103868000p[WGUI ] >>PANIC<< POWER button turned off. +00103868000i[CPU0 ] CPU is in protected mode (active) +00103868000i[CPU0 ] CS.d_b = 32 bit +00103868000i[CPU0 ] SS.d_b = 32 bit +00103868000i[CPU0 ] EFER = 0x00000000 +00103868000i[CPU0 ] | RAX=0000000000000000 RBX=0000000000000003 +00103868000i[CPU0 ] | RCX=000000000001a174 RDX=0000000000ffd000 +00103868000i[CPU0 ] | RSP=000000000001a108 RBP=000000000000013b +00103868000i[CPU0 ] | RSI=00000000000900a0 RDI=000000000001fca0 +00103868000i[CPU0 ] | R8=0000000000000000 R9=0000000000000000 +00103868000i[CPU0 ] | R10=0000000000000000 R11=0000000000000000 +00103868000i[CPU0 ] | R12=0000000000000000 R13=0000000000000000 +00103868000i[CPU0 ] | R14=0000000000000000 R15=0000000000000000 +00103868000i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df IF tf sf zf af pf cf +00103868000i[CPU0 ] | SEG selector base limit G D +00103868000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D +00103868000i[CPU0 ] | CS:0008( 0001| 0| 0) 00000000 00000fff 1 1 +00103868000i[CPU0 ] | DS:0010( 0002| 0| 0) 00000000 00000fff 1 1 +00103868000i[CPU0 ] | SS:0010( 0002| 0| 0) 00000000 00000fff 1 1 +00103868000i[CPU0 ] | ES:0010( 0002| 0| 0) 00000000 00000fff 1 1 +00103868000i[CPU0 ] | FS:0017( 0002| 1| 3) 00000000 0000009f 1 1 +00103868000i[CPU0 ] | GS:0017( 0002| 1| 3) 00000000 0000009f 1 1 +00103868000i[CPU0 ] | MSR_FS_BASE:0000000000000000 +00103868000i[CPU0 ] | MSR_GS_BASE:0000000000000000 +00103868000i[CPU0 ] | RIP=0000000000006acc (0000000000006acc) +00103868000i[CPU0 ] | CR0=0x8000001b CR1=0x0 CR2=0x0000000008032ef0 +00103868000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000 +00103868000i[CPU0 ] >> jnbe .+0xffffffa4 (0x00006a72) : 77A4 +00103868000i[CMOS ] Last time is 1636817524 (Sat Nov 13 23:32:04 2021) +00103868000i[ ] restoring default signal behavior +00103868000i[CTRL ] quit_sim called with exit code 1 diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/bochsrc.bxrc b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/bochsrc.bxrc index 96e70a5..4a84355 100644 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/bochsrc.bxrc +++ b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/bochsrc.bxrc @@ -6,8 +6,8 @@ megs: 32 # filename of ROM images -romimage: file=$BXSHARE/BIOS-bochs-latest -vgaromimage: file=$BXSHARE/VGABIOS-elpin-2.40 +romimage: file=../bochs-2.3.6/BIOS-bochs-latest +vgaromimage: file=../bochs-2.3.6/VGABIOS-elpin-2.40 # what disk images will be used floppya: 1_44=boot.img, status=inserted @@ -24,4 +24,4 @@ log: bochsout.txt mouse: enabled=0 # enable key mapping, using US layout as default. -keyboard_mapping: enabled=1, map=$BXSHARE/keymaps/x11-pc-us.map +keyboard_mapping: enabled=1, map=../bochs-2.3.6/keymaps/x11-pc-us.map diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/blk_drv/blk_drv.a b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/blk_drv/blk_drv.a index 7750c82..5b0ec39 100644 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/blk_drv/blk_drv.a and b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/blk_drv/blk_drv.a differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/chr_drv/chr_drv.a b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/chr_drv/chr_drv.a index 0b17ac2..26c914c 100644 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/chr_drv/chr_drv.a and b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/chr_drv/chr_drv.a differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/math/math.a b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/math/math.a index 29bb54f..2450445 100644 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/math/math.a and b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/kernel/math/math.a differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/lib/lib.a b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/lib/lib.a index e185198..74180ea 100644 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/lib/lib.a and b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/lib/lib.a differ diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/run.bat b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/run.bat index 672a1cc..848073b 100644 --- a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/run.bat +++ b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/run.bat @@ -2,4 +2,5 @@ make -bochs -f bochsrc.bxrc -q \ No newline at end of file +..\bochs-2.3.6\bochs -f bochsrc.bxrc -q + diff --git a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/tools/system.exe b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/tools/system.exe index 411e29c..b6cb6d5 100644 Binary files a/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/tools/system.exe and b/一些非必要的资料/linux-0.11-quickstart/Linux-0.11/tools/system.exe differ diff --git a/一些非必要的资料/linux-0.11-quickstart/README.md b/一些非必要的资料/linux-0.11-quickstart/README.md index f1b68cd..89631cc 100644 --- a/一些非必要的资料/linux-0.11-quickstart/README.md +++ b/一些非必要的资料/linux-0.11-quickstart/README.md @@ -4,9 +4,7 @@ 具体过程为: -第一步:安装 bochs.exe 并设置好 PATH - -第二步:进入 Linux-0.11 目录,双击 run.bat 就直接跑起来了 +进入 Linux-0.11 目录,双击 run.bat 就直接跑起来了 ![image](https://user-images.githubusercontent.com/25787738/141492974-5584f999-bb6d-422f-ab31-7690b678a235.png)