Logging disk access in Bochs
Logging disk access in Bochs
I would like to log what is read from disk by an OS running in Bochs; is this possible? I tried logging 'HD' events, but every IO was logged so there was vastly too much data, when all I'm really wanting is a list of which sectors were read.
Re: Logging disk access in Bochs
Put a logger into your readsector routine. Read this about how to write to bochs' output: http://wiki.osdev.org/Bochs#I.2FO_debugger_macrosmadanra wrote:I would like to log what is read from disk by an OS running in Bochs; is this possible? I tried logging 'HD' events, but every IO was logged so there was vastly too much data, when all I'm really wanting is a list of which sectors were read.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Logging disk access in Bochs
Did both of you tried running "man grep"? Why introduce new code when you already have something that can do it?
Re: Logging disk access in Bochs
@turdus:
This isn't actually for my OS, I'm actually running Windows 7 (which does work in Bochs, just), so I can't edit the OS.
@Combuster:
Ah, managed to find the information, using grep to get rid of most of the unimportant data and then find+replace to trim it down a bit more. I hadn't actually realised to begin with that the necessary information was actually in the log file, but it is there, if a little confusing - it says 'sector number', 'cylinder low' and 'cylinder high' despite the fact that it's using 28-bit LBA!
This isn't actually for my OS, I'm actually running Windows 7 (which does work in Bochs, just), so I can't edit the OS.
@Combuster:
Ah, managed to find the information, using grep to get rid of most of the unimportant data and then find+replace to trim it down a bit more. I hadn't actually realised to begin with that the necessary information was actually in the log file, but it is there, if a little confusing - it says 'sector number', 'cylinder low' and 'cylinder high' despite the fact that it's using 28-bit LBA!
Re: Logging disk access in Bochs
I hope that by "find + replace" you mean that you wrote...madanra wrote:...and then find+replace to trim it down a bit more...
Code: Select all
grep <searchstring> $1 | sed "s/<find>/<replace>/g"
Every good solution is obvious once you've found it.
Re: Logging disk access in Bochs
Well, my bochs cannot log as much as I want, and it's not configurable (only at runtime, which is quite annoying). And I usually trust code only if it was written by me Yes, you can call me paranoid That's why I suggested an ultimate solution, but I didn't know it's not his/her own OS.Combuster wrote:Did both of you tried running "man grep"? Why introduce new code when you already have something that can do it?
Re: Logging disk access in Bochs
Sorry, no I'm a Windows guy, I get confused without a GUISolar wrote:I hope that by "find + replace" you mean that you wrote...madanra wrote:...and then find+replace to trim it down a bit more......into a script somewhere.Code: Select all
grep <searchstring> $1 | sed "s/<find>/<replace>/g"
Re: Logging disk access in Bochs
That's a problem that should be addressed. You may love or loathe the Unix shell, but it is a powerful and useful tool for any developer.
Actually, I consider a Windows without Cygwin installed to be crippled.
Actually, I consider a Windows without Cygwin installed to be crippled.
Every good solution is obvious once you've found it.
Re: Logging disk access in Bochs
Ooh, this forum has weird smilies, I used :P which normally would have shown I was (slightly) joking, but it replaced it with more of a :D smilie...
I do have Cygwin, and would probably switch to Linux if it wasn't for the lack of decent parental controls, which is an instant dealbreaker.
I do have Cygwin, and would probably switch to Linux if it wasn't for the lack of decent parental controls, which is an instant dealbreaker.
Re: Logging disk access in Bochs
Every good solution is obvious once you've found it.
Re: Logging disk access in Bochs
I know there are options, but when I last tried actually using any of them, nothing was really up to standard. That was ~8 months ago though, the situation may have improved by now. I may well have a look again when I have the time.