Browse Source

Fix typos

pull/102/head
Tu Do 3 years ago
parent
commit
21f9f3958f
2 changed files with 13 additions and 14 deletions
  1. 10
    11
      Operating_Systems_From_0_to_1.pdf
  2. 3
    3
      book_src/Operating Systems From 0 to 1.lyx

+ 10
- 11
Operating_Systems_From_0_to_1.pdf View File

@@ -6682,11 +6682,10 @@ Segment Sections...
08 .init_array .fini_array .jcr .dynamic .got

The last section in the first LOAD segment is .eh_frame. The .eh_frame
section starts at 0x0804851 becauase the start address is 0x08048000,
the offset into the file is 0x510. The end address of .eh_frame should
be: 0x08048000 + 0x510 + 0xec = 0x080485fc because the segment size
is 0xec. This is exactly the same as the end address of the first LOAD seg-
ment above: 0x08048000 + 0x5ec = 0x080485fc.
section starts at 0x0804851 because the start address is 0x08048000, the
offset into the file is 0x510. The end address of .eh_frame should be: 0x08048000 + 0x510 + 0xec = 0x080485fc
because the segment size is 0xec. This is exactly the same as the end ad-
dress of the first LOAD segment above: 0x08048000 + 0x5ec = 0x080485fc.

Chapter 8 will explore this whole process in detail.
6
@@ -7143,7 +7142,7 @@ Output Dump of assembler code for function main:

6.2.6 Command: x
This command examines the content of a given memory range.
Example 6.2.12. We can examine the raw content of main:
Example 6.2.12. We can examine the raw content in main:

(gdb) x main

@@ -7151,7 +7150,7 @@ Output 0x804840b <main>: 0x04244c8d

By default, without any argument, the command only prints the con-
tent of a single memory address. In this case, that is the starting memory
address of main.
address in main.

Example 6.2.13. With format arguments, the command can print a
range of memory in a specific format.
@@ -9117,13 +9116,13 @@ and all runs every main targets.

For the convenience, we save GDB configuration to .gdbinit file at the
project root directory. This configuration is just a collection of GDB com-
bootloader 215
bootloader 215

mands and a few extra commands. When gdb runs, it first loads the .gdbinit
file at home directory, then the .gdbinit file at the current directory. Why
shouldn’t we put commands in ~/.gdbinit? Because these commands
are specific to only this projec e.g. not all programs are required a remote
connection.
are specific to only this project e.g. not all programs are required a re-
mote connection.

Our first configuration:

@@ -11696,7 +11695,7 @@ Output build/os/os: file format elf32-i386
...... output omitted ......

Both raw opcode displayed by the two programs are the same. In this
case, it proved that gdb correctly jumped to the address of main for a pro-
case, it proved that gdb correctly jumped to the address in main for a pro-
linking and loading on bare metal 273

per debugging. This is an extremely important milestone. Being able to

+ 3
- 3
book_src/Operating Systems From 0 to 1.lyx View File

@@ -56518,7 +56518,7 @@ This command examines the content of a given memory range.
\end_layout
\begin_layout Example
We can examine the raw content of
We can examine the raw content in
\family typewriter
main
\family default
@@ -56611,7 +56611,7 @@ end{shelloutput16.6}
\begin_layout Standard
By default, without any argument, the command only prints the content of
a single memory address.
In this case, that is the starting memory address of
In this case, that is the starting memory address in
\family typewriter
main
\family default
@@ -83002,7 +83002,7 @@ Both raw opcode displayed by the two programs are the same.
\family typewriter
gdb
\family default
correctly jumped to the address of
correctly jumped to the address in
\family typewriter
main
\family default

Loading…
Cancel
Save