source: mainline/kernel/genarch/Makefile.inc@ 84176f3

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 84176f3 was 84176f3, checked in by Jakub Jermář <jakub@…>, 6 years ago

arm64: Add support for the architecture

This changeset adds basic support to run HelenOS on AArch64, targeting
the QEMU virt platform.

Boot:

  • Boot relies on the EDK II firmware, GRUB2 for EFI and the HelenOS bootloader (UEFI application). EDK II loads GRUB2 from a CD, GRUB2 loads the HelenOS bootloader (via UEFI) which loads OS components.
  • UEFI applications use the PE/COFF format and must be relocatable. The first problem is solved by manually having the PE/COFF headers and tables written in assembler. The relocatable requirement is addressed by compiling the code with -fpic and having the bootloader relocate itself at its startup.

Kernel:

  • Kernel code for AArch64 consists mostly of stubbing out various architecture-specific hooks: virtual memory management, interrupt and exception handling, context switching (including FPU lazy switching), support for virtual timer, atomic sequences and barriers, cache and TLB maintenance, thread and process initialization.
  • The patch adds a kernel driver for GICv2 (interrupt controller).
  • The PL011 kernel driver is extended to allow userspace to take ownership of the console.
  • The current code is not able to dynamically obtain information about available devices on the underlying machine. The port instead implements a machine-func interface similar to the one implemented by arm32. It defines a machine for the QEMU AArch64 virt platform. The configuration (device addresses and IRQ numbers) is then baked into the machine definition.

User space:

  • Uspace code for AArch64 similarly mostly implements architecture-specific hooks: context saving/restoring, syscall support, TLS support.

The patchset allows to boot the system but user interaction with the OS
is not yet possible.

  • Property mode set to 100644
File size: 4.7 KB
RevLine 
[df4ed85]1# Copyright (c) 2005 Martin Decky
[e16e036a]2# All rights reserved.
[807d2d4]3#
[e16e036a]4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions
6# are met:
[807d2d4]7#
[e16e036a]8# - Redistributions of source code must retain the above copyright
9# notice, this list of conditions and the following disclaimer.
10# - Redistributions in binary form must reproduce the above copyright
11# notice, this list of conditions and the following disclaimer in the
12# documentation and/or other materials provided with the distribution.
13# - The name of the author may not be used to endorse or promote products
14# derived from this software without specific prior written permission.
[807d2d4]15#
[e16e036a]16# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[807d2d4]26#
27
[e16e036a]28## Accepted configuration directives
29#
[807d2d4]30
[e16e036a]31ifeq ($(CONFIG_ACPI),y)
[7ba16eb]32GENARCH_SOURCES += \
33 genarch/src/acpi/acpi.c \
34 genarch/src/acpi/madt.c
[807d2d4]35endif
[af75db9]36
[6d7ffa65]37ifeq ($(CONFIG_PAGE_PT),y)
[7ba16eb]38GENARCH_SOURCES += \
39 genarch/src/mm/page_pt.c \
40 genarch/src/mm/as_pt.c
[6d7ffa65]41endif
[af75db9]42
[6d7ffa65]43ifeq ($(CONFIG_PAGE_HT),y)
[7ba16eb]44GENARCH_SOURCES += \
45 genarch/src/mm/page_ht.c \
46 genarch/src/mm/as_ht.c
[6d7ffa65]47endif
[af75db9]48
[4512d7e]49ifeq ($(CONFIG_ASID),y)
[7ba16eb]50GENARCH_SOURCES += \
51 genarch/src/mm/asid.c
[4512d7e]52endif
[af75db9]53
[6ed5352]54ifeq ($(CONFIG_ASID_FIFO),y)
[7ba16eb]55GENARCH_SOURCES += \
56 genarch/src/mm/asid_fifo.c
[6ed5352]57endif
[af75db9]58
[9b2729c]59ifeq ($(CONFIG_SOFTINT),y)
[7ba16eb]60GENARCH_SOURCES += \
61 genarch/src/softint/division.c \
62 genarch/src/softint/multiplication.c
[9b2729c]63endif
[fe050b7]64
65ifeq ($(CONFIG_FB),y)
[7ba16eb]66GENARCH_SOURCES += \
67 genarch/src/fb/font-8x16.c \
68 genarch/src/fb/fb.c \
69 genarch/src/fb/bfb.c
[fe050b7]70endif
[02f441c0]71
[1094940]72ifeq ($(CONFIG_DSRLNIN),y)
[7ba16eb]73GENARCH_SOURCES += \
74 genarch/src/drivers/dsrln/dsrlnin.c
[1094940]75endif
76
77ifeq ($(CONFIG_DSRLNOUT),y)
[7ba16eb]78GENARCH_SOURCES += \
79 genarch/src/drivers/dsrln/dsrlnout.c
[1094940]80endif
81
[02f441c0]82ifeq ($(CONFIG_I8042),y)
[7ba16eb]83GENARCH_SOURCES += \
84 genarch/src/drivers/i8042/i8042.c
[287920f]85endif
86
[87a5796]87ifeq ($(CONFIG_I8259),y)
88GENARCH_SOURCES += \
89 genarch/src/drivers/i8259/i8259.c
90endif
91
[411b6a6]92ifeq ($(CONFIG_NS16550),y)
[7ba16eb]93GENARCH_SOURCES += \
94 genarch/src/drivers/ns16550/ns16550.c
[02f441c0]95endif
[8b4be29]96
[c882505]97ifeq ($(CONFIG_PL011_UART),y)
[7ba16eb]98GENARCH_SOURCES += \
99 genarch/src/drivers/pl011/pl011.c
[8ec4144]100endif
101
[ec08286]102ifeq ($(CONFIG_S3C24XX_IRQC),y)
[7ba16eb]103GENARCH_SOURCES += \
104 genarch/src/drivers/s3c24xx/irqc.c
[ec08286]105endif
106
[f1fc83a]107ifeq ($(CONFIG_S3C24XX_UART),y)
[7ba16eb]108GENARCH_SOURCES += \
109 genarch/src/drivers/s3c24xx/uart.c
[f1fc83a]110endif
111
[b38c079]112ifeq ($(CONFIG_OMAP_UART),y)
[7ba16eb]113GENARCH_SOURCES += \
114 genarch/src/drivers/omap/uart.c
[0fb70e1]115endif
116
[42f2a45]117ifeq ($(CONFIG_AM335X_TIMERS),y)
[7ba16eb]118GENARCH_SOURCES += \
119 genarch/src/drivers/am335x/timer.c
[42f2a45]120endif
121
[44b2b78]122ifeq ($(CONFIG_BCM2835_MAILBOX),y)
[7ba16eb]123GENARCH_SOURCES += \
[67bcd81]124 genarch/src/drivers/bcm2835/irc.c \
125 genarch/src/drivers/bcm2835/mbox.c \
126 genarch/src/drivers/bcm2835/timer.c
[44b2b78]127endif
128
[84176f3]129ifeq ($(CONFIG_GICV2), y)
130GENARCH_SOURCES += \
131 genarch/src/drivers/gicv2/gicv2.c
132endif
133
[c2417bc]134ifeq ($(CONFIG_VIA_CUDA),y)
[7ba16eb]135GENARCH_SOURCES += \
136 genarch/src/drivers/via-cuda/cuda.c
[c2417bc]137endif
138
[411b6a6]139ifeq ($(CONFIG_PC_KBD),y)
[7ba16eb]140GENARCH_SOURCES += \
141 genarch/src/kbrd/kbrd.c \
142 genarch/src/kbrd/scanc_pc.c
[411b6a6]143endif
144
[5012203]145ifeq ($(CONFIG_AT_KBD),y)
146GENARCH_SOURCES += \
147 genarch/src/kbrd/kbrd_at.c \
148 genarch/src/kbrd/scanc_at.c
149endif
150
[411b6a6]151ifeq ($(CONFIG_SUN_KBD),y)
[7ba16eb]152GENARCH_SOURCES += \
153 genarch/src/kbrd/kbrd.c \
154 genarch/src/kbrd/scanc_sun.c
[8b4be29]155endif
[61e90dd]156
[2a77841d]157ifeq ($(CONFIG_MAC_KBD),y)
[7ba16eb]158GENARCH_SOURCES += \
159 genarch/src/kbrd/kbrd.c \
160 genarch/src/kbrd/scanc_mac.c
[2a77841d]161endif
162
[4c84368e]163ifeq ($(CONFIG_SRLN),y)
[7ba16eb]164GENARCH_SOURCES += \
165 genarch/src/srln/srln.c
[4c84368e]166endif
167
[411b6a6]168ifeq ($(CONFIG_OFW_TREE),y)
[7ba16eb]169GENARCH_SOURCES += \
170 genarch/src/ofw/ofw_tree.c
[e731b0d]171endif
172
173ifeq ($(CONFIG_OFW_PCI),y)
[7ba16eb]174GENARCH_SOURCES += \
175 genarch/src/ofw/ebus.c \
176 genarch/src/ofw/pci.c \
177 genarch/src/ofw/sbus.c \
178 genarch/src/ofw/upa.c
[61e90dd]179endif
[f245145]180
[5d8d71e]181ifeq ($(CONFIG_MULTIBOOT), y)
[7ba16eb]182GENARCH_SOURCES += \
[3009164]183 genarch/src/multiboot/common.c \
[7ba16eb]184 genarch/src/multiboot/multiboot.c \
185 genarch/src/multiboot/multiboot2.c
[d2f75eb]186
187GENARCH_AUTOCHECK_HEADERS += \
188 genarch/include/genarch/multiboot/multiboot_memmap_struct.h \
189 genarch/include/genarch/multiboot/multiboot_info_struct.h
[5d8d71e]190endif
191
[f245145]192ifeq ($(CONFIG_EGA), y)
[7ba16eb]193GENARCH_SOURCES += \
194 genarch/src/drivers/ega/ega.c
[f245145]195endif
[6eeb4a3]196
197ifeq ($(CONFIG_IOMAP_BITMAP), y)
[7ba16eb]198GENARCH_SOURCES += \
199 genarch/src/ddi/ddi-bitmap.c
[6eeb4a3]200endif
201
202ifeq ($(CONFIG_IOMAP_DUMMY), y)
[7ba16eb]203GENARCH_SOURCES += \
204 genarch/src/ddi/ddi-dummy.c
[6eeb4a3]205endif
206
Note: See TracBrowser for help on using the repository browser.