114 lines
3.0 KiB
Plaintext
114 lines
3.0 KiB
Plaintext
$Id: misc.txt,v 1.14 2002-11-20 18:20:11 bdenney Exp $
|
|
|
|
Testing testing....
|
|
|
|
This is a temporary place to paste in stuff that should go into the docs one
|
|
day. When it is transferred into docbook, let's remove it from misc.txt.
|
|
|
|
--------------------------------------------------------------------------
|
|
--------------------------------------------------------------------------
|
|
--------------------------------------------------------------------------
|
|
--------------------------------------------------------------------------
|
|
Date: Thu, 15 Nov 2001 13:31:34 -0800
|
|
From: David Christy <davidc@davidc.biz>
|
|
To: bryce@tlw.com
|
|
Subject: usefull info for mounting
|
|
|
|
|
|
I didn't see this in the doc's so I thought you might like a
|
|
short description of how to mount a disk image file into
|
|
loopback filesystem for maintenance purposes.
|
|
|
|
--------------------------------------------
|
|
|
|
1) First run
|
|
|
|
fdisk -l <image_name>
|
|
|
|
... and it should print out a partition table (with a few
|
|
complaints requesting the drive geometry, and I don't know
|
|
if older versions require a block device) In fact fdisk will
|
|
even work to modify partitions in an image, but you must
|
|
specify the drive geometry that's in the bocsrc first.
|
|
|
|
2) Whatever it says the starting partition is, subtract 1
|
|
and multiply by 512
|
|
|
|
3) Type
|
|
|
|
mount -o loop,offset=<insert number here> <image_name>
|
|
/mount/dir
|
|
|
|
or if it's just a floppy image, just
|
|
|
|
mount -o loop floppy.img /mount/dir
|
|
|
|
---------------------------------------------------
|
|
|
|
I would recommend putting -o ro for read only access if
|
|
bochs is in use. For unusual filesystems you may need to
|
|
add a -t <fstype> flag to the mount command to specify the
|
|
filesystem type.
|
|
|
|
see man mount, losetup, and fdisk for more info
|
|
|
|
|
|
|
|
BOCHS Rocks!!!
|
|
|
|
|
|
-----------------------------
|
|
instructions for gdb stub
|
|
These are from www.rtmk.org/bochs-gdb.html
|
|
|
|
Bochs and remote GDB stub
|
|
|
|
This page covers how you can use Bochs with a remote GDB stub to debug your
|
|
kernel.
|
|
|
|
Table of contents: Configurating Bochs | Running Bochs | Running GDB |
|
|
Download Bochs with GDB stub
|
|
|
|
Configurating Bochs
|
|
|
|
First you must download the Bochs package that contains the GDB stub, see
|
|
Download Bochs with GDB stub section.
|
|
|
|
Untar the package 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.
|
|
|
|
Running Bochs
|
|
|
|
Just start Bochs as normal. Bochs will wait for GDB to connect to the stub.
|
|
|
|
Running GDB
|
|
|
|
Bochs GDB stub waits for a connection on port 1234 on localhost (127.0.0.1).
|
|
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)
|
|
----------------------
|