Changeset 4965a846 in mainline


Ignore:
Timestamp:
2006-07-24T14:19:44Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5de522d
Parents:
d227101
Message:

xen32 hypervisor interface

Location:
kernel/arch/xen32
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/xen32/include/boot/boot.h

    rd227101 r4965a846  
    3636#define __xen32_BOOT_H__
    3737
     38#define GUEST_CMDLINE   1024
     39#define START_INFO_SIZE 1104
    3840#define BOOT_OFFSET             0x0000
    39 #define TEMP_STACK_SIZE 0x400
     41
     42#ifndef __ASM__
     43
     44#include <arch/types.h>
     45
     46typedef struct {
     47        char magic[32];             /**< "xen-<version>-<platform>" */
     48        unsigned long nr_pages;     /**< Total pages allocated to this domain */
     49        unsigned long shared_info;  /**< Physical address of shared info struct */
     50        uint32_t flags;             /**< SIF_xxx flags */
     51        unsigned long store_mfn;    /**< Physical page number of shared page */
     52        uint32_t store_evtchn;      /**< Event channel for store communication */
     53        unsigned long console_mfn;  /**< Physical address of console page */
     54        uint32_t console_evtchn;    /**< Event channel for console messages */
     55        unsigned long pt_base;      /**< Virtual address of page directory */
     56        unsigned long nr_pt_frames; /**< Number of bootstrap p.t. frames */
     57        unsigned long mfn_list;     /**< Virtual address of page-frame list */
     58        unsigned long mod_start;    /**< Virtual address of pre-loaded module */
     59        unsigned long mod_len;      /**< Size (bytes) of pre-loaded module */
     60        int8_t cmd_line[GUEST_CMDLINE];
     61} start_info_t;
     62
     63extern start_info_t start_info;
     64
     65#endif
    4066
    4167#endif
  • kernel/arch/xen32/src/boot/boot.S

    rd227101 r4965a846  
    3535        .ascii  "GUEST_OS=HelenOS,"
    3636        .ascii  "XEN_VER=xen-3.0,"
    37         .ascii  "HYPERCALL_PAGE=0x2,"
     37        .ascii  "HYPERCALL_PAGE=0x0002,"
    3838        .ascii  "LOADER=generic,"
    3939        .ascii  "PT_MODE_WRITABLE"
     
    4848kernel_image_start:
    4949        cld
    50         movl $kernel_stack, %esp         # initialize stack pointer
    5150       
     51        # copy start_info (esi initialized by Xen)
     52       
     53        movl $start_info, %edi
     54        movl $START_INFO_SIZE >> 2, %ecx
     55        cld
     56        rep movsb
     57
    5258        call main_bsp                                                           # never returns
    5359
     
    5561        hlt
    5662
    57 .data
     63.global hypercall_page
    5864
    59 .align 4096
    60 page_directory:
    61         .space 4096, 0
    62 
    63 kernel_stack_bottom:
    64         .space TEMP_STACK_SIZE
    65 kernel_stack:
     65.org (0x0002 * PAGE_SIZE)
     66hypercall_page:
     67        .space PAGE_SIZE
  • kernel/arch/xen32/src/mm/memory_init.c

    rd227101 r4965a846  
    3535#include <arch/mm/memory_init.h>
    3636#include <arch/mm/page.h>
     37#include <arch/boot/boot.h>
    3738#include <print.h>
    3839
    3940size_t get_memory_size(void)
    4041{
    41         return 0;
     42        return start_info.nr_pages * PAGE_SIZE;
    4243}
    4344
  • kernel/arch/xen32/src/xen32.c

    rd227101 r4965a846  
    5656#include <arch/bios/bios.h>
    5757
     58#include <arch/boot/boot.h>
    5859#include <arch/mm/memory_init.h>
    5960#include <interrupt.h>
     
    6263#include <syscall/syscall.h>
    6364#include <console/console.h>
     65
     66start_info_t start_info;
    6467
    6568void arch_pre_mm_init(void)
Note: See TracChangeset for help on using the changeset viewer.