CVSROOT: /home/cvs
Module name: arcboot
Changes by: ths@ftp.linux-mips.org 05/09/16 22:26:10
Modified files:
. : Makefile
common : version.h
debian : changelog control rules
ext2load : Makefile ext2io.c loader.c
tip22 : tftpload.c
Added files:
debian/po : cs.po vi.po
Log message:
arcboot 0.3.8.7:
* Add vietnamese translation, thanks Clytie Siddall (Closes: #313114).
* Add czech translation, thanks Miroslav Kure (Closes: #317662).
* Switch from the local e2fslib to the up-to-date libext2fs-nopic.a
in Debian, but don't delete the old version for now.
* Avoid inclusion of kernel headers.
diff -urN arcboot/Makefile arcboot/Makefile
--- arcboot/Makefile 2004/11/29 10:52:21 1.3
+++ arcboot/Makefile 2005/09/16 21:26:10 1.4
@@ -10,9 +10,6 @@
# these contain subarch independent files
SUBARCH_INDEP_DIRS= \
arclib \
- e2fslib/util \
- e2fslib/et \
- e2fslib \
tip22
# these contain subarch dependent files
diff -urN arcboot/common/version.h arcboot/common/version.h
--- arcboot/common/version.h 2005/02/06 01:01:05 1.4
+++ arcboot/common/version.h 2005/09/16 21:26:10 1.5
@@ -1 +1 @@
-#define __ARCSBOOT_VERSION__ "0.3.8.6"
+#define __ARCSBOOT_VERSION__ "0.3.8.7"
diff -urN arcboot/debian/changelog arcboot/debian/changelog
--- arcboot/debian/changelog 2005/02/06 01:01:05 1.4
+++ arcboot/debian/changelog 2005/09/16 21:26:10 1.5
@@ -1,3 +1,13 @@
+arcboot (0.3.8.7) UNRELEASED; urgency=low
+
+ * Add vietnamese translation, thanks Clytie Siddall (Closes: #313114).
+ * Add czech translation, thanks Miroslav Kure (Closes: #317662).
+ * Switch from the local e2fslib to the up-to-date libext2fs-nopic.a
+ in Debian, but don't delete the old version for now.
+ * Avoid inclusion of kernel headers.
+
+ -- Thiemo Seufer <ths@debian.org> Fri, 16 Sep 2005 23:24:46 +0200
+
arcboot (0.3.8.6) unstable; urgency=low
* Allow ELF64 kernels for tip22/tip32.
diff -urN arcboot/debian/control arcboot/debian/control
--- arcboot/debian/control 2005/02/05 21:55:26 1.2
+++ arcboot/debian/control 2005/09/16 21:26:10 1.3
@@ -3,9 +3,8 @@
Priority: optional
Maintainer: Guido Guenther <agx@debian.org>
Uploaders: Thiemo Seufer <ths@debian.org>
-Build-Depends: debhelper (>=4.1.16)
-Build-Conflicts: e2fslibs-dev
-Standards-Version: 3.6.1
+Build-Depends: debhelper (>=4.1.16), e2fslibs-dev
+Standards-Version: 3.6.2
Package: arcboot
Architecture: mips
diff -urN arcboot/debian/rules arcboot/debian/rules
--- arcboot/debian/rules 2004/11/29 10:52:21 1.2
+++ arcboot/debian/rules 2005/09/16 21:26:10 1.3
@@ -42,7 +42,6 @@
clean:
dh_testdir
- dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
diff -urN arcboot/debian/po/cs.po arcboot/debian/po/cs.po
--- arcboot/debian/po/cs.po 1970/01/01 00:00:00
+++ arcboot/debian/po/cs.po 2005-09-16 22:26:10.634778000 +0100 1.1
@@ -0,0 +1,40 @@
+#
+# Translators, if you are not familiar with the PO format, gettext
+# documentation is worth reading, especially sections dedicated to
+# this format, e.g. by running:
+# info -n '(gettext)PO Files'
+# info -n '(gettext)Header Entry'
+#
+# Some information specific to po-debconf are available at
+# /usr/share/doc/po-debconf/README-trans
+# or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+# Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: arcboot\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2003-08-05 09:42+0200\n"
+"PO-Revision-Date: 2005-07-10 16:11+0200\n"
+"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
+"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Description
+#: ../templates:4
+msgid "Where to put arcboot?"
+msgstr "Kam chcete arcboot nainstalovat?"
+
+#. Description
+#: ../templates:4
+msgid ""
+"Arcboot must be put into the volume header of a disk with a SGI disklabel. "
+"Usually the volume header of /dev/sda is used. Please give the device name "
+"of the disk you want to put arcboot onto."
+msgstr ""
+"Arcboot se musà nainstalovat do hlaviÄ?ky svazku na disk obsahujÃcà SGI "
+"disklabel. Obvykle se použÃvá /dev/sda. Zadejte prosÃm jméno zaÅ?ÃzenÃ
"
+"disku, na který chcete arcboot nainstalovat."
diff -urN arcboot/debian/po/vi.po arcboot/debian/po/vi.po
--- arcboot/debian/po/vi.po 1970/01/01 00:00:00
+++ arcboot/debian/po/vi.po 2005-09-16 22:26:10.647445000 +0100 1.1
@@ -0,0 +1,29 @@
+# Vietnamese translation for arcboot.
+# Copyright © 2005 Free Software Foundation, Inc.
+# Clytie Siddall <clytie@riverland.net.au>, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: arcboot 0.3.8.6\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2003-08-05 09:42+0200\n"
+"PO-Revision-Date: 2005-06-12 11:33+0930\n"
+"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
+"Language-Team: Vietnamese <gnomevi-list@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0\n"
+
+#. Description
+#: ../templates:4
+msgid "Where to put arcboot?"
+msgstr "Bạn có muá»?n Ä?á»? trình arcboot và o chá»? nà o?"
+
+#. Description
+#: ../templates:4
+msgid ""
+"Arcboot must be put into the volume header of a disk with a SGI disklabel. "
+"Usually the volume header of /dev/sda is used. Please give the device name "
+"of the disk you want to put arcboot onto."
+msgstr "Phải Ä?á»? trình arcboot và o phần Ä?ầu khá»?i tin cá»§a má»?t
Ä?Ä©a có nhãn Ä?Ä©a SGI. Thưá»?ng dùng phần Ä?ầu khá»?i tin cá»§a
«/dev/sda». Hãy nháºp tên thiết bá»? cá»§a Ä?Ä©a nÆ¡i bạn muá»?n Ä?á»?
trình arcboot."
diff -urN arcboot/ext2load/Makefile arcboot/ext2load/Makefile
--- arcboot/ext2load/Makefile 2004/11/29 10:52:21 1.4
+++ arcboot/ext2load/Makefile 2005/09/16 21:26:10 1.5
@@ -7,9 +7,11 @@
COMMONDIR = ../common
-E2FSLIBDIR = ../e2fslib
-EXT2LIB = $(E2FSLIBDIR)/libext2fs.a
+E2FSINCLUDEDIR ?= /usr/include/ext2fs
+E2FSLIBDIR ?= /usr/lib
+EXT2LIB ?= $(E2FSLIBDIR)/libext2fs-nopic.a
+ARCINCLUDEDIR = ../arclib
ARCLIBDIR = ../arclib
ARCLIB = $(ARCLIBDIR)/libarc.a
@@ -17,8 +19,8 @@
LIBS = $(EXT2LIB) $(ARCLIB)
TARGETS = ext2load
-CFLAGS = -O2 -I $(COMMONDIR) -I$(ARCLIBDIR) -I$(E2FSLIBDIR) \
- -Wall -mno-abicalls -G 0 -fno-pic \
+CFLAGS = -O2 -I$(COMMONDIR) -I$(ARCINCLUDEDIR) -I$(E2FSINCLUDEDIR) \
+ -W -Wall -mno-abicalls -G 0 -fno-pic \
-DSUBARCH=${SUBARCH}
# uncomment for debugging
diff -urN arcboot/ext2load/ext2io.c arcboot/ext2load/ext2io.c
--- arcboot/ext2load/ext2io.c 2004/11/29 12:39:31 1.4
+++ arcboot/ext2load/ext2io.c 2005/09/16 21:26:10 1.5
@@ -136,14 +136,14 @@
static errcode_t arc_flush(io_channel channel);
static struct struct_io_manager struct_arc_manager = {
- EXT2_ET_MAGIC_IO_MANAGER,
- "ARC PROM I/O Manager",
- arc_open,
- arc_close,
- arc_set_blksize,
- arc_read_blk,
- arc_write_blk,
- arc_flush
+ .magic = EXT2_ET_MAGIC_IO_MANAGER,
+ .name = "ARC PROM I/O Manager",
+ .open = arc_open,
+ .close = arc_close,
+ .set_blksize = arc_set_blksize,
+ .read_blk = arc_read_blk,
+ .write_blk = arc_write_blk,
+ .flush = arc_flush,
};
io_manager arc_io_manager = &struct_arc_manager;
@@ -720,12 +720,27 @@
/* Hack in some stuff to make ext2fs library work */
+time_t time(time_t *t)
+{
+ return 0;
+}
+
+/* We can get away with those two because libext2fs uses them only in
+ fileio.c for file size calculations, and the bootloader needs not
+ to read files >2GB (famous last words...). */
+unsigned long long __udivdi3(unsigned long long numerator,
+ unsigned long long denominator)
+{
+// printf("ARGH! %s\n", __FUNCTION__);
+ return ((unsigned int)(numerator)) / ((unsigned int)(denominator));
+}
+
+unsigned long long __umoddi3(unsigned long long val, unsigned long long mod)
+{
+// printf("ARGH! %s\n", __FUNCTION__);
+ return ((unsigned int)(val)) % ((unsigned int)(mod));
+}
-struct error_table {
- char const *const *msgs;
- long base;
- int n_msgs;
-};
struct et_list {
struct et_list *next;
const struct error_table *table;
diff -urN arcboot/ext2load/loader.c arcboot/ext2load/loader.c
--- arcboot/ext2load/loader.c 2005/04/22 15:56:03 1.6
+++ arcboot/ext2load/loader.c 2005/09/16 21:26:10 1.7
@@ -17,12 +17,12 @@
#include <ext2_fs.h>
#include <ext2fs.h>
-#include <asm/addrspace.h>
-#include <asm/mipsregs.h>
#include "arcboot.h"
#include <subarch.h>
+#define KSEG0ADDR(addr) (((addr) & 0x1fffffff) | 0x80000000)
+
#define ANSI_CLEAR "\033[2J"
#define CONF_FILE "/etc/arcboot.conf"
@@ -126,7 +126,7 @@
int isEnvVar(const char* arg)
{
- int i;
+ unsigned int i;
for (i = 0; i < NENTS(env_vars); i++) {
if(strncmp( env_vars[i], arg, strlen(env_vars[i]) ) == 0)
@@ -180,6 +180,126 @@
return 0;
}
+int LoadProgramSegments32(ext2_file_t file, Elf_Ehdr * header, void *segments)
+{
+ int idx;
+ int loaded = 0;
+ Elf32_Phdr* segment=(Elf32_Phdr*)segments;
+ errcode_t status;
+ size_t size;
+
+ printf("Loading 32-bit executable\n\r");
+
+ for (idx = 0; idx < header->header32.e_phnum; idx++) {
+ if (segment->p_type == PT_LOAD) {
+ printf
+ ("Loading program segment %u at 0x%x, offset=0x%x, size
= 0x%x\n\r",
+ idx + 1, KSEG0ADDR(segment->p_vaddr),
+ segment->p_offset, segment->p_filesz);
+
+ status =
+ ext2fs_file_lseek(file, segment->p_offset,
+ EXT2_SEEK_SET, NULL);
+ if (status != 0) {
+ print_ext2fs_error(status);
+ Fatal("Cannot seek to program segment\n\r");
+ }
+
+ arc_do_progress = 1;
+ status = ext2fs_file_read(file,
+ (void *) (KSEG0ADDR(
+ segment->p_vaddr)),
+ segment->p_filesz, NULL);
+ printf("\n\n\r"); /* Clear progress */
+ arc_do_progress = 0;
+ if (status != 0) {
+ print_ext2fs_error(status);
+ Fatal("Cannot read program segment\n\r");
+ }
+
+ size = segment->p_memsz - segment->p_filesz;
+ if (size > 0) {
+ printf
+ ("Zeroing memory at 0x%x, size = 0x%x\n\r",
+ (KSEG0ADDR(segment->p_vaddr +
+ segment->p_filesz)), size);
+ memset((void *)
+ (KSEG0ADDR(segment->
+ p_vaddr + segment->p_filesz)), 0, size);
+ }
+
+ loaded = 1;
+ }
+
+ segment =
+ (Elf32_Phdr *) (((char *) segment) +
+ header->header32.e_phentsize);
+ }
+
+ return loaded;
+}
+
+int LoadProgramSegments64(ext2_file_t file, Elf_Ehdr * header, void *segments)
+{
+ int idx;
+ int loaded = 0;
+ Elf64_Phdr* segment=(Elf64_Phdr*)segments;
+ errcode_t status;
+ size_t size;
+
+ is64=1;
+ printf("Loading 64-bit executable\n\r");
+
+ for (idx = 0; idx < header->header64.e_phnum; idx++) {
+ if (segment->p_type == PT_LOAD) {
+ printf ("Loading program segment %u at 0x%x, "
+ "offset=0x%lx %lx, size = 0x%lx %lx\n\r",
+ idx + 1,
+ (int)KSEG0ADDR(segment->p_vaddr),
+ (long)(segment->p_offset>>32),
+ (long)(segment->p_offset&0xffffffff),
+ (long)(segment->p_filesz>>32),
+ (long)(segment->p_filesz&0xffffffff));
+
+ status =
+ ext2fs_file_lseek(file, segment->p_offset,
+ EXT2_SEEK_SET, NULL);
+ if (status != 0) {
+ print_ext2fs_error(status);
+ Fatal("Cannot seek to program segment\n\r");
+ }
+
+ arc_do_progress = 1;
+ status = ext2fs_file_read(file,
+ (void *) (KSEG0ADDR(
+ segment->p_vaddr)),
+ segment->p_filesz, NULL);
+ arc_do_progress = 0;
+ if (status != 0) {
+ print_ext2fs_error(status);
+ Fatal("Cannot read program segment\n\r");
+ }
+
+ size = segment->p_memsz - segment->p_filesz;
+ if (size > 0) {
+ printf
+ ("Zeroing memory at 0x%lx, size = 0x%lx\n\r",
+ (KSEG0ADDR(segment->p_vaddr +
+ segment->p_filesz)), size);
+ memset((void *)
+ (KSEG0ADDR(segment->
+ p_vaddr + segment->p_filesz)), 0, size);
+ }
+
+ loaded = 1;
+ }
+
+ segment = (Elf64_Phdr *) (((char *) segment)
+ + header->header64.e_phentsize);
+ }
+
+ return loaded;
+}
void LoadProgramSegments(ext2_file_t file, Elf_Ehdr * header)
{
@@ -225,104 +345,10 @@
Fatal("Cannot read program segment headers\n\r");
}
- if(header->e_ident[EI_CLASS] == ELFCLASS32) {
- Elf32_Phdr* segment=(Elf32_Phdr*)segments;
- printf("Loading 32-bit executable\n\r");
- for (idx = 0; idx < header->header32.e_phnum; idx++) {
- if (segment->p_type == PT_LOAD) {
- printf
- ("Loading program segment %u at 0x%x,
offset=0x%x, size = 0x%x\n\r",
- idx + 1, KSEG0ADDR(segment->p_vaddr),
- segment->p_offset, segment->p_filesz);
-
- status =
- ext2fs_file_lseek(file, segment->p_offset,
- EXT2_SEEK_SET, NULL);
- if (status != 0) {
- print_ext2fs_error(status);
- Fatal("Cannot seek to program segment\n\r");
- }
-
- arc_do_progress = 1;
- status = ext2fs_file_read(file,
- (void *) (KSEG0ADDR(
- segment->p_vaddr)),
- segment->p_filesz, NULL);
- printf("\n\n\r"); /* Clear progress */
- arc_do_progress = 0;
- if (status != 0) {
- print_ext2fs_error(status);
- Fatal("Cannot read program segment\n\r");
- }
-
- size = segment->p_memsz - segment->p_filesz;
- if (size > 0) {
- printf
- ("Zeroing memory at 0x%x, size =
0x%x\n\r",
- (KSEG0ADDR(segment->p_vaddr +
- segment->p_filesz)), size);
- memset((void *)
- (KSEG0ADDR(segment->
- p_vaddr + segment->p_filesz)), 0,
size);
- }
-
- loaded = True;
- }
-
- segment =
- (Elf32_Phdr *) (((char *) segment) +
- header->header32.e_phentsize);
- }
- } else {
- Elf64_Phdr* segment=(Elf64_Phdr*)segments;
- is64=1;
- printf("Loading 64-bit executable\n\r");
- for (idx = 0; idx < header->header64.e_phnum; idx++) {
- if (segment->p_type == PT_LOAD) {
- printf
- ("Loading program segment %u at 0x%x,
offset=0x%lx %lx, size = 0x%lx %lx\n\r",
- idx + 1, KSEG0ADDR(segment->p_vaddr),
-
(long)(segment->p_offset>>32),(long)(segment->p_offset&0xffffffff),
-
(long)(segment->p_filesz>>32),(long)(segment->p_filesz&0xffffffff));
-
- status =
- ext2fs_file_lseek(file, segment->p_offset,
- EXT2_SEEK_SET, NULL);
- if (status != 0) {
- print_ext2fs_error(status);
- Fatal("Cannot seek to program segment\n\r");
- }
-
- arc_do_progress = 1;
- status = ext2fs_file_read(file,
- (void *) (KSEG0ADDR(
- segment->p_vaddr)),
- segment->p_filesz, NULL);
- arc_do_progress = 0;
- if (status != 0) {
- print_ext2fs_error(status);
- Fatal("Cannot read program segment\n\r");
- }
-
- size = segment->p_memsz - segment->p_filesz;
- if (size > 0) {
- printf
- ("Zeroing memory at 0x%x, size =
0x%x\n\r",
- (KSEG0ADDR(segment->p_vaddr +
- segment->p_filesz)), size);
- memset((void *)
- (KSEG0ADDR(segment->
- p_vaddr + segment->p_filesz)), 0,
size);
- }
-
- loaded = True;
- }
-
- segment =
- (Elf64_Phdr *) (((char *) segment) +
- header->header64.e_phentsize);
- }
- }
+ if(header->e_ident[EI_CLASS] == ELFCLASS32)
+ loaded = LoadProgramSegments32(file, header, segments);
+ else
+ loaded = LoadProgramSegments64(file, header, segments);
if (!loaded)
Fatal("No loadable program segments found\n\r");
@@ -437,14 +463,15 @@
void _start64(LONG argc, CHAR * argv[], CHAR * envp[],
unsigned long long *addr)
{
- asm volatile (".set push\n"
- "\t.set mips3\n"
- "\t.set noreorder\n"
- "\t.set noat\n"
- "\tld $1, 0($7)\n"
- "\tjr $1\n"
- "\t nop\n"
- "\t.set pop");
+ __asm__ __volatile__(
+ ".set push\n"
+ "\t.set mips3\n"
+ "\t.set noreorder\n"
+ "\t.set noat\n"
+ "\tld $1, 0($7)\n"
+ "\tjr $1\n"
+ "\t nop\n"
+ "\t.set pop");
}
void _start(LONG argc, CHAR *argv[], CHAR *envp[])
diff -urN arcboot/tip22/tftpload.c arcboot/tip22/tftpload.c
--- arcboot/tip22/tftpload.c 2005/02/06 01:01:05 1.3
+++ arcboot/tip22/tftpload.c 2005/09/16 21:26:10 1.4
@@ -16,11 +16,11 @@
#include <sys/types.h>
-#include <asm/addrspace.h>
-
#include <version.h>
#include <subarch.h>
+#define KSEG0ADDR(addr) (((addr) & 0x1fffffff) | 0x80000000)
+
#define ANSI_CLEAR "\033[2J"
typedef enum { False = 0, True } Boolean;
|