diff -burN etherboot-5.4.1/src/Config etherboot-5.4.1-t1500/src/Config --- etherboot-5.4.1/src/Config 2005-08-28 21:47:37.000000000 -0400 +++ etherboot-5.4.1-t1500/src/Config 2005-11-16 10:55:37.000000000 -0500 @@ -291,8 +291,10 @@ # Select which buses etherboot should support -CFLAGS+= -DCONFIG_PCI -DCONFIG_ISA +# CFLAGS+= -DCONFIG_PCI -DCONFIG_ISA # CFLAGS+= -DCONFIG_PCMCIA +CFLAGS+= -DCONSOLE_SERIAL -DCOMCONSOLE=0x3f8 -DCONSPEED=115200 -DCOMPARM=0x03 +CFLAGS+= -DCONFIG_PCI # For prompting and default on timeout CFLAGS+= -DASK_BOOT=3 -DBOOT_FIRST=BOOT_NIC @@ -420,7 +422,7 @@ # CFLAGS+= -DALLMULTI -DMULTICAST_LEVEL1 -DMULTICAST_LEVEL2 -DDOWNLOAD_PROTO_TFTM # Etherboot as a PXE network protocol ROM -CFLAGS+= -DPXE_IMAGE -DPXE_EXPORT +#CFLAGS+= -DPXE_IMAGE -DPXE_EXPORT # Etherboot stricter as a PXE network protocol ROM # CFLAGS+= -DPXE_DHCP_STRICT @@ -451,6 +453,7 @@ AR= ar RANLIB= ranlib OBJCOPY= objcopy +T1500_CHECKSUM=~/tsum CFLAGS+= -Os -ffreestanding CFLAGS+= -Wall -W -Wno-format diff -burN etherboot-5.4.1/src/arch/i386/Config etherboot-5.4.1-t1500/src/arch/i386/Config --- etherboot-5.4.1/src/arch/i386/Config 2005-04-02 05:47:29.000000000 -0500 +++ etherboot-5.4.1-t1500/src/arch/i386/Config 2005-11-16 10:56:25.000000000 -0500 @@ -87,8 +87,9 @@ # @/OptionDescription@ # BIOS select don't change unless you know what you are doing -CFLAGS+= -DPCBIOS +# CFLAGS+= -DPCBIOS +CFLAGS += -DT1500 -DCONFIG_PCI_DIRECT -DCONFIG_TSC_CURRTICKS # Compile in k8/hammer support # CFLAGS+= -DCONFIG_X86_64 diff -burN etherboot-5.4.1/src/arch/i386/Makefile etherboot-5.4.1-t1500/src/arch/i386/Makefile --- etherboot-5.4.1/src/arch/i386/Makefile 2005-09-07 17:41:08.000000000 -0400 +++ etherboot-5.4.1-t1500/src/arch/i386/Makefile 2005-11-16 10:47:11.000000000 -0500 @@ -5,6 +5,7 @@ LDSCRIPT= arch/i386/core/etherboot.lds PLDSCRIPT= arch/i386/core/etherboot.prefix.lds +PLDSCRIPT_T1500= arch/i386/core/t1500.prefix.lds LCONFIG+= -Ui386 @@ -13,7 +14,7 @@ { $(RM) $@; echo "ERROR: code size exceeds limit!"; exit 1; }; exit 0; } START= $(BIN)/start32.o $(BIN)/linuxbios.o \ - $(BIN)/bios.o $(BIN)/console.o $(BIN)/memsizes.o $(BIN)/basemem.o \ + $(BIN)/bios.o $(BIN)/t1500.o $(BIN)/console.o $(BIN)/memsizes.o $(BIN)/basemem.o \ $(BIN)/hidemem.o $(BIN)/e820mangler.o \ $(BIN)/realmode.o $(BIN)/realmode_asm.o \ $(BIN)/callbacks.o $(BIN)/pxe_callbacks.o @@ -28,8 +29,10 @@ SRCS+= arch/i386/firmware/pcbios/basemem.c SRCS+= arch/i386/firmware/pcbios/hidemem.c SRCS+= arch/i386/firmware/pcbios/e820mangler.S +SRCS+= arch/i386/firmware/t1500/t1500.c SRCS+= arch/i386/prefix/liloprefix.S SRCS+= arch/i386/prefix/elfprefix.S +SRCS+= arch/i386/prefix/t1500prefix.S SRCS+= arch/i386/prefix/lmelf_prefix.S SRCS+= arch/i386/prefix/elf_dprefix.S SRCS+= arch/i386/prefix/lmelf_dprefix.S @@ -111,6 +114,9 @@ lmelfdPREFIX= $(BIN)/lmelf_dprefix.o lmelfdENTRY= $(BIN)/lmelf_dprefix.entry.o lmelfdEXIT= $(BIN)/lmelf_dprefix.exit.o +t1500PREFIX= $(BIN)/t1500prefix.o +t1500ENTRY= $(BIN)/t1500prefix.entry.o +t1500EXIT= $(BIN)/t1500prefix.exit.o include $(BIN)/Roms @@ -187,6 +193,9 @@ $(BIN)/%.o: arch/i386/firmware/pcbios/%.S $(MAKEDEPS) $(CPP) $(CFLAGS) -Ui386 -D ASSEMBLY $< | $(AS) $(ASFLAGS) -o $@ +$(BIN)/%.o: arch/i386/firmware/t1500/%.c $(MAKEDEPS) + $(CC) $(CFLAGS) -o $@ -c $< + $(BIN)/%.o: arch/i386/prefix/%.S $(MAKEDEPS) $(CPP) $(CFLAGS) -Ui386 -D ASSEMBLY $< | $(AS) $(ASFLAGS) -o $@ @@ -210,6 +219,11 @@ # Intermediate prf rules +%.t1500prf: %.rt $(PREFIXOBJS) %.rt1.uo %.rt2.uo $(MAKEDEPS) + echo dsfdsfds + $(MAKE) $(TARGETENTRY) + $(LD) $(LDFLAGS) -T $(PLDSCRIPT_T1500) $(TARGETENTRY) -R $(subst $(MAKEDEPS),,$^) -o $@ + %.prf: %.rt $(PREFIXOBJS) %.rt1.uo %.rt2.uo $(MAKEDEPS) $(MAKE) $(TARGETENTRY) $(LD) $(LDFLAGS) -T $(PLDSCRIPT) $(TARGETENTRY) -R $(subst $(MAKEDEPS),,$^) -o $@ @@ -380,6 +394,15 @@ $(BIN)/%.zraw: $(BIN)/%.raw.zprf $(OBJCOPY) -O binary $< $@ +SUFFIXES += t1500 +$(BIN)/%.t1500.rt: $(BIN)/%.rt.o $(t1500ENTRY) $(t1500EXIT) $(LDSCRIPT) $(MAKEDEPS) + $(LD) $(LDFLAGS) -T $(LDSCRIPT) -o $@ $(t1500EXIT) $< + +$(BIN)/%.t1500: $(BIN)/%.t1500.t1500prf + $(OBJCOPY) -O binary $< $@ + cat $@ | $(T1500_CHECKSUM) >> $@ + + # rule to make a non-emulation ISO boot image SUFFIXES += iso %.iso: util/geniso %.zlilo diff -burN etherboot-5.4.1/src/arch/i386/core/elf.c etherboot-5.4.1-t1500/src/arch/i386/core/elf.c --- etherboot-5.4.1/src/arch/i386/core/elf.c 2005-04-04 18:36:20.000000000 -0400 +++ etherboot-5.4.1-t1500/src/arch/i386/core/elf.c 2005-11-04 07:25:59.000000000 -0500 @@ -10,6 +10,9 @@ #if defined(LINUXBIOS) #define FIRMWARE "LinuxBIOS" #endif +#if defined(T1500) +#define FIRMWARE "T1500" +#endif #if !defined(FIRMWARE) #error "No BIOS selected" #endif diff -burN etherboot-5.4.1/src/arch/i386/core/t1500.prefix.lds etherboot-5.4.1-t1500/src/arch/i386/core/t1500.prefix.lds --- etherboot-5.4.1/src/arch/i386/core/t1500.prefix.lds 1969-12-31 19:00:00.000000000 -0500 +++ etherboot-5.4.1-t1500/src/arch/i386/core/t1500.prefix.lds 2005-11-16 10:04:53.000000000 -0500 @@ -0,0 +1,105 @@ +OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") +OUTPUT_ARCH(i386) + +ENTRY(_prefix_start) +SECTIONS { + /* Prefix */ + .prefix : { + _verbatim_start = . ; + _prefix_start = . ; + bin/t1500prefix.entry.o(.prefix) + . = 0x1080; + *(.prefix) + . = ALIGN(16); + _prefix_end = . ; + } = 0x9090 + _prefix_size = _prefix_end - _prefix_start; + + .text.nocompress : { + *(.prefix.udata) + } = 0x9090 + + decompress_to = . ; + .prefix.zdata : { + _compressed = . ; + *(.prefix.zdata) + _compressed_end = . ; + } + _compressed_size = _compressed_end - _compressed; + + . = ALIGN(16); + _verbatim_end = . ; + + + _t1500_file_size = _compressed_end - 0x1000; + _t1500_mem_size = _verbatim_end - 0x1000; + + /* Size of the core of etherboot in memory */ + _base_size = _end - _text; + + /* _prefix_size is the length of the non-core etherboot prefix */ + _prefix_size = _prefix_end - _prefix_start; + + /* _verbatim_size is the actual amount that has to be copied to base memory */ + _verbatim_size = _verbatim_end - _verbatim_start; + + /* _image_size is the amount of base memory needed to run */ + _image_size = _base_size + _prefix_size; + + /* Standard sizes rounded up to paragraphs */ + _prefix_size_pgh = (_prefix_size + 15) / 16; + _verbatim_size_pgh = (_verbatim_size + 15) / 16; + _image_size_pgh = (_image_size + 15) / 16 ; + + /* Standard sizes in sectors */ + _prefix_size_sct = (_prefix_size + 511) / 512; + _verbatim_size_sct = (_verbatim_size + 511) / 512; + _image_size_sct = (_image_size + 511) / 512; + + /* Symbol offsets and sizes for the exe prefix */ + _exe_hdr_size = 32; + _exe_size = _verbatim_size; /* Should this be - 32 to exclude the header? */ + _exe_size_tail = (_exe_size) % 512; + _exe_size_pages = ((_exe_size) + 511) / 512; + _exe_bss_size = ((_image_size - _verbatim_size) + 15) / 16; + _exe_ss_offset = (_stack_offset + _prefix_size - _exe_hdr_size + 15) / 16 ; + + /* This is where we copy the compressed image before decompression. + * Prepare to decompress in place. The end mark is about 8.25 bytes long, + * and the worst case symbol is about 16.5 bytes long. Therefore + * We need to reserve at least 25 bytes of slack here. + * Currently I reserve 2048 bytes of just slack to be safe :) + * 2048 bytes easily falls within the BSS (the defualt stack is 4096 bytes) + * so we really are decompressing in place. + * + * Hmm. I missed a trick. In the very worst case (no compression) + * the encoded data is 9/8 the size as it started out so to be completely + * safe I need to be 1/8 of the uncompressed code size past the end. + * This will still fit compfortably into our bss in any conceivable scenario. + */ + _compressed_copy = _edata + _prefix_size - _compressed_size + + /* The amount to overflow _edata */ + MAX( ((_edata - _text + 7) / 8) , 2016 ) + 32; + _assert = ASSERT( ( _compressed_copy - _prefix_size ) < _ebss , "Cannot decompress in place" ) ; + + decompress = DEFINED(decompress) ? decompress : 0; + /DISCARD/ : { + *(.comment) + *(.note) + } + + /* Symbols used by the prefixes whose addresses are inconvinient + * to compute, at runtime in the code. + */ + image_basemem_size = DEFINED(image_basemem_size)? image_basemem_size : 65536; + image_basemem = DEFINED(image_basemem)? image_basemem : 65536; + _prefix_real_to_prot = _real_to_prot + _prefix_size ; + _prefix_prot_to_real = _prot_to_real + _prefix_size ; + _prefix_image_basemem_size = image_basemem_size + _prefix_size ; + _prefix_image_basemem = image_basemem + _prefix_size ; + _prefix_rm_in_call = _rm_in_call + _prefix_size ; + _prefix_in_call = _in_call + _prefix_size ; + _prefix_rom = rom + _prefix_size ; + _prefix_rm_etherboot_location = rm_etherboot_location + _prefix_size ; + _prefix_stack_end = _stack_end + _prefix_size ; +} diff -burN etherboot-5.4.1/src/arch/i386/firmware/t1500/t1500.c etherboot-5.4.1-t1500/src/arch/i386/firmware/t1500/t1500.c --- etherboot-5.4.1/src/arch/i386/firmware/t1500/t1500.c 1969-12-31 19:00:00.000000000 -0500 +++ etherboot-5.4.1-t1500/src/arch/i386/firmware/t1500/t1500.c 2005-11-04 07:59:03.000000000 -0500 @@ -0,0 +1,90 @@ +#ifdef T1500 + +#include "etherboot.h" +#include "dev.h" + +#define fbms ( ( uint16_t * ) phys_to_virt ( 0x413 ) ) +#define BASE_MEMORY_MAX ( 640 ) +#define FREE_BASE_MEMORY ( (uint32_t) ( *fbms << 10 ) ) + +uint32_t get_free_base_memory ( void ) { + return FREE_BASE_MEMORY; +} + +unsigned short basememsize ( void ) +{ + return BASE_MEMORY_MAX; +} + +unsigned int memsize ( void ) +{ + return 60*1024; +} + +struct meminfo meminfo; +void get_memsizes(void) +{ + static const unsigned min_addr = 0x600; + unsigned basemem; + unsigned i; + + basemem = get_free_base_memory(); + meminfo.basememsize = basememsize(); + meminfo.memsize = memsize(); + + meminfo.map_count = 2; + meminfo.map[0].addr = 0; + meminfo.map[0].size = meminfo.basememsize << 10; + meminfo.map[0].type = E820_RAM; + meminfo.map[1].addr = 1024*1024; + meminfo.map[1].size = meminfo.memsize << 10; + meminfo.map[1].type = E820_RAM; + + for(i = 0; i < meminfo.map_count; i++) { + if (meminfo.map[i].type != E820_RAM) { + continue; + } + /* Reserve the bios data structures */ + if (meminfo.map[i].addr < min_addr) { + unsigned long delta; + delta = min_addr - meminfo.map[i].addr; + if (delta > meminfo.map[i].size) { + delta = meminfo.map[i].size; + } + meminfo.map[i].addr = min_addr; + meminfo.map[i].size -= delta; + } + /* Ensure the returned e820 map is in sync + * with the actual memory state + */ + if ((meminfo.map[i].addr < 0xa0000) && + ((meminfo.map[i].addr + meminfo.map[i].size) > basemem)) + { + if (meminfo.map[i].addr <= basemem) { + meminfo.map[i].size = basemem - meminfo.map[i].addr; + } else { + meminfo.map[i].addr = basemem; + meminfo.map[i].size = 0; + } + } + } + +{ + unsigned i; + printf("basememsize %d\n", meminfo.basememsize); + printf("memsize %d\n", meminfo.memsize); + printf("Memory regions(%d):\n", meminfo.map_count); + for(i = 0; i < meminfo.map_count; i++) { + unsigned long long r_start, r_end; + r_start = meminfo.map[i].addr; + r_end = r_start + meminfo.map[i].size; + printf("[%X%X, %X%X) type %d\n", + (unsigned long)(r_start >> 32), + (unsigned long)r_start, + (unsigned long)(r_end >> 32), + (unsigned long)r_end, + meminfo.map[i].type); + } +} +} +#endif diff -burN etherboot-5.4.1/src/arch/i386/include/realmode.h etherboot-5.4.1-t1500/src/arch/i386/include/realmode.h --- etherboot-5.4.1/src/arch/i386/include/realmode.h 2005-04-02 05:47:45.000000000 -0500 +++ etherboot-5.4.1-t1500/src/arch/i386/include/realmode.h 2005-11-04 07:35:06.000000000 -0500 @@ -111,7 +111,7 @@ /* Function prototypes from basemem.c */ -#ifdef LINUXBIOS +#if defined(LINUXBIOS) || defined(T1500) /* A silly hard code that let's the code compile and work. * When this becomes a problem feel free to implement * something better. diff -burN etherboot-5.4.1/src/arch/i386/prefix/t1500prefix.S etherboot-5.4.1-t1500/src/arch/i386/prefix/t1500prefix.S --- etherboot-5.4.1/src/arch/i386/prefix/t1500prefix.S 1969-12-31 19:00:00.000000000 -0500 +++ etherboot-5.4.1-t1500/src/arch/i386/prefix/t1500prefix.S 2005-10-31 12:02:52.000000000 -0500 @@ -0,0 +1,47 @@ +#include "elf.h" + + .arch i386 + .section ".prefix", "a", @progbits + +#define LOAD_ADDR 0x100000 + + /* ELF Header */ + .globl elf_header +elf_header: +e_ident: .byte 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 +e_type: .short ET_EXEC +e_machine: .short EM_386 +e_version: .long 1 +e_entry: .long LOAD_ADDR +e_phoff: .long elf_program_header - elf_header +e_shoff: .long 0 +e_flags: .long 0 +e_ehsize: .short elf_header_end - elf_header +e_phentsize: .short ELF32_PHDR_SIZE +e_phnum: .short (elf_program_header_end - elf_program_header)/ELF32_PHDR_SIZE +e_shentsize: .short 0 +e_shnum: .short 0 +e_shstrndx: .short 0 +elf_header_end: + +elf_program_header: +/* The decompressor */ +phdr2_p_type: .long PT_LOAD +phdr2_p_offset: .long 0x1000 +phdr2_p_vaddr: .long LOAD_ADDR +phdr2_p_paddr: .long LOAD_ADDR +phdr2_p_filesz: .long _t1500_file_size; +phdr2_p_memsz: .long _t1500_mem_size; +phdr2_p_flags: .long PF_R | PF_W | PF_X +phdr2_p_align: .long 0x1000 + +elf_program_header_end: + + /* Dummy routines to satisfy the build */ + .section ".text16", "ax", @progbits + .globl prefix_exit +prefix_exit: + + .globl prefix_exit_end +prefix_exit_end: + .previous diff -burN etherboot-5.4.1/src/drivers/net/tulip.c etherboot-5.4.1-t1500/src/drivers/net/tulip.c --- etherboot-5.4.1/src/drivers/net/tulip.c 2005-06-17 16:07:47.000000000 -0400 +++ etherboot-5.4.1-t1500/src/drivers/net/tulip.c 2005-11-16 10:19:36.000000000 -0500 @@ -146,6 +146,7 @@ "100baseFx-FDX", "MII 10baseT", "MII 10baseT-FDX", "MII", "10baseT(forced)", "MII 100baseTx", "MII 100baseTx-FDX", "MII 100baseT4", "MII 100baseFx-HDX", "MII 100baseFx-FDX", "Home-PNA 1Mbps", "Invalid-19", + "","","","", "","","","", "","","","Transceiver reset", }; /* This much match tulip_tbl[]! Note 21142 == 21143. */