changeset 703:affc76f4b4b5

installer: use sastart Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Tue, 06 Aug 2019 14:03:47 -0400
parents 39cbb375e1b0
children 8efd177e5dd0
files installer/installer/Makefile installer/installer/linker.script installer/installer/loader_c.c installer/installer/setmode.s
diffstat 4 files changed, 5 insertions(+), 72 deletions(-) [+]
line wrap: on
line diff
--- a/installer/installer/Makefile	Sun Aug 11 16:18:46 2019 -0400
+++ b/installer/installer/Makefile	Tue Aug 06 14:03:47 2019 -0400
@@ -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>
 
--- a/installer/installer/linker.script	Sun Aug 11 16:18:46 2019 -0400
+++ b/installer/installer/linker.script	Tue Aug 06 14:03:47 2019 -0400
@@ -22,7 +22,7 @@
 
 SECTIONS
 {
-  ENTRY(MAIN)
+  ENTRY(_start390)
   . = 0x100000;
 
   .text : {
--- a/installer/installer/loader_c.c	Sun Aug 11 16:18:46 2019 -0400
+++ b/installer/installer/loader_c.c	Tue Aug 06 14:03:47 2019 -0400
@@ -263,7 +263,7 @@
 	);
 }
 
-void load_nucleus(void)
+void start(void)
 {
 	char inp[160];
 
--- a/installer/installer/setmode.s	Sun Aug 11 16:18:46 2019 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2007-2011 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
- *
- * 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