* Quik 2.0e patches and issues
@ 2000-03-13 1:12 Daniel Jacobowitz
2000-03-13 19:41 ` Cort Dougan
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Jacobowitz @ 2000-03-13 1:12 UTC (permalink / raw)
To: cort; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1699 bytes --]
Well, I finally got quik 2.0* to work on my hardware (7300, Oldworld power
macintosh) again. It required a couple of patches which I'm not quite sure
about, so I wanted to get your opinion on them.
In order:
- The first chunk is to deal with the type of dev_t. I'm not entirely sure
why it is necessary, but it most definitely is. Otherwise PART always comes
out as zero.
- The second is the really important part, and I'm really confused as to
why it was necessary. Without -N, the data section gets thoroughly trashed.
This leads to e2fslibs returning an error code because the magic field of
the struct_linux_manager is clobbered, as is the value in linux_io_manager.
protect[] does not seem to help. My guess is the lack of page-aligning the
data segment made the difference. Why did you decide to remove -N?
- The two adds of a __KERNEL__ are a workaround for a bug with the altivec
types in 2.2's headers - it should be fixed there rather than in quik, and
I'll send you a patch for that later this week when I go through my kernel
tree. I have a matching accumulation of little fixes for there.
- The boot logic. I don't understand how start += entry can ever be right;
shouldn't it be start = entry? I don't remember why I had start = load_loc
in my tree, but it seems to work; I suspect that isn't right either.
Dan
/--------------------------------\ /--------------------------------\
| Daniel Jacobowitz |__| SCS Class of 2002 |
| Debian GNU/Linux Developer __ Carnegie Mellon University |
| dan@debian.org | | dmj+@andrew.cmu.edu |
\--------------------------------/ \--------------------------------/
[-- Attachment #2: quik.diff --]
[-- Type: text/plain, Size: 2314 bytes --]
diff -ur quik-2.0e/quik/quik.c quik-work/quik/quik.c
--- quik-2.0e/quik/quik.c Fri Mar 10 15:59:28 2000
+++ quik-work/quik/quik.c Sun Mar 12 14:31:22 2000
@@ -55,8 +55,8 @@
int unit_shift;
int part_mask;
-#define UNIT(dev) (MINOR(dev) >> unit_shift)
-#define PART(dev) (MINOR(dev) & part_mask)
+#define UNIT(dev) (((int)MINOR(dev)) >> unit_shift)
+#define PART(dev) (((int)MINOR(dev)) & part_mask)
#define swab_32(x) ((((x) >> 24) & 0xff) + (((x) >> 8) & 0xff00) \
+ (((x) & 0xff00) << 8) + (((x) & 0xff) << 24))
diff -ur quik-2.0e/second/Makefile quik-work/second/Makefile
--- quik-2.0e/second/Makefile Fri Mar 10 15:59:28 2000
+++ quik-work/second/Makefile Sun Mar 12 14:35:29 2000
@@ -4,7 +4,7 @@
CFLAGS = -I../include -O2 -D__NO_STRING_INLINES
-LDFLAGS= -Ttext 0x3e0000
+LDFLAGS=-N -Ttext 0x3e0000
OBJS = crt0.o printf.o malloc.o main.o cmdline.o disk.o file.o \
cfg.o strtol.o prom.o cache.o string.o setjmp.o ctype.o \
diff -ur quik-2.0e/second/main.c quik-work/second/main.c
--- quik-2.0e/second/main.c Fri Mar 10 15:59:28 2000
+++ quik-work/second/main.c Sun Mar 12 14:42:46 2000
@@ -29,6 +29,7 @@
#include "quik.h"
#include <string.h>
+#define __KERNEL__
#include <linux/elf.h>
#include <layout.h>
#ifdef BOOTINFO
@@ -497,10 +501,17 @@
* point may actually be a procedure descriptor.
*/
start = *(unsigned *)entry;
- if (start < load_loc || start >= load_loc + len
- || ((unsigned *)entry)[2] != 0)
- /* doesn't look like a procedure descriptor */
- start += entry;
+ /* new boot strategy - see head.S in the kernel for more info -- Cort */
+ if (start == 0x60000000/* nop */ )
+ start = load_loc;
+ /* not the new boot strategy, use old logic -- Cort */
+ else
+ {
+ if (start < load_loc || start >= load_loc + len
+ || ((unsigned *)entry)[2] != 0)
+ /* doesn't look like a procedure descriptor */
+ start += entry;
+ }
printf("Starting at %x\n", start);
#ifdef BOOTINFO
/* setup the bootinfo */
diff -ur quik-2.0e/util/elfextract.c quik-work/util/elfextract.c
--- quik-2.0e/util/elfextract.c Fri Mar 10 15:59:28 2000
+++ quik-work/util/elfextract.c Sun Mar 12 12:46:21 2000
@@ -4,6 +4,7 @@
* Copyright 1996 Paul Mackerras.
*/
#include <stdio.h>
+#define __KERNEL__
#include <linux/elf.h>
FILE *fi, *fo;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Quik 2.0e patches and issues
2000-03-13 1:12 Quik 2.0e patches and issues Daniel Jacobowitz
@ 2000-03-13 19:41 ` Cort Dougan
0 siblings, 0 replies; 2+ messages in thread
From: Cort Dougan @ 2000-03-13 19:41 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: linuxppc-dev
Great, thanks for the patches. I did some hacks to quik for chrp and
called it quik-2.0. I wasn't even sure it worked on powermac hardware :)
Thanks for the patches! I'll look into folding them in.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-03-13 19:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-03-13 1:12 Quik 2.0e patches and issues Daniel Jacobowitz
2000-03-13 19:41 ` Cort Dougan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).