mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Delete extra whitespace at the end of line, which annoys quilt
git-svn-id: svn://coreboot.org/openbios/openbios-devel@284 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -20,12 +20,12 @@ int linux_load(struct sys_info *, const char *filename, const char *cmdline);
|
||||
|
||||
void boot(void);
|
||||
|
||||
struct sys_info sys_info;
|
||||
struct sys_info sys_info;
|
||||
|
||||
void boot(void)
|
||||
{
|
||||
char *path=pop_fstr_copy(), *param;
|
||||
|
||||
|
||||
if(!path) {
|
||||
printk("[x86] Booting default not supported.\n");
|
||||
return;
|
||||
@@ -36,7 +36,7 @@ void boot(void)
|
||||
*param = '\0';
|
||||
param++;
|
||||
}
|
||||
|
||||
|
||||
printk("[x86] Booting file '%s' with parameters '%s'\n",path, param);
|
||||
|
||||
if (elf_load(&sys_info, path, param) != LOADER_NOT_SUPPORT)
|
||||
@@ -45,7 +45,7 @@ void boot(void)
|
||||
goto loaded;
|
||||
if (forth_load(&sys_info, path, param) != LOADER_NOT_SUPPORT)
|
||||
goto loaded;
|
||||
|
||||
|
||||
printk("Unsupported image format\n");
|
||||
|
||||
loaded:
|
||||
|
||||
@@ -200,7 +200,7 @@ static void video_newline(void)
|
||||
static void video_putchar(int c)
|
||||
{
|
||||
int p=1;
|
||||
|
||||
|
||||
if (c == '\n' || c == '\r') {
|
||||
video_newline();
|
||||
return;
|
||||
@@ -228,7 +228,7 @@ static void video_putchar(int c)
|
||||
static void video_cls(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 0; i < 2 * COLUMNS * LINES;) {
|
||||
video[i++] = 0;
|
||||
video[i++] = ATTRIBUTE;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* tag: x86 context switching
|
||||
*
|
||||
*
|
||||
* 2003-10 by SONE Takeshi
|
||||
*
|
||||
* See the file "COPYING" for further information about
|
||||
@@ -22,7 +22,7 @@ static void start_main(void); /* forward decl. */
|
||||
void __exit_context(void); /* assembly routine */
|
||||
|
||||
/*
|
||||
* Main context structure
|
||||
* Main context structure
|
||||
* It is placed at the bottom of our stack, and loaded by assembly routine
|
||||
* to start us up.
|
||||
*/
|
||||
|
||||
@@ -159,7 +159,7 @@ static int load_segments(Elf_phdr *phdr, int phnum,
|
||||
}
|
||||
bytes += phdr[i].p_filesz;
|
||||
debug("clearing... ");
|
||||
memset(phys_to_virt(phdr[i].p_paddr + phdr[i].p_filesz), 0,
|
||||
memset(phys_to_virt(phdr[i].p_paddr + phdr[i].p_filesz), 0,
|
||||
phdr[i].p_memsz - phdr[i].p_filesz);
|
||||
if (phdr[i].p_offset <= checksum_offset
|
||||
&& phdr[i].p_offset + phdr[i].p_filesz >= checksum_offset+2) {
|
||||
@@ -362,7 +362,7 @@ int elf_load(struct sys_info *info, const char *filename, const char *cmdline)
|
||||
|
||||
if (!load_segments(phdr, ehdr.e_phnum, checksum_offset))
|
||||
goto out;
|
||||
|
||||
|
||||
if (checksum_offset) {
|
||||
if (!verify_image(&ehdr, phdr, ehdr.e_phnum, checksum))
|
||||
goto out;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/*
|
||||
* Entry point
|
||||
* We start execution from here.
|
||||
* It is assumed that CPU is in 32-bit protected mode and
|
||||
* It is assumed that CPU is in 32-bit protected mode and
|
||||
* all segments are 4GB and base zero (flat model).
|
||||
*/
|
||||
entry:
|
||||
@@ -28,7 +28,7 @@ entry:
|
||||
* switches the stack, and restores everything from the new stack.
|
||||
* This function takes no argument. New stack pointer is
|
||||
* taken from global variable __context, and old stack pointer
|
||||
* is also saved to __context. This way we can just jump to
|
||||
* is also saved to __context. This way we can just jump to
|
||||
* this routine to get back to the original context.
|
||||
*
|
||||
* Call this routine with lcall or pushl %cs; call.
|
||||
@@ -51,7 +51,7 @@ __switch_context:
|
||||
xchgl %eax, 64(%esp)
|
||||
movl %eax, 60(%esp)
|
||||
#endif
|
||||
|
||||
|
||||
/* At this point we don't know if we are on flat segment
|
||||
* or relocated. So compute the address offset from %eip.
|
||||
* Assuming CS.base==DS.base==SS.base.
|
||||
@@ -62,7 +62,7 @@ __switch_context:
|
||||
|
||||
/* Interrupts are not allowed... */
|
||||
cli
|
||||
|
||||
|
||||
/* Current context pointer is our stack pointer */
|
||||
movl %esp, %esi
|
||||
|
||||
@@ -119,7 +119,7 @@ halt:
|
||||
* initialize exception handler. All exceptions end up in the same
|
||||
* C function.
|
||||
*/
|
||||
|
||||
|
||||
init_exceptions:
|
||||
pushl %ebx
|
||||
pushl %edi
|
||||
@@ -141,7 +141,7 @@ init_exceptions:
|
||||
|
||||
/* Load the Interrupt descriptor table */
|
||||
lidt idtarg
|
||||
|
||||
|
||||
movl $0, %eax
|
||||
popl %edi
|
||||
popl %ebx
|
||||
|
||||
@@ -54,12 +54,12 @@ void x86_exception(struct eregs *info);
|
||||
void x86_exception(struct eregs *info)
|
||||
{
|
||||
if(info->vector <= 18) {
|
||||
printk("\nUnexpected Exception: %s",
|
||||
printk("\nUnexpected Exception: %s",
|
||||
exception_names[info->vector]);
|
||||
} else {
|
||||
printk("\nUnexpected Exception: %d", info->vector);
|
||||
}
|
||||
|
||||
|
||||
printk(
|
||||
" @ %02x:%08lx - Halting\n"
|
||||
"Code: %d eflags: %08lx\n"
|
||||
@@ -67,7 +67,7 @@ void x86_exception(struct eregs *info)
|
||||
"edi: %08lx esi: %08lx ebp: %08lx esp: %08lx\n",
|
||||
info->cs, (unsigned long)info->eip,
|
||||
info->error_code, (unsigned long)info->eflags,
|
||||
(unsigned long)info->eax, (unsigned long)info->ebx,
|
||||
(unsigned long)info->eax, (unsigned long)info->ebx,
|
||||
(unsigned long)info->ecx, (unsigned long)info->edx,
|
||||
(unsigned long)info->edi, (unsigned long)info->esi,
|
||||
(unsigned long)info->ebp, (unsigned long)info->esp);
|
||||
@@ -83,7 +83,7 @@ void x86_exception(struct eregs *info)
|
||||
PC=findword("outer-interpreter");
|
||||
|
||||
info->eip=(uint32_t)&do_nothing;
|
||||
|
||||
|
||||
/*
|
||||
for (;;)
|
||||
asm("hlt;");
|
||||
|
||||
@@ -38,10 +38,10 @@ int forth_load(struct sys_info *info, const char *filename, const char *cmdline)
|
||||
}
|
||||
|
||||
forthsize = file_size();
|
||||
|
||||
|
||||
forthtext = malloc(forthsize+1);
|
||||
file_seek(0);
|
||||
|
||||
|
||||
printk("Loading forth source ...");
|
||||
if (lfile_read(forthtext, forthsize) != forthsize) {
|
||||
printk("Can't read forth text\n");
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "openbios/kernel.h"
|
||||
|
||||
/* Format a string and print it on the screen, just like the libc
|
||||
* function printf.
|
||||
* function printf.
|
||||
*/
|
||||
int printk( const char *fmt, ... )
|
||||
{
|
||||
|
||||
@@ -124,7 +124,7 @@ struct linux_params {
|
||||
uint16_t ramdisk_flags; /* 0x1f8 */
|
||||
#define RAMDISK_IMAGE_START_MASK 0x07FF
|
||||
#define RAMDISK_PROMPT_FLAG 0x8000
|
||||
#define RAMDISK_LOAD_FLAG 0x4000
|
||||
#define RAMDISK_LOAD_FLAG 0x4000
|
||||
uint8_t reserved8[2]; /* 0x1fa */
|
||||
uint16_t orig_root_dev; /* 0x1fc */
|
||||
uint8_t reserved9[1]; /* 0x1fe */
|
||||
@@ -465,7 +465,7 @@ static int load_initrd(struct linux_header *hdr, struct sys_info *info,
|
||||
max = hdr->initrd_addr_max;
|
||||
else
|
||||
max = 0x38000000; /* Hardcoded value for older kernels */
|
||||
|
||||
|
||||
/* FILO itself is at the top of RAM. (relocated)
|
||||
* So, try putting initrd just below us. */
|
||||
end = virt_to_phys(_start);
|
||||
@@ -521,9 +521,9 @@ static void hardware_setup(void)
|
||||
outb(0, 0xf0);
|
||||
outb(0, 0xf1);
|
||||
|
||||
/* we're getting screwed again and again by this problem of the 8259.
|
||||
* so we're going to leave this lying around for inclusion into
|
||||
* crt0.S on an as-needed basis.
|
||||
/* we're getting screwed again and again by this problem of the 8259.
|
||||
* so we're going to leave this lying around for inclusion into
|
||||
* crt0.S on an as-needed basis.
|
||||
*
|
||||
* well, that went ok, I hope. Now we have to reprogram the interrupts :-(
|
||||
* we put them right after the intel-reserved hardware interrupts, at
|
||||
@@ -566,8 +566,8 @@ static int start_linux(uint32_t kern_addr, struct linux_params *params)
|
||||
linux_gdt[2] = gdt[FLAT_CODE];
|
||||
linux_gdt[3] = gdt[FLAT_DATA];
|
||||
/* 2.6 kernel uses 12 and 13, but head.S uses backward-compatible
|
||||
* segments (2 and 3), so it SHOULD not be a problem.
|
||||
* However, some distro kernels (eg. RH9) with backported threading
|
||||
* segments (2 and 3), so it SHOULD not be a problem.
|
||||
* However, some distro kernels (eg. RH9) with backported threading
|
||||
* patch use 12 and 13 also when booting... */
|
||||
linux_gdt[12] = gdt[FLAT_CODE];
|
||||
linux_gdt[13] = gdt[FLAT_DATA];
|
||||
@@ -595,7 +595,7 @@ static int start_linux(uint32_t kern_addr, struct linux_params *params)
|
||||
params->orig_x = cursor_x;
|
||||
params->orig_y = cursor_y;
|
||||
#endif
|
||||
|
||||
|
||||
/* Go... */
|
||||
ctx = switch_to(ctx);
|
||||
|
||||
|
||||
@@ -27,18 +27,18 @@ int file_seek(unsigned long offset)
|
||||
unsigned long file_size(void)
|
||||
{
|
||||
llong fpos, fsize;
|
||||
|
||||
|
||||
/* save current position */
|
||||
fpos=tell(load_fd);
|
||||
|
||||
/* go to end of file and get position */
|
||||
seek_io(load_fd, -1);
|
||||
fsize=tell(load_fd);
|
||||
|
||||
|
||||
/* go back to old position */
|
||||
seek_io(load_fd, 0);
|
||||
seek_io(load_fd, fpos);
|
||||
|
||||
|
||||
return fsize;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Support for Multiboot */
|
||||
|
||||
#include "openbios/config.h"
|
||||
#include "openbios/config.h"
|
||||
#include "asm/io.h"
|
||||
#include "sys_info.h"
|
||||
#include "multiboot.h"
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifdef CONFIG_DEBUG_BOOT
|
||||
#define debug printk
|
||||
#else
|
||||
#define debug(x...)
|
||||
#define debug(x...)
|
||||
#endif
|
||||
|
||||
struct mbheader {
|
||||
@@ -61,13 +61,13 @@ void collect_multiboot_info(struct sys_info *info)
|
||||
printk("multiboot: no dictionary\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
mod = (module_t *) mbinfo->mods_addr;
|
||||
info->dict_start=(unsigned long *)mod->mod_start;
|
||||
info->dict_end=(unsigned long *)mod->mod_end;
|
||||
debug("multiboot: dictionary at %x-%x\n",
|
||||
debug("multiboot: dictionary at %x-%x\n",
|
||||
info->dict_start, info->dict_end);
|
||||
|
||||
|
||||
if (mbinfo->flags & MULTIBOOT_MMAP_VALID) {
|
||||
/* convert mmap records */
|
||||
mbmem = phys_to_virt(mbinfo->mmap_addr);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* multiboot.h
|
||||
* tag: header for multiboot
|
||||
/* multiboot.h
|
||||
* tag: header for multiboot
|
||||
*
|
||||
* Copyright (C) 2003 Stefan Reinauer
|
||||
*
|
||||
|
||||
@@ -24,7 +24,7 @@ static char intdict[256 * 1024];
|
||||
static void init_memory(void)
|
||||
{
|
||||
/* push start and end of available memory to the stack
|
||||
* so that the forth word QUIT can initialize memory
|
||||
* so that the forth word QUIT can initialize memory
|
||||
* management. For now we use hardcoded memory between
|
||||
* 0x10000 and 0x9ffff (576k). If we need more memory
|
||||
* than that we have serious bloat.
|
||||
@@ -70,12 +70,12 @@ int openbios(void)
|
||||
#endif
|
||||
|
||||
collect_sys_info(&sys_info);
|
||||
|
||||
|
||||
dict=intdict;
|
||||
load_dictionary((char *)sys_info.dict_start,
|
||||
(unsigned long)sys_info.dict_end -
|
||||
(unsigned long)sys_info.dict_start);
|
||||
|
||||
|
||||
relocate(&sys_info);
|
||||
|
||||
#ifdef CONFIG_DEBUG_CONSOLE_VGA
|
||||
@@ -94,7 +94,7 @@ int openbios(void)
|
||||
|
||||
PUSH_xt( bind_noname_func(arch_init) );
|
||||
fword("PREPOST-initializer");
|
||||
|
||||
|
||||
PC = (ucell)findword("initialize-of");
|
||||
|
||||
if (!PC) {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
/*
|
||||
* Creation Date: <2004/01/15 16:14:05 samuel>
|
||||
* Time-stamp: <2004/01/15 16:14:05 samuel>
|
||||
*
|
||||
*
|
||||
* <openbios.h>
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2004 Samuel Rydh (samuel@ibrium.se)
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _H_OPENBIOS
|
||||
|
||||
@@ -22,7 +22,7 @@ struct gdtarg {
|
||||
unsigned int base;
|
||||
} __attribute__((packed));
|
||||
|
||||
/* How far the virtual address (used in C) is different from physical
|
||||
/* How far the virtual address (used in C) is different from physical
|
||||
* address. Since we start in flat mode, the initial value is zero. */
|
||||
unsigned long virt_offset = 0;
|
||||
|
||||
@@ -108,7 +108,7 @@ void relocate(struct sys_info *info)
|
||||
"movw %5, %%gs\n\t"
|
||||
"movw %5, %%ss\n"
|
||||
: "=&S" (d0), "=&D" (d1), "=&c" (d2)
|
||||
: "m" (gdtarg), "n" (RELOC_CS), "q" ((unsigned short) RELOC_DS),
|
||||
: "m" (gdtarg), "n" (RELOC_CS), "q" ((unsigned short) RELOC_DS),
|
||||
"0" (&_start), "1" (new_base), "2" (prog_size));
|
||||
|
||||
virt_offset = new_offset;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#ifdef CONFIG_DEBUG_BOOT
|
||||
#define debug printk
|
||||
#else
|
||||
#define debug(x...)
|
||||
#define debug(x...)
|
||||
#endif
|
||||
|
||||
void collect_multiboot_info(struct sys_info *);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Xbox framebuffer - Video + Console
|
||||
*
|
||||
* Copyright (C) 2005 Ed Schouten <ed@fxq.nl>,
|
||||
* Copyright (C) 2005 Ed Schouten <ed@fxq.nl>,
|
||||
* Stefan Reinauer <stepan@openbios.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/*
|
||||
/*
|
||||
* Creation Date: <2004/08/28 18:38:22 greg>
|
||||
* Time-stamp: <2004/08/28 18:38:22 greg>
|
||||
*
|
||||
*
|
||||
* <methods.c>
|
||||
*
|
||||
*
|
||||
* Misc device node methods
|
||||
*
|
||||
* Copyright (C) 2004 Greg Watson
|
||||
*
|
||||
*
|
||||
* Based on MOL specific code which is
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2003, 2004 Samuel Rydh (samuel@ibrium.se)
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "openbios/config.h"
|
||||
@@ -39,11 +39,11 @@ stdout_write( void )
|
||||
|
||||
strncpy_nopad( s, addr, len );
|
||||
s[len]=0;
|
||||
|
||||
|
||||
printk( "%s", s );
|
||||
//vfd_draw_str( s );
|
||||
console_draw_str( s );
|
||||
|
||||
|
||||
free( s );
|
||||
|
||||
PUSH( len );
|
||||
|
||||
Reference in New Issue
Block a user