From 9f944abd3e21f5a15b9c7da4e439172bcbafdb1a Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Sun, 25 Dec 2022 22:42:18 -0800 Subject: [PATCH 1/2] fix(docs): typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7043a4d..c8a2410 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ As [Chapter 10](https://github.com/below/HelloSilicon#chapter-10) focusses on bu Be aware that the function numbers are not only different, but on Darwin, they are considered private and subject to change. -## Chapter 4: Controlling Programm Flow +## Chapter 4: Controlling Program Flow Besides the common changes, we face a new issue which is described in the book in Chapter 5: Darwin does not like `LDR X1, =symbol`, it will produce the error `ld: Absolute addressing not allowed in arm64 code`. If we use `ASR X1, symbol`, as suggested in Chapter 3 of the book, our data has to be in the read-only `.text` section. In this sample however, we want writable data. From c12f73b55f4bf397664f17e4b590cb87199c69f4 Mon Sep 17 00:00:00 2001 From: skrrb Date: Mon, 26 Dec 2022 17:15:28 +0100 Subject: [PATCH 2/2] fix HelloWorld entrypoint --- Chapter 01/HelloWorld.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Chapter 01/HelloWorld.s b/Chapter 01/HelloWorld.s index 1850815..46cc3f8 100644 --- a/Chapter 01/HelloWorld.s +++ b/Chapter 01/HelloWorld.s @@ -6,12 +6,12 @@ // X16 - Mach System Call function number // -.global start // Provide program starting address to linker +.global _start // Provide program starting address to linker .align 2 // Make sure everything is aligned properly // Setup the parameters to print hello world // and then call the Kernel to do it. -start: mov X0, #1 // 1 = StdOut +_start: mov X0, #1 // 1 = StdOut adr X1, helloworld // string to print mov X2, #13 // length of our string mov X16, #4 // Unix write system call