Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1685 → Rev 1686

/kernel/trunk/contrib/conf/msim.conf
6,14 → 6,6
 
add rwm mainmem 0x0 8M load "/dev/zero"
add rom startmem 0x1fc00000 1024k load "image.boot"
add rwm ns 0x01000000 1M load "ns"
add rwm kbd 0x01100000 1M load "fb"
add rwm fb 0x01200000 1M load "kbd"
add rwm console 0x01300000 1M load "console"
add rwm init 0x01400000 1M load "init"
add rwm tetris 0x01500000 1M load "tetris"
add rwm klog 0x01600000 1M load "klog"
add rwm ipcc 0x01700000 1M load "ipcc"
 
add dprinter printer 0x10000000
add dkeyboard keyboard 0x10000000 2
/kernel/trunk/arch/ppc32/src/boot/boot.S
48,14 → 48,14
# r3 contains physical address of bootinfo_t
# r4 contains size of bootinfo_t
cmpwi r4, 0
beq bootinfo_end
addis r3, r3, 0x8000
 
lis r31, bootinfo@ha
addi r31, r31, bootinfo@l # r31 = bootinfo
cmpwi r4, 0
beq bootinfo_end
bootinfo_loop:
lwz r30, 0(r3)
/kernel/trunk/arch/mips32/include/boot.h
0,0 → 1,48
/*
* Copyright (C) 2006 Martin Decky
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __mips32_BOOT_H__
#define __mips32_BOOT_H__
 
#define TASKMAP_MAX_RECORDS 32
 
#include <arch/types.h>
 
typedef struct {
__address addr;
__u32 size;
} utask_t;
 
typedef struct {
__u32 cnt;
utask_t tasks[TASKMAP_MAX_RECORDS];
} bootinfo_t;
 
extern bootinfo_t bootinfo;
 
#endif
/kernel/trunk/arch/mips32/src/start.S
182,10 → 182,35
/* Load temporary stack */
lui $sp, %hi(end_stack)
ori $sp, $sp, %lo(end_stack)
 
/* $a1 contains physical address of bootinfo_t */
/* $a2 contains size of bootinfo_t */
beq $a2, $0, bootinfo_end
/* Not sure about this, but might be needed for PIC code???? */
lui $gp, 0x8000
lui $a3, 0x8000
addu $a1, $a1, $a3
lui $a3, %hi(bootinfo)
ori $a3, $a3, %lo(bootinfo)
bootinfo_loop:
lw $v0, 0($a1)
sw $v0, 0($a3)
addi $a1, $a1, 4
addi $a3, $a3, 4
addi $a2, $a2, -4
bgtz $a2, bootinfo_loop
nop
bootinfo_end:
jal arch_pre_main
nop
/kernel/trunk/arch/mips32/src/mips32.c
28,6 → 28,7
 
 
#include <arch.h>
#include <arch/boot.h>
#include <arch/cp0.h>
#include <arch/exception.h>
#include <arch/asm.h>
60,26 → 61,19
#define NORM_EXC ((char *) 0x80000180)
#define CACHE_EXC ((char *) 0x80000100)
 
bootinfo_t bootinfo;
 
void arch_pre_main(void)
{
/* Setup usermode */
init.cnt = 8;
init.tasks[0].addr = INIT_ADDRESS;
init.tasks[0].size = INIT_SIZE;
init.tasks[1].addr = INIT_ADDRESS + 0x100000;
init.tasks[1].size = INIT_SIZE;
init.tasks[2].addr = INIT_ADDRESS + 0x200000;
init.tasks[2].size = INIT_SIZE;
init.tasks[3].addr = INIT_ADDRESS + 0x300000;
init.tasks[3].size = INIT_SIZE;
init.tasks[4].addr = INIT_ADDRESS + 0x400000;
init.tasks[4].size = INIT_SIZE;
init.tasks[5].addr = INIT_ADDRESS + 0x500000;
init.tasks[5].size = INIT_SIZE;
init.tasks[6].addr = INIT_ADDRESS + 0x600000;
init.tasks[6].size = INIT_SIZE;
init.tasks[7].addr = INIT_ADDRESS + 0x700000;
init.tasks[7].size = INIT_SIZE;
init.cnt = bootinfo.cnt;
__u32 i;
for (i = 0; i < bootinfo.cnt; i++) {
init.tasks[i].addr = bootinfo.tasks[i].addr;
init.tasks[i].size = bootinfo.tasks[i].size;
}
}
 
void arch_pre_mm_init(void)