# HG changeset patch # User Josef 'Jeff' Sipek # Date 1565114627 14400 # Tue Aug 06 14:03:47 2019 -0400 # Node ID affc76f4b4b5f69f730ae71f6ef2f0283a7ca6f4 # Parent 39cbb375e1b09d08a2332a909f6f645d3cc686cd installer: use sastart Signed-off-by: Josef 'Jeff' Sipek diff --git a/installer/installer/Makefile b/installer/installer/Makefile --- a/installer/installer/Makefile +++ b/installer/installer/Makefile @@ -21,8 +21,7 @@ # BIN= installer -SRCS= setmode.s \ - loader_c.c \ +SRCS= loader_c.c \ loader_asm.s \ cpio.c \ malloc.c \ @@ -31,7 +30,8 @@ CFLAGS.OPT= -Os -LD_ADD= $(SRCTOP)/lib/lib.a +LD_ADD= $(SRCTOP)/lib/lib.a \ + $(SRCTOP)/sastart/sastart.a .include <${.CURDIR:H:H}/build.mk> diff --git a/installer/installer/linker.script b/installer/installer/linker.script --- a/installer/installer/linker.script +++ b/installer/installer/linker.script @@ -22,7 +22,7 @@ SECTIONS { - ENTRY(MAIN) + ENTRY(_start390) . = 0x100000; .text : { diff --git a/installer/installer/loader_c.c b/installer/installer/loader_c.c --- a/installer/installer/loader_c.c +++ b/installer/installer/loader_c.c @@ -263,7 +263,7 @@ ); } -void load_nucleus(void) +void start(void) { char inp[160]; diff --git a/installer/installer/setmode.s b/installer/installer/setmode.s deleted file mode 100644 --- a/installer/installer/setmode.s +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2007-2011 Josef 'Jeff' Sipek - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -.globl MAIN - .type MAIN, @function -MAIN: -# -# At this point, the machine is running in ESA390 mode. Let's load a new -# PSW, making it switch to 64-bit mode -# - - # switch to 64-bit mode - # - # Signal Processor - # Order 0x12: Set Architecture - # R1 bits 56-63 = 0x01 (switch all CPUs to z/Arch) - SR %r1, %r1 - LHI %r1, 0x1 # switch all to z/Arch - SR %r3, %r3 # CPU Address (CPU0000) - SIGP %r1, %r3, 0x12 # Signal, order 0x12 - SAM64 - # On error: - # Bit 55 = 1, cc1 (inval param) - # Bit 54 = 1, cc1 (incorrect state) - - # FIXME: check for errors? - -# -# At this point, we should be in 64-bit mode -# - - # - # It is unfortunate that the below code is required. - # - # Let's set the stack pointer to make gcc happy - # - # A standard stack frame is 160 bytes. - # - - # r15 = 0x100000 - # = (1 << 20) - # - SGR %r15, %r15 - LGHI %r15, 0x1 - SLLG %r15, %r15, 20 - AGHI %r15, -160 - - BRC 15,load_nucleus