<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>G &#8211; Virtually Fun</title>
	<atom:link href="https://virtuallyfun.com/tag/g/feed/" rel="self" type="application/rss+xml" />
	<link>https://virtuallyfun.com</link>
	<description>Fun with Virtualization</description>
	<lastBuildDate>Fri, 29 Sep 2017 00:24:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Trying to debug an ancient Linux 0.11 kernel with GDB</title>
		<link>https://virtuallyfun.com/2017/09/29/trying-debug-ancient-linux-0-11-kernel-gdb/</link>
					<comments>https://virtuallyfun.com/2017/09/29/trying-debug-ancient-linux-0-11-kernel-gdb/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 29 Sep 2017 00:24:02 +0000</pubDate>
				<category><![CDATA[GDB]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[G]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=7462</guid>

					<description><![CDATA[It doesn&#8217;t hit on the breakpoints for some reason.Â  I&#8217;m most likely doing something wrong. GNU gdb 4.17 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to &#8230; <a href="https://virtuallyfun.com/2017/09/29/trying-debug-ancient-linux-0-11-kernel-gdb/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>It doesn&#8217;t hit on the breakpoints for some reason.Â  I&#8217;m most likely doing something wrong.</p>
<p style="padding-left: 30px;">GNU gdb 4.17<br />
Copyright 1998 Free Software Foundation, Inc.<br />
GDB is free software, covered by the GNU General Public License, and you are<br />
welcome to change it and/or distribute copies of it under certain conditions.<br />
Type &#8220;show copying&#8221; to see the conditions.<br />
There is absolutely no warranty for GDB. Type &#8220;show warranty&#8221; for details.<br />
This GDB was configured as &#8220;&#8211;host=i486-pc-netbsd &#8211;target=i386-linux-gnuaout&#8221;&#8230;<br />
Setting up the environment for debugging gdb.<br />
Breakpoint 1 at 0x94a4: file panic.c, line 18.<br />
Breakpoint 2 at 0x667b: file init/main.c, line 110.<br />
tcp_open ! localhost:1234<br />
0xfff0 in sys_unlink () at memory.c:430<br />
430 }<br />
(top-gdb)c<br />
Continuing.</p>
<p style="padding-left: 30px;">Program received signal SIGINT, Interrupt.<br />
panic (s=0x1dd6c &#8220;&#8221;) at panic.c:23<br />
23 for(;;);<br />
(top-gdb)bt<br />
#0 panic (s=0x1dd6c &#8220;&#8221;) at panic.c:23<br />
#1 0xd9b3 in mount_root () at memory.c:430<br />
#2 0x12f39 in sys_setup (BIOS=0x1ab38) at hd.c:157<br />
#3 0x7477 in system_call () at sched.c:412<br />
#4 0x1000000 in ?? ()<br />
(top-gdb)</p>
<p>But after a LOT of struggling it certainly looks about right.</p>
<div id="attachment_7463" style="width: 732px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2017/09/Linux-0.11-panic.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-7463" class="size-full wp-image-7463" src="https://virtuallyfun.com/wp-content/uploads/2017/09/Linux-0.11-panic.png" alt="" width="722" height="432" /></a><p id="caption-attachment-7463" class="wp-caption-text">Linux 0.11 kernel panic on mounting root</p></div>
<p>I then went ahead and built GDB 8.0.1, and it&#8217;s incredibly slow, and I guess not too compatible with Qemu 0.9 (I had issues with newer builds though) but it does break.</p>
<p style="padding-left: 30px;">
(top-gdb)target remote localhost:1234<br />
Remote debugging using localhost:1234<br />
0x0000fff0 in sys_unlink () at memory.c:83<br />
83 }<br />
(top-gdb)i b<br />
Num Type Disp Enb Address What<br />
1 breakpoint keep y 0x000094a4 in panic at panic.c:18<br />
2 breakpoint keep y 0x000094a4 in panic at panic.c:18<br />
silent<br />
return<br />
(top-gdb)c<br />
Continuing.</p>
<p style="padding-left: 30px;">Breakpoint 1, panic (s=0xd8cf &lt;sys_mount+227&gt;) at panic.c:18<br />
18 printk(&#8220;Kernel panic: %s\n\r&#8221;,s);<br />
Reply contains invalid hex digit 79<br />
(top-gdb)i s<br />
Reply contains invalid hex digit 79<br />
(top-gdb)bt<br />
#0 0x0000d9b3 in mount_root () at memory.c:83<br />
#1 0x0001ab60 in hd_info ()<br />
#2 0x00000000 in ?? ()<br />
(top-gdb)i r<br />
eax 0x0 0<br />
ecx 0x51 81<br />
edx 0x1fb4c 129868<br />
ebx 0x0 0<br />
esp 0xffff94 0xffff94<br />
ebp 0xffffa8 0xffffa8<br />
esi 0x1ab60 109408<br />
edi 0x0 0<br />
eip 0xd9b3 0xd9b3 &lt;mount_root+139&gt;<br />
eflags 0x246 [ PF ZF IF ]<br />
cs 0x8 8<br />
ss 0x10 16<br />
ds 0x10 16<br />
es 0x10 16<br />
fs 0x17 23<br />
gs 0x17 23<br />
(top-gdb)</p>
<p>And while it more or less runs there is some issues using the GDB stub from Qemu 0.9.0, although I had a world of pain with newer versions.Â  And I&#8217;ve never done the kernel debug thing before so this is all new to me.</p>
<p>And I guess it goes as no surprise that with GDB 8, they have a.out Linux tagged as obsolete and to be removed.Â  I guess I need to try a GDB that was current to Qemu 0.90 so it may not have so many packet overruns and unexpected results&#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/09/29/trying-debug-ancient-linux-0-11-kernel-gdb/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
