{"id":13430,"date":"2022-09-04T18:50:37","date_gmt":"2022-09-04T18:50:37","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=13430"},"modified":"2022-09-04T19:31:51","modified_gmt":"2022-09-04T19:31:51","slug":"raspberry-pi-bare-metal","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=13430","title":{"rendered":"Raspberry Pi Bare-Metal"},"content":{"rendered":"<p><!-- ------------------------------------------------------------------------------------------------ --><\/p>\n<hr\/>\n<h1>Low Level Learning<\/h1>\n<table>\n<tr>\n<td><a href=\"http:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/01_asm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/01_asm.png\" alt=\"\" width=\"430\" height=\"233\" class=\"alignleft size-full wp-image-13433\" srcset=\"https:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/01_asm.png 430w, https:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/01_asm-300x163.png 300w\" sizes=\"auto, (max-width: 430px) 100vw, 430px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"http:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/02_asm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/02_asm.png\" alt=\"\" width=\"441\" height=\"214\" class=\"alignleft size-full wp-image-13434\" srcset=\"https:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/02_asm.png 441w, https:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/02_asm-300x146.png 300w\" sizes=\"auto, (max-width: 441px) 100vw, 441px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"http:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/03_asm-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/03_asm-1.png\" alt=\"\" width=\"572\" height=\"465\" class=\"alignleft size-full wp-image-13437\" srcset=\"https:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/03_asm-1.png 572w, https:\/\/blog.bachi.net\/wp-content\/uploads\/2022\/09\/03_asm-1-300x244.png 300w\" sizes=\"auto, (max-width: 572px) 100vw, 572px\" \/><\/a><\/td>\n<\/tr>\n<\/table>\n<table>\n<tr>\n<td><code>EORccS Rn, Rm, Op2<\/code><\/td>\n<td>Logically Exclusive OR <code>Op2<\/code> with <code>Rm<\/code> and store the result in <code>Rn<\/code>.<\/td>\n<td><code>EOR R0,R0,#4<\/code><\/tr>\n<\/tr>\n<\/table>\n<blockquote><p><code>EOR<\/code> keeps dependencies, so it can&#8217;t be executed out of order on a CPU that can OoO execute the <code>mov<\/code> from <code>xzr<\/code><\/p><\/blockquote>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\narm-none-eabi-as start.s -o start.o\r\narm-none-eabi-ld start.o -o kernel.elf\r\narm-none-eabi-objcopy kernel.elf -O binary kernel7.img\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ndefault:\r\n  arm-none-eabi-as -o start.o start.s\r\n  arm-none-eabi-gcc -c -o main.o main.c -I .\/include\r\n  arm-none-eabi-gcc -T linker.ld -o kernel7.elf start.o main.o -ffreestanding -O2 -nostdlib -lgcc\r\n  arm-none-eabi-objcopy kernel7.elf -O binary kernel7.img\r\n<\/pre>\n<p><a href=\"https:\/\/github.com\/lowlevellearning\/raspberry-pi-baremetal\">github.com\/lowlevellearning\/raspberry-pi-baremetal<\/a><br \/>\n<a href=\"https:\/\/github.com\/lowlevellearning\/raspberry-pi-baremetal-c\">github.com\/lowlevellearning\/raspberry-pi-baremetal-c<\/a><\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=NIyzh-Lshrk\">The TWO Programming Languages EVERY Beginner Should Start With (to learn how to code fast)<\/a>, C and Python<br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=jN7Fm_4ovio\">Baremetal Assembly Raspberry Pi Programming | Direct to Register Blink LED, No Operating System<\/a><br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=mshVdGlGwBs\">Raspberry Pi C\/C++ Baremetal Programming | Using C to Direct-Register Control Your Raspberry Pi<\/a><br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=jZT8APrzvc4&#038;t=328s\">BAREMETAL RUST Runs on EVERYTHING, Including the Raspberry Pi | Embedded Rust Tutorial<\/a><\/p>\n<p><!-- ------------------------------------------------------------------------------------------------ --><\/p>\n<hr\/>\n<h1>Azeria Labs<\/h1>\n<p><a href=\"https:\/\/www.linkedin.com\/in\/azeria\/\">LinkedIn<\/a><\/p>\n<p>ARM Assembly Basics<\/p>\n<ol>\n<li>Writing ARM Assembly<\/li>\n<li>ARM Data Types and Registers<\/li>\n<li>ARM Instruction set<\/li>\n<li>Memory Instructions: Load and Store<\/li>\n<li>Load and Store Multiple<\/li>\n<li>Conditional Execution and Branching<\/li>\n<li>Stack and Functions<\/li>\n<li>Assembly Basics Cheatsheet<\/li>\n<\/ol>\n<p><a href=\"https:\/\/azeria-labs.com\/writing-arm-assembly-part-1\/\">INTRODUCTION TO ARM ASSEMBLY BASICS<\/a><br \/>\n<a href=\"https:\/\/azeria-labs.com\/arm-data-types-and-registers-part-2\/\">DATA TYPES<\/a><br \/>\n<a href=\"https:\/\/azeria-labs.com\/arm-instruction-set-part-3\/\">ARM &#038; THUMB<\/a><br \/>\n<a href=\"https:\/\/azeria-labs.com\/memory-instructions-load-and-store-part-4\/\">MEMORY INSTRUCTIONS: LOAD AND STORE<\/a><br \/>\n<a href=\"https:\/\/azeria-labs.com\/load-and-store-multiple-part-5\/\">LOAD\/STORE MULTIPLE<\/a><br \/>\n<a href=\"https:\/\/azeria-labs.com\/arm-conditional-execution-and-branching-part-6\/\">CONDITIONAL EXECUTION<\/a><br \/>\n<a href=\"https:\/\/azeria-labs.com\/functions-and-the-stack-part-7\/\">STACK AND FUNCTIONS\/a><br \/>\n<a href=\"https:\/\/azeria-labs.com\/assembly-basics-cheatsheet\/\">ARM ASSEMBLY BASICS CHEATSHEET<\/a><\/p>\n<p>ARM Exploit Development<\/p>\n<ol>\n<li>Writing ARM Shellcode<\/li>\n<li>TCP Bind Shell (ARM 32-bit)<\/li>\n<li>TCP Reverse Shell (ARM 32-bit)<\/li>\n<li>Process Memory and Memory Corruption<\/li>\n<li>Stack Overflows (Arm32)<\/li>\n<li>Return Oriented Programming (Arm32)<\/li>\n<li>Stack Overflow Challenges<\/li>\n<li>Process Continuation Shellcode<\/li>\n<li>Introduction to Glibc Heap (malloc)<\/li>\n<li>Introduction to Glibc Heap (free, bins)<\/li>\n<li>Heap Exploit Development (Part 1)<\/li>\n<li>Heap Overflows and iOS Kernel (Part 2)<\/li>\n<li>Grooming the iOS Kernel Heap (Part 3)<\/li>\n<\/ol>\n<p><a href=\"https:\/\/azeria-labs.com\/writing-arm-shellcode\/\">INTRODUCTION TO WRITING ARM SHELLCODE<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Low Level Learning EORccS Rn, Rm, Op2 Logically Exclusive OR Op2 with Rm and store the result in Rn. EOR R0,R0,#4 EOR keeps dependencies, so it can&#8217;t be executed out of order on a CPU that can OoO execute the mov from xzr arm-none-eabi-as start.s -o start.o arm-none-eabi-ld start.o -o kernel.elf arm-none-eabi-objcopy kernel.elf -O binary [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13430","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/13430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13430"}],"version-history":[{"count":11,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/13430\/revisions"}],"predecessor-version":[{"id":13445,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/13430\/revisions\/13445"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}