about summary refs log tree commit diff stats
path: root/dev/c/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'dev/c/index.html')
-rw-r--r--dev/c/index.html87
1 files changed, 1 insertions, 86 deletions
diff --git a/dev/c/index.html b/dev/c/index.html
index 684c7d2..1c3b478 100644
--- a/dev/c/index.html
+++ b/dev/c/index.html
@@ -7,92 +7,6 @@
     <body>
         <a href="../index.html">Development Index</a>
 
-        <h1>System Development</h1>
-
-        <p>System development requires debug kernel know how,
-        in this example will be used qemu and gdb. A simple init
-        program is created. Create init.S;</p>
-
-        <pre>
-	.global _start
-	_start:
-	    mov $1, %rax
-	    mov $1, %rdi
-	    mov $message, %rsi
-	    mov $message_len, %rdx
-	    syscall
-	    jmp .
-	    message: .ascii "FOOBAR FOOBAR FOOBAR FOOBAR FOOBAR FOOBAR FOOBAR\n"
-	    .equ message_len, . - message
-	</pre>
-
-	<p>Assemble, link and create simple initial ram disk;</p>
-
-	<pre>
-	mkdir d
-	as --64 -o init.o init.S # assemble
-	ld -o d/init init.o      # link
-	cd d
-	find . | cpio -o -H newc | gzip > ../rootfs.cpio.gz
-	</pre>
-
-	<p>Clean temporary directory;</p>
-
-	<pre>
-	cd ..
-	rm -r d/
-	</pre>
-
-	<p>Can be used C to create init program;</p>
-
-	<pre>
-	#include &lt;stdio.h&gt;
-	#include &lt;unistd.h&gt;
-
-	int main() {
-	    printf("FOOBAR FOOBAR FOOBAR FOOBAR FOOBAR FOOBAR FOOBAR\n");
-	    sleep(0xFFFFFFFF);
-	    return 0;
-	}
-	</pre>
-
-	<pre>
-	$ gcc -static init.c -o init
-	</pre>
-
-	<p>Test qemu, kernel and simple init program, you should see
-	"FOOBAR FOOBAR FOOBAR FOOBAR FOOBAR FOOBAR FOOBAR";</p>
-
-	<pre>
-	$ qemu-system-x86_64 -enable-kvm --kernel arch/x86_64/boot/bzImage \
-    	--initrd rootfs.cpio.gz
-	</pre>
-
-	<p>If everything goes well you can start qemu without start CPU at
-	startup (-S) and with gdb server on TCP port 1234 (-s).</p>
-
-	<pre>
-	$ qemu-system-x86_64 -enable-kvm --kernel arch/x86/boot/bzImage \
-                --initrd rootfs.cpio.gz \
-		-S -s
-	</pre>
-
-	<p>On another terminal start gdb;</p>
-
-	<pre>
-	gdb \
-	    -ex "add-auto-load-safe-path $(pwd)" \
-	    -ex "file vmlinux" \
-	    -ex 'set arch i386:x86-64:intel' \
-	    -ex 'target remote localhost:1234' \
-	    -ex 'break start_kernel' \
-	    -ex 'continue' \
-	    -ex 'disconnect' \
-	    -ex 'set arch i386:x86-64' \
-	    -ex 'target remote localhost:1234'
-	</pre>
-
-	
         <h1>C &amp; GDB</h1>
 
         <p><a href="http://blog.fourthbit.com/2013/06/18/creating-an-open-source-program-in-c-with-autotools-part-1-of-2/">C program with autotools</a>
@@ -172,6 +86,7 @@
         <pre>
         strace -c ./program
         </pre>
+
         <a href="../index.html">Development Index</a>
         <p>
         This is part of the c9-doc Manual.
2023-05-14 13:25:36 +0200 committer bptato <nincsnevem662@gmail.com> 2023-05-14 13:25:36 +0200 Async resource loading, exception handling fixes' href='/ahoang/chawan/commit/src/io/promise.nim?id=58dee598d30c5d107f9c469eb01c660b39832f9a'>58dee598 ^
80b45c0d ^


0edb5d32 ^
80b45c0d ^













607545c8 ^




80b45c0d ^



80b45c0d ^

58dee598 ^

80b45c0d ^

607545c8 ^











80b45c0d ^
80b45c0d ^


0edb5d32 ^
80b45c0d ^


80b45c0d ^

36390a56 ^
80b45c0d ^


36390a56 ^


80b45c0d ^


80b45c0d ^




36390a56 ^


80b45c0d ^

eff1e064 ^
eff1e064 ^





80b45c0d ^
80b45c0d ^





36390a56 ^


80b45c0d ^
58dee598 ^
17097052 ^

17097052 ^










58dee598 ^










1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167