fixes - boots again
diff --git a/Makefile.alpha b/Makefile.alpha
index 3f2ae08..b2effad 100644
--- a/Makefile.alpha
+++ b/Makefile.alpha
@@ -35,7 +35,8 @@
OPT= -O2
CFLAGS = $(OPT) -g1 -Wall -fvisibility=hidden -fno-strict-aliasing \
-msmall-text -mno-fp-regs -mbuild-constants \
- -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast
+ -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast \
+ -Wno-stringop-overflow -Wno-array-bounds -Wno-address-of-packed-member
CFLAGS += -mcpu=ev67 -DSYSTEM_H='"sys-$(SYSTEM).h"' -DSEABIOS
# Source files
diff --git a/src/alpha/alpha.c b/src/alpha/alpha.c
index 911e917..5a1a7c3 100644
--- a/src/alpha/alpha.c
+++ b/src/alpha/alpha.c
@@ -413,12 +413,10 @@
{
int i, ret;
unsigned long *target;
- char bootblock[2048];
-
- dprintf(1, "bootloader will be loaded to %p\n", bootloader_code);
+ unsigned long bootblock[2048 / sizeof(long)];
printf("(boot dka500.5.0.2000.0 -flags 0)\n");
- target = &bootblock;
+ target = bootblock;
struct disk_op_s disk_op = {
.buf_fl = target,
.command = CMD_SEEK,
@@ -467,7 +465,7 @@
unsigned int ipl_size = target[0x1e0/sizeof(long)];
unsigned long ipl_sect = target[0x1e8/sizeof(long)];
unsigned long ipl_magic= target[0x1f0/sizeof(long)];
- unsigned long ipl_sum = target[0x1f8/sizeof(long)];
+ // unsigned long ipl_sum = target[0x1f8/sizeof(long)];
/* calc checksum of bootblock and verify */
u64 sum = 0;
@@ -544,6 +542,7 @@
/* read IPL */
bootloader_code = arch_malloc(bootloader_mem, PAGE_SIZE);
+ dprintf(1, "bootloader will be loaded to %p\n", bootloader_code);
target = bootloader_code;
printf("reading %d blocks from dka500.5.0.2000.0\n", ipl_size);
disk_op.drive_fl = boot_drive;
@@ -561,11 +560,13 @@
ret = bootloader_mem;
unsigned long pageno = 0;
while (ret > 0) {
- unsigned long virt, phys;
+ unsigned long virt;
+ char *phys;
virt = (unsigned long)INIT_BOOTLOADER + pageno * PAGE_SIZE;
- phys = (unsigned long)target + pageno * PAGE_SIZE;
+ phys = (char *)target;
+ phys += pageno * PAGE_SIZE;
set_pte (virt, phys);
- dprintf(1, "set bootloader PTE addr 0x%lx -> phys addr 0x%lx\n", virt, phys);
+ dprintf(1, "set bootloader PTE addr 0x%lx -> phys addr 0x%p\n", virt, phys);
pageno++;
ret -= PAGE_SIZE;
}
@@ -600,10 +601,11 @@
// set_pte (0x200000000UL, &page_dir); // XXX
set_pte (0x200802000UL, &page_dir); // store addr for aboot
- unsigned long *L = &page_dir; // (unsigned long *) 0x200802000UL; /* (1<<33 | 1<<23 | 1<<13) */
+ unsigned long *L = page_dir; // (unsigned long *) 0x200802000UL; /* (1<<33 | 1<<23 | 1<<13) */
dprintf(1, "L1 0x%lx\n", L[1]);
dprintf(1, "L9 0x%lx\n", L[1023]);
dprintf(1, "La 0x%lx\n", page_dir[pt_index(VPTPTR, 2)]);
+ dprintf(1, "L1 0x%lx 0x%lx\n phys", PA((L[1] >> 32) << PAGE_SHIFT), PA(&page_dir));
void *new_pc = INIT_BOOTLOADER; // target;
dprintf(1,"STARTING BOOTLOADER NOW at %p\n\n", new_pc);
diff --git a/src/alpha/alpha.h b/src/alpha/alpha.h
index eda0ad1..553fd60 100644
--- a/src/alpha/alpha.h
+++ b/src/alpha/alpha.h
@@ -67,6 +67,11 @@
#include "alpha/protos.h" /* for outl, outw, inb ... */
+static inline unsigned long rdtscll(void)
+{
+ return get_wall_time();
+}
+
static inline void insb(portaddr_t port, u8 *data, u32 count) {
while (count--)
*data++ = inb(port);
diff --git a/src/alpha/palcode.ld b/src/alpha/palcode.ld
index b525cbd..0a2164f 100644
--- a/src/alpha/palcode.ld
+++ b/src/alpha/palcode.ld
@@ -10,7 +10,7 @@
.got : { *(.got.plt) *(.got) }
.sdata : { *(.sdata*) }
.sbss : { *(.sbss) *(.scommon) }
- .bss : {
+ .bss ALIGN(8192) : {
*(.bss.page_dir)
*(.bss.stack)
*(COMMON)
diff --git a/src/boot.c b/src/boot.c
index 469f7c5..bbe592b 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -541,7 +541,7 @@
be->priority = prio;
be->data = data;
be->description = desc ?: "?";
- dprintf(3, "Registering bootable: %s (type:%d prio:%d data:%x)\n"
+ dprintf(3, "Registering bootable: %s (type:%d prio:%d data:%lx)\n"
, be->description, type, prio, data);
// Add entry in sorted order.
@@ -926,7 +926,7 @@
static void
call_boot_entry(struct segoff_s bootsegip, u8 bootdrv)
{
- dprintf(1, "Booting from %04x:%04x\n", bootsegip.seg, bootsegip.offset);
+ // dprintf(1, "Booting from %04x:%04x\n", bootsegip.seg, bootsegip.offset);
struct bregs br;
memset(&br, 0, sizeof(br));
br.flags = F_IF;
diff --git a/src/hw/ata.c b/src/hw/ata.c
index 232e01e..f6ac4c4 100644
--- a/src/hw/ata.c
+++ b/src/hw/ata.c
@@ -842,7 +842,7 @@
}
yield();
}
- dprintf(6, "powerup iobase=%x st=%x\n", base, status);
+ // dprintf(6, "powerup iobase=%x st=%x\n", base, status);
return status;
}
diff --git a/src/sercon.c b/src/sercon.c
index 8ae1f9c..2859a75 100644
--- a/src/sercon.c
+++ b/src/sercon.c
@@ -529,8 +529,7 @@
seabios = FUNC16(entry_10);
if (vgabios.seg != seabios.seg ||
vgabios.offset != seabios.offset) {
- dprintf(1, "sercon: configuring in splitmode (vgabios %04x:%04x)\n",
- vgabios.seg, vgabios.offset);
+ // dprintf(1, "sercon: configuring in splitmode (vgabios %04x:%04x)\n", vgabios.seg, vgabios.offset);
sercon_real_vga_handler = vgabios;
SET_LOW(sercon_split, 1);
} else {
diff --git a/vgasrc/vgainit.c b/vgasrc/vgainit.c
index d6a297e..5c93322 100644
--- a/vgasrc/vgainit.c
+++ b/vgasrc/vgainit.c
@@ -53,7 +53,7 @@
if (checksum_far(SEG_BIOS, pmm, GET_FARVAR(SEG_BIOS, pmm->length)))
continue;
struct segoff_s entry = GET_FARVAR(SEG_BIOS, pmm->entry);
- dprintf(1, "Attempting to allocate %u bytes %s via pmm call to %04x:%04x\n"
+ dprintf(1, "Attempting to allocate %u bytes %s via pmm call to %04x:%04llx\n"
, size, highmem ? "highmem" : "lowmem"
, entry.seg, entry.offset);
u16 res1, res2;