jacksonmowry 3166ce7957 change 'carrige' to 'carriage' %!s(int64=2) %!d(string=hai) anos
..
Makefile 426205e2a3 Added makefiles for LLVM Clang %!s(int64=5) %!d(string=hai) anos
Makefile.clang 9c5c2813a0 Update QEMU command in all README and Makefile %!s(int64=2) %!d(string=hai) anos
Makefile.gcc 9c5c2813a0 Update QEMU command in all README and Makefile %!s(int64=2) %!d(string=hai) anos
OLVASSEL.md a2ce05070e Fixes in comments %!s(int64=6) %!d(string=hai) anos
README.md 4bfded0411 Further Nitpicks %!s(int64=4) %!d(string=hai) anos
gpio.h 7ace64ba9f Initial commit %!s(int64=6) %!d(string=hai) anos
kernel8.img 8ce0f75b47 Recompiled with latest gcc %!s(int64=4) %!d(string=hai) anos
link.ld 7ace64ba9f Initial commit %!s(int64=6) %!d(string=hai) anos
main.c 7ace64ba9f Initial commit %!s(int64=6) %!d(string=hai) anos
start.S ea4691947c Improve comments wrt stack setup %!s(int64=3) %!d(string=hai) anos
uart.c 3166ce7957 change 'carrige' to 'carriage' %!s(int64=2) %!d(string=hai) anos
uart.h 7ace64ba9f Initial commit %!s(int64=6) %!d(string=hai) anos

README.md

Tutorial 03 - UART1, Auxilary mini UART

It is time for the famous Hello World example. We're going to write on the UART1 first, as it's easier to program as it has a fixed clocked frequency.

NOTE: qemu does not redirect UART1 to terminal by default, only UART0, so you have to use -serial null -serial stdio.

Gpio.h

We have a new header file. This defines the base MMIO address, and the GPIO controller's addresses. This file going to be very popular, as many devices need it.

Uart.h, uart.c

A very minimal implementation.

uart_init() initializes the device and maps it to the GPIO ports.

uart_send(c) sends a character over the serial line.

uart_getc() receives a character. The carrige return character (13) will be converted into a newline character (10).

uart_puts(s) prints out a string. On newline, a carrige return character will also be sent (13 + 10).

Main

First, we have to call the uart initialization code. Then, it'll return "Hello World!". If you've purchased an USB serial cable, you should see it on minicom's screen. After that every character typed in minicom will be echoed back. If you haven't turned off local echo, that means you'll see every pressed key twice.