More cleaning up

This commit is contained in:
Antoine Leca
2012-02-14 19:58:27 +01:00
committed by Ben Gras
parent 1ead18e447
commit 3fb8cb760c
54 changed files with 24 additions and 4200 deletions

View File

@@ -9,9 +9,6 @@
#include <machine/bios.h>
#include <minix/portio.h>
#include <minix/cpufeature.h>
#if !defined(__ELF__)
#include <a.out.h>
#endif
#include <assert.h>
#include <signal.h>
#include <machine/vm.h>
@@ -184,19 +181,6 @@ PUBLIC __dead void arch_shutdown(int how)
NOT_REACHABLE;
}
#if !defined(__ELF__)
/* address of a.out headers, set in mpx386.s */
phys_bytes aout;
PUBLIC void arch_get_aout_headers(const int i, struct exec *h)
{
/* The bootstrap loader created an array of the a.out headers at
* absolute address 'aout'. Get one element to h.
*/
phys_copy(aout + i * A_MINHDR, vir2phys(h), (phys_bytes) A_MINHDR);
}
#endif
PUBLIC void fpu_init(void)
{
unsigned short cw, sw;

View File

@@ -1,5 +1,4 @@
/*
* This file is part of the lowest layer of the MINIX kernel. (The other part
/* This file is part of the lowest layer of the MINIX kernel. (The other part
* is "proc.c".) The lowest layer does process switching and message handling.
* Furthermore it contains the assembler startup code for Minix and the 32-bit
* interrupt handlers. It cooperates with the code in "start.c" to set up a
@@ -83,23 +82,8 @@ IMPORT(multiboot_init)
MINIX:
/* this is the entry point for the MINIX kernel */
#if defined(__ELF__)
jmp _C_LABEL(multiboot_init)
#endif
jmp over_flags /* skip over the next few bytes */
.short CLICK_SHIFT /* for the monitor: memory granularity */
flags:
/* boot monitor flags:
* call in 386 mode, make bss, make stack,
* load high, don't patch, will return,
* uses generic INT, memory vector,
* new boot code return
*/
.short 0x03FD
nop /* extra byte to sync up disassembler */
/* Multiboot header here*/
.balign 8
@@ -125,11 +109,6 @@ multiboot_height:
multiboot_depth:
.long 0
over_flags:
/* Set up a C stack frame on the monitor stack. (The monitor sets cs and ds */
/* right. The ss descriptor still references the monitor data segment.) */
movzwl %sp, %esp /* monitor stack is a 16 bit stack */
.globl kernel_init
kernel_init: /* after pre-init*/
push %ebp
@@ -165,9 +144,6 @@ copygdt:
mov 8(%ebp), %ebx /* boot parameters offset */
mov 12(%ebp), %edx /* boot parameters length */
mov 16(%ebp), %eax /* address of a.out headers */
#if !defined(__ELF__)
movl %eax, _C_LABEL(aout)
#endif
mov %ds, %ax /* kernel data */
mov %ax, %es
mov %ax, %fs

View File

@@ -117,12 +117,6 @@ PUBLIC int main(void)
register struct proc *rp; /* process pointer */
register int i, j;
size_t argsz; /* size of arguments passed to crtso on stack */
#if !defined(__ELF__)
vir_clicks text_clicks, data_clicks, st_clicks;
phys_clicks text_base;
int hdrindex; /* index to array of a.out headers */
struct exec e_hdr; /* for a copy of an a.out header */
#endif
BKL_LOCK();
/* Global value to test segment sanity. */
@@ -209,7 +203,6 @@ PUBLIC int main(void)
/* Don't let the process run for now. */
RTS_SET(rp, RTS_NO_PRIV | RTS_NO_QUANTUM);
}
#if defined(__ELF__)
rp->p_memmap[T].mem_vir = ABS2CLICK(ip->memmap.text_vaddr);
rp->p_memmap[T].mem_phys = ABS2CLICK(ip->memmap.text_paddr);
rp->p_memmap[T].mem_len = ABS2CLICK(ip->memmap.text_bytes);
@@ -223,38 +216,6 @@ PUBLIC int main(void)
ip->memmap.data_bytes +
ip->memmap.stack_bytes);
rp->p_memmap[S].mem_len = 0;
#else
if (iskerneln(proc_nr)) { /* part of the kernel? */
hdrindex = 0; /* all use the first a.out header */
} else {
hdrindex = 1 + i-NR_TASKS; /* system/user processes */
}
/* Architecture-specific way to find out aout header of this
* boot process.
*/
arch_get_aout_headers(hdrindex, &e_hdr);
/* Convert addresses to clicks and build process memory map */
text_base = e_hdr.a_syms >> CLICK_SHIFT;
text_clicks = (vir_clicks) (CLICK_CEIL(e_hdr.a_text) >> CLICK_SHIFT);
data_clicks = (vir_clicks) (CLICK_CEIL(e_hdr.a_data
+ e_hdr.a_bss) >> CLICK_SHIFT);
st_clicks = (vir_clicks) (CLICK_CEIL(e_hdr.a_total) >> CLICK_SHIFT);
if (!(e_hdr.a_flags & A_SEP))
{
data_clicks = (vir_clicks) (CLICK_CEIL(e_hdr.a_text +
e_hdr.a_data + e_hdr.a_bss) >> CLICK_SHIFT);
text_clicks = 0; /* common I&D */
}
rp->p_memmap[T].mem_phys = text_base;
rp->p_memmap[T].mem_len = text_clicks;
rp->p_memmap[D].mem_phys = text_base + text_clicks;
rp->p_memmap[D].mem_len = data_clicks;
rp->p_memmap[S].mem_phys = text_base + text_clicks + st_clicks;
rp->p_memmap[S].mem_vir = st_clicks;
rp->p_memmap[S].mem_len = 0;
#endif
/* Set initial register values. The processor status word for tasks
* is different from that of other processes because tasks can

View File

@@ -196,9 +196,6 @@ _PROTOTYPE( int is_fpu, (void) );
_PROTOTYPE( void ser_putc, (char) );
_PROTOTYPE( __dead void arch_shutdown, (int) );
_PROTOTYPE( __dead void arch_monitor, (void) );
#if !defined(__ELF__)
_PROTOTYPE( void arch_get_aout_headers, (int i, struct exec *h) );
#endif
_PROTOTYPE( void restore_user_context, (struct proc * p) );
_PROTOTYPE( void read_tsc, (u32_t *high, u32_t *low) );
_PROTOTYPE( int arch_init_profile_clock, (u32_t freq) );

View File

@@ -48,9 +48,6 @@ PUBLIC int do_getinfo(struct proc * caller, message * m_ptr)
int nr_e, nr, r;
int wipe_rnd_bin = -1;
struct proc *p;
#if !defined(__ELF__)
struct exec e_hdr;
#endif
/* Set source address and length based on request type. */
switch (m_ptr->I_REQUEST) {
@@ -189,23 +186,6 @@ PUBLIC int do_getinfo(struct proc * caller, message * m_ptr)
src_vir = (vir_bytes) &idl->p_cycles;
break;
}
#if !defined(__ELF__)
case GET_AOUTHEADER: {
int hdrindex, index = m_ptr->I_VAL_LEN2_E;
if(index < 0 || index >= NR_BOOT_PROCS) {
return EINVAL;
}
if (iskerneln(_ENDPOINT_P(image[index].endpoint))) {
hdrindex = 0;
} else {
hdrindex = 1 + index-NR_TASKS;
}
arch_get_aout_headers(hdrindex, &e_hdr);
length = sizeof(e_hdr);
src_vir = (vir_bytes) &e_hdr;
break;
}
#endif
default:
printf("do_getinfo: invalid request %d\n", m_ptr->I_REQUEST);
return(EINVAL);