From e9c96014f48bc86ee5c7f16c2429ca201f20d2dc Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Thu, 19 Oct 2006 17:34:18 +0000 Subject: [PATCH] apple_driver: initial revision --- apple_driver/Makefile | 37 ++++++++++++++++++++++++++++++++++ apple_driver/head.S | 47 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 apple_driver/Makefile create mode 100644 apple_driver/head.S diff --git a/apple_driver/Makefile b/apple_driver/Makefile new file mode 100644 index 0000000..f0a8644 --- /dev/null +++ b/apple_driver/Makefile @@ -0,0 +1,37 @@ +# +# +# (c) 2004,2005 Laurent Vivier +# +# + +TOP = $(shell pwd) +VPATH = $(TOP) + +ASFLAGS = -I$(TOP) + +CFLAGS = $(OPT_CFLAGS) -nostdlib -nodefaultlibs -Wall -Werror -Wno-multichar -fpic -O2 + +SOURCES = head.S + +.PHONY: all + +all: apple_driver + +apple_driver: apple_driver.o + $(OBJCOPY) -j .text -j .data -j .rodata -j .got \ + -O binary apple_driver.o apple_driver + +apple_driver.o: head.o + $(LD) -o apple_driver.o head.o + +.S.o: + $(AS) $(ASFLAGS) -o $@ $^ + +install:: + install -d $(DESTDIR)/$(PREFIX)/lib/emile/ + install first_floppy $(DESTDIR)/$(PREFIX)/lib/emile/apple_driver + +uninstall:: + rm -f $(DESTDIR)/$(PREFIX)/lib/emile/apple_driver + +include $(TOP)/../Rules.mk diff --git a/apple_driver/head.S b/apple_driver/head.S new file mode 100644 index 0000000..47f68cb --- /dev/null +++ b/apple_driver/head.S @@ -0,0 +1,47 @@ +/* + * + * (c) 2006 Laurent Vivier + * + * based on http://developer.apple.com/technotes/tn/tn1189.html + * + */ + + .chip 68000 + .align 4 + + .global _start +_start: +primary_entry_point: + bra.w primary_setup + dc.w 0x0001 + +secondary_entry_point: + bra.w secondary_setup + +_driver_name: + .string ".DebianCD" +_version: + dc.w 0x001 +_id: + .string "Debian SCSI 0.0.1" + + .string "Dummy AppleDriver for Debian boot CD" + .string "(c) 2006 Laurent Vivier " + .string "All files are distributed under the terms of GPLv2 license." + + .align 4 +primary_setup: + ori.l #0x0f000000, %d5 + +secondary_setup: + + movem.l %d1-%a4,%sp@- + move.l %d5, %sp@- + jsr %pc@(driver_entry) + add.l #4, %sp + movem.l %sp@+, %d1-%a4 + rts + +driver_entry: + moveq.l #0, %d0 + rts