Strict Standards: Declaration of action_plugin_importoldchangelog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /DISK2/WWW/pavel-rimsky.cz/helenos/lib/plugins/importoldchangelog/action.php on line 8 Strict Standards: Declaration of action_plugin_importoldindex::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /DISK2/WWW/pavel-rimsky.cz/helenos/lib/plugins/importoldindex/action.php on line 0 Deprecated: Function split() is deprecated in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 154 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 456 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 456 Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /DISK2/WWW/pavel-rimsky.cz/helenos/inc/auth.php on line 453 Index: contrib/util/silo.patched.tar.gz =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: contrib/util/silo.patched.tar.gz ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: contrib/util/DownloadAndPatchSILO.sh =================================================================== --- contrib/util/DownloadAndPatchSILO.sh (revision 0) +++ contrib/util/DownloadAndPatchSILO.sh (revision 0) @@ -0,0 +1,74 @@ +#!/bin/bash + +# Download SILO and patch it so that it can be used to create a bootable CD +# for the Serengeti machine +# by Pavel Rimsky +# portions by Martin Decky +# +# GPL'ed, copyleft +# + +# stuff to be downloaded +SILO_DOWNLOAD_FILE='silo-loaders-1.4.11.tar.gz' +SILO_DOWNLOAD_URL='http://silo.auxio.org/pub/silo/old/'$SILO_DOWNLOAD_FILE + +# check whether the last command failed, if so, write an error message and exit +check_error() { + if [ "$1" -ne "0" ]; then + echo + echo "Script failed: $2" + exit + fi +} + +# temporary files are to be stored in /tmp +# the resulting file in the current directory +WD=`pwd` +cd /tmp + +# download SILO from its official website +echo ">>> Downloading SILO" +wget $SILO_DOWNLOAD_URL +check_error $? "Error downloading SILO." + +# unpack the downloaded file +echo ">>> Unpacking tarball" +tar xvzf $SILO_DOWNLOAD_FILE +check_error $? "Error unpacking tarball." + +# CD to the unpacked directory +echo ">>> Changing to the unpacked SILO directory" +cd boot +check_error $? "Changing directory failed." + +# patch it - remove bytes 512 to 512 + 32 (counted from 0), which belong to +# the ELF header which is not recognized by the Serengeti firmware +echo ">>> Patching SILO" +(((xxd -p -l 512 isofs.b) && (xxd -p -s 544 isofs.b)) | xxd -r -p) \ + > isofs.b.patched +check_error $? "Patching SILO failed" +mv isofs.b.patched isofs.b + +# get rid of files which are not needed for creating the bootable CD +echo ">>> Purging SILO directory" +for file in `ls`; do + if [ \( -f $file \) -a \( $file != "isofs.b" \) -a \( $file != "second.b" \) ]; + then + rm -fr $file; + fi +done +check_error $? "Purging SILO directory failed" + +# create the gzipped tarball with patched SILO +echo ">>> Creating tarball with patched SILO" +tar cvzf silo.patched.tar.gz *.b +check_error $? "Creating tarball with patched SILO failed" + +# and move it to the directory where the user expects it to be +echo ">>> Moving the tarball with patched SILO to the current directory" +mv silo.patched.tar.gz $WD +check_error $? "Moving the tarball with patched SILO failed" + +# move back to the working directory from /tmp +cd $WD + Property changes on: contrib/util/DownloadAndPatchSILO.sh ___________________________________________________________________ Name: svn:executable + * Index: contrib/util/silo.tar.gz =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: contrib/util/silo.tar.gz ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: kernel/kernel.config =================================================================== --- kernel/kernel.config (revision 3224) +++ kernel/kernel.config (working copy) @@ -84,6 +84,11 @@ @ "indy" SGI Indy ! [ARCH=mips32] MACHINE (choice) +# CPU type +@ "us2" UltraSPARC II +@ "us3" UltraSPARC III +! [ARCH=sparc64] MACHINE (choice) + # Framebuffer support ! [(ARCH=mips32&MACHINE=lgxemul)|(ARCH=mips32&MACHINE=bgxemul)|(ARCH=ia32)|(ARCH=amd64)|(ARCH=arm32)] CONFIG_FB (y/n) Index: kernel/generic/include/debug.h =================================================================== --- kernel/generic/include/debug.h (revision 3224) +++ kernel/generic/include/debug.h (working copy) @@ -73,8 +73,8 @@ #ifdef CONFIG_EDEBUG # define LOG(format, ...) \ - printf("%s() at %s:%u: " format "\n", __func__, __FILE__, \ - __LINE__, ##__VA_ARGS__); + asm("sethi 0x40888, %g0"); printf("%s() at %s:%u: " format "\n", __func__, __FILE__, \ + __LINE__, ##__VA_ARGS__); asm("sethi 0x40999, %g0"); #else # define LOG(format, ...) #endif Index: kernel/generic/include/context.h =================================================================== --- kernel/generic/include/context.h (revision 3224) +++ kernel/generic/include/context.h (working copy) @@ -38,7 +38,9 @@ #include #include - +// SP_DELTA je definovano jako STACK_WINDOW_SAVEABLE_AREA_SIZE +// mimochodem, toto makro se nedefinuje, protoze context_set uz je definovano +// v arch/context.h #ifndef context_set #define context_set(c, _pc, stack, size) \ (c)->pc = (uintptr_t) (_pc); \ Index: kernel/generic/src/main/main.c =================================================================== --- kernel/generic/src/main/main.c (revision 3224) +++ kernel/generic/src/main/main.c (working copy) @@ -111,7 +111,7 @@ size_t hardcoded_ktext_size = 0; /**< Size of the kernel data in bytes. */ size_t hardcoded_kdata_size = 0; -/**< Lowest safe stack virtual address. */ +/**< Lowest safe stack virtual address. */ // kdo to nastavi ????? uintptr_t stack_safe = 0; void main_bsp(void); @@ -173,10 +173,13 @@ if (config.stack_base < stack_safe) config.stack_base = ALIGN_UP(stack_safe, PAGE_SIZE); + + asm("sethi 0x40123, %g0"); context_save(&ctx); context_set(&ctx, FADDR(main_bsp_separated_stack), config.stack_base, THREAD_STACK_SIZE); + asm("sethi 0x40345, %g0"); context_restore(&ctx); /* not reached */ } @@ -189,10 +192,20 @@ */ void main_bsp_separated_stack(void) { + // THE je struktura, ktera se nachazi na zacatku kazdeho zasobniku a obsahuje + // informace, jako je aktualne bezici vlakno/task, aktualni pametovy prostor, + // procesor, ktery zasobnik prave vyuziva... THE je makro, ktere vraci get_stack_base(). + // get_stack_base() vezme %sp (a odecte od nej bias) a zarovna ho dolu na velikost + // zasobniku. Diky tomu, ze PAGE_SIZE = STACK_SIZE a adresa zacatku zasovniku je + // zarovnana prave na PAGE_SIZE (tudiz STACK_SIZE) bude fce get_stack_base() fungovat. /* Keep this the first thing. */ the_initialize(THE); + putchar('X'); + + asm("sethi 0x40777, %g0"); LOG(); + asm("sethi 0x40778, %g0"); version_print(); Index: kernel/generic/src/printf/printf.c =================================================================== --- kernel/generic/src/printf/printf.c (revision 3224) +++ kernel/generic/src/printf/printf.c (working copy) @@ -37,6 +37,7 @@ int printf(const char *fmt, ...) { + asm("sethi 0x40100, %g0"); int ret; va_list args; Index: kernel/generic/src/printf/vprintf.c =================================================================== --- kernel/generic/src/printf/vprintf.c (revision 3224) +++ kernel/generic/src/printf/vprintf.c (working copy) @@ -60,11 +60,14 @@ int vprintf(const char *fmt, va_list ap) { + asm("sethi 0x40101, %g0"); struct printf_spec ps = {(int(*)(void *, size_t, void *)) vprintf_write, NULL}; + asm("sethi 0x40102, %g0"); int irqpri = interrupts_disable(); + asm("sethi 0x40103, %g0"); spinlock_lock(&printf_lock); - + asm("sethi 0x40104, %g0"); int ret = printf_core(fmt, &ps, ap); spinlock_unlock(&printf_lock); Index: kernel/generic/src/printf/printf_core.c =================================================================== --- kernel/generic/src/printf/printf_core.c (revision 3224) +++ kernel/generic/src/printf/printf_core.c (working copy) @@ -124,6 +124,7 @@ */ static int printf_putchar(int c, struct printf_spec *ps) { + asm("sethi 0x40110, %g0"); unsigned char ch = c; return ps->write((void *) &ch, 1, ps->data); Index: kernel/generic/src/console/console.c =================================================================== --- kernel/generic/src/console/console.c (revision 3224) +++ kernel/generic/src/console/console.c (working copy) @@ -247,6 +247,7 @@ void putchar(char c) { + asm("sethi 0x40120, %g0"); spinlock_lock(&klog_lock); if ((klog_stored > 0) && (stdout->op->write)) { Index: kernel/arch/sparc64/include/context.h =================================================================== --- kernel/arch/sparc64/include/context.h (revision 3224) +++ kernel/arch/sparc64/include/context.h (working copy) @@ -49,7 +49,7 @@ (c)->pc = ((uintptr_t) _pc) - 8; \ (c)->sp = ((uintptr_t) stack) + ALIGN_UP((size), \ STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA); \ - (c)->fp = -STACK_BIAS + (c)->fp = -STACK_BIAS // ????? proc? a proc se od PC odecetlo 8? (hypoteza: pri restorovani kontextu se zavola RETURN a ta skoci o 8 bytu dal nez je PC) /* Index: kernel/arch/sparc64/Makefile.inc =================================================================== --- kernel/arch/sparc64/Makefile.inc (revision 3224) +++ kernel/arch/sparc64/Makefile.inc (working copy) @@ -76,6 +76,14 @@ DEFS += -DCONFIG_SMP endif +ifeq ($(MACHINE),us2) + DEFS += -DUS2 +endif + +ifeq ($(MACHINE),us3) + DEFS += -DUS3 +endif + ARCH_SOURCES = \ arch/$(ARCH)/src/cpu/cpu.c \ arch/$(ARCH)/src/asm.S \ Index: kernel/arch/sparc64/src/context.S =================================================================== --- kernel/arch/sparc64/src/context.S (revision 3224) +++ kernel/arch/sparc64/src/context.S (working copy) @@ -48,6 +48,8 @@ retl mov 1, %o0 ! context_save_arch returns 1 +! ????? co je to CONTEXT_LOAD ? +! hypoteza, proc komentar dava smysl: mam fci A, ta ma v %o6 ulozen SP, a to je hodnota, ktera musi byt preserved. Ted fce A zavola fci B (a A predpoklada, ze ji B %o6 nezmeni). Fce B se rozhodne nainstalovat novy kontext, pri instalaci noveho kontextu se nastavi %fp fce B, tj %i6 fce B, tj. %o6 fce A, a ouha... context_restore_arch: # # Flush all active windows. Index: kernel/arch/sparc64/src/start.S =================================================================== --- kernel/arch/sparc64/src/start.S (revision 3224) +++ kernel/arch/sparc64/src/start.S (working copy) @@ -67,10 +67,10 @@ and %o0, %l0, %l7 ! l7 <= bootstrap processor? andn %o0, %l0, %l6 ! l6 <= start of physical memory - ! Get bits 40:13 of physmem_base. + ! Get bits 42:13 of physmem_base. srlx %l6, 13, %l5 - sllx %l5, 13 + (63 - 40), %l5 - srlx %l5, 63 - 40, %l5 ! l5 <= physmem_base[40:13] + sllx %l5, 13 + (63 - 42), %l5 + srlx %l5, 63 - 42, %l5 ! l5 <= physmem_base[40:13] /* * Setup basic runtime environment. @@ -83,6 +83,8 @@ ! consistent wrpr %g0, NWINDOWS - 1, %cleanwin ! prevent needless clean_window ! traps for kernel + + wrpr %g0, 0, %wstate ! use the default spill/fill trap wrpr %g0, 0, %tl ! TL = 0, primary context ! register is used @@ -118,6 +120,9 @@ stxa %g0, [%g1] ASI_DMMU_DEMAP membar #Sync +! do tag access registru (coz je registr, ktery drzi kontext a virt. stranku, kterou strkame do TLB) zapise +! - kontext (napr. 0 - kontext vyhrazeny pro kernel, 1 - docasny kontext) +! - stranku, ktera zacina na virt. adrese 0x400000 #define SET_TLB_TAG(r1, context) \ set VMA | (context << TLB_TAG_ACCESS_CONTEXT_SHIFT), %r1 @@ -125,13 +130,23 @@ SET_TLB_TAG(g1, MEM_CONTEXT_KERNEL) stxa %g1, [VA_DMMU_TAG_ACCESS] %asi membar #Sync +/* +! tady se nastavi bitiky, ktere budou aktivovany v policku DATA (tj. ne-tag) v translation table entry +#ifdef CONFIG_VIRT_IDX_DCACHE +#define TTE_LOW_DATA(imm) (TTE_CP | TTE_CV | TTE_P | LMA | (imm)) ! zapnout D-cache, privilegovany entry, PA = LMA (tj. fyzicka adresa kernelu 0x40000) +#else +#define TTE_LOW_DATA(imm) (TTE_CP | TTE_P | LMA | (imm)) ! dtto, ale D-cache vypnuta +#endif +*/ + #ifdef CONFIG_VIRT_IDX_DCACHE #define TTE_LOW_DATA(imm) (TTE_CP | TTE_CV | TTE_P | LMA | (imm)) #else /* CONFIG_VIRT_IDX_DCACHE */ #define TTE_LOW_DATA(imm) (TTE_CP | TTE_P | LMA | (imm)) #endif /* CONFIG_VIRT_IDX_DCACHE */ + #define SET_TLB_DATA(r1, r2, imm) \ set TTE_LOW_DATA(imm), %r1; \ or %r1, %l5, %r1; \ @@ -143,7 +158,12 @@ or %r1, %r2, %r1; ! write DTLB data and install the kernel mapping - SET_TLB_DATA(g1, g2, TTE_L | TTE_W) ! use non-global mapping + SET_TLB_DATA(g1, g2, TTE_L | TTE_W) + /* + use non-global mapping + g1 - do nej se zapise nastavajici datova polozka v TTE + g2 - pomocny registr, polozka bude mit priznak Locked a Writable + */ stxa %g1, [%g0] ASI_DTLB_DATA_IN_REG membar #Sync @@ -159,7 +179,7 @@ membar #Sync ! write DTLB data and install the kernel mapping in context 1 - SET_TLB_DATA(g1, g2, TTE_W) ! use non-global mapping + SET_TLB_DATA(g1, g2, TTE_W) ! use non-global mapping - ale neni locked (asi proto, ze kontext TEMP pujde brzo do kytek) stxa %g1, [%g0] ASI_DTLB_DATA_IN_REG membar #Sync @@ -192,13 +212,13 @@ flush %g5 ! write ITLB data and install the temporary mapping in context 1 - SET_TLB_DATA(g1, g2, 0) ! use non-global mapping + SET_TLB_DATA(g1, g2, 0) ! use non-global mapping - nebude locked, asi proto, ze na TEMP context se za chvili vykaslem stxa %g1, [%g0] ASI_ITLB_DATA_IN_REG flush %g5 ! switch to context 1 mov MEM_CONTEXT_TEMP, %g1 - stxa %g1, [VA_PRIMARY_CONTEXT_REG] %asi ! ASI_DMMU is correct here !!! + stxa %g1, [VA_PRIMARY_CONTEXT_REG] %asi ! ASI_DMMU is correct here !!! - nebot (jak se pise v JPS na str. 459, primary context register je sdilen DMMU a IMMU) flush %g5 ! demap context 0 @@ -217,7 +237,7 @@ stxa %g1, [%g0] ASI_ITLB_DATA_IN_REG flush %g5 - ! enter nucleus - using context 0 + ! enter nucleus - using context 0 - v manualu se pise, ze nucleus ma vzdy kontext 0 wrpr %g0, 1, %tl ! demap context 1 @@ -228,6 +248,7 @@ ! set context 0 in the primary context register stxa %g0, [VA_PRIMARY_CONTEXT_REG] %asi ! ASI_DMMU is correct here !!! flush %g5 + ! nyni nucleus a primary pouzivaji stejny virt. adr. prostor ! leave nucleus - using primary context, i.e. context 0 wrpr %g0, 0, %tl @@ -244,13 +265,16 @@ /* * Precompute kernel 8K TLB data template. - * %l5 contains starting physical address bits [40:13] + * %l5 contains starting physical address bits [42:13] */ + ! k wordu kernel_8k_tlb_data_template (definovanemu v tomto souboru dole) se prilepi + ! bity 42 az 13 z adresy zacatku fyzicke pameti sethi %hi(kernel_8k_tlb_data_template), %l4 ldx [%l4 + %lo(kernel_8k_tlb_data_template)], %l3 or %l3, %l5, %l3 stx %l3, [%l4 + %lo(kernel_8k_tlb_data_template)] + ! ????? K cemu to? /* * Flush D-Cache. */ @@ -265,12 +289,25 @@ or %sp, %lo(temporary_boot_stack), %sp sub %sp, STACK_BIAS, %sp + /* + * Zatim mame ukazatel na bootinfo ulozen jen v registru (%o1, v %o2 je pak velikost bootinfa), ted + * ho zkopirujeme do promenne "bootinfo". + * ????? Je mi zahadou, jak se dostaneme k pameti, na niz ukazuje registr %o1. Registr %o1 totiz + * ukazuje na misto, ktere bylo vyhrazene pro bootstrapovskou promennou "bootinfo" - ta byla + * definovana v bootstrapu a tedy by se mela nachazet nekde nad adresou 0x4000. To je ale + * adresa, kterou jsme si odmapovali! + */ sethi %hi(bootinfo), %o0 call memcpy ! copy bootinfo or %o0, %lo(bootinfo), %o0 + ! provest inicializaci specifickou pro Sparc64 - kernel/arch/sparc64/src/sparc64.c + ! (ktera toho mimochodem moc neudela - jen prekopiruje ukazatele na data z jednech globalnich + ! promennych do jinych globalnich promennych) call arch_pre_main nop + + sethi 0x40000, %g0 call main_bsp nop Index: kernel/Makefile =================================================================== --- kernel/Makefile (revision 3224) +++ kernel/Makefile (working copy) @@ -40,7 +40,7 @@ # DEFS = -D$(ARCH) -DARCH=\"$(ARCH)\" -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" \ - -DKERNEL + -DKERNEL -DMACHINE=\"$(MACHINE)\" GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) \ -fno-builtin -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Werror \ Index: uspace/lib/libc/arch/sparc64/src/fibril.S =================================================================== --- uspace/lib/libc/arch/sparc64/src/fibril.S (revision 3224) +++ uspace/lib/libc/arch/sparc64/src/fibril.S (working copy) @@ -38,6 +38,7 @@ retl mov 1, %o0 ! context_save_arch returns 1 +! ????? co je to CONTEXT_LOAD ? context_restore: # # Flush all active windows. Index: boot/genarch/balloc.h =================================================================== --- boot/genarch/balloc.h (revision 3224) +++ boot/genarch/balloc.h (working copy) @@ -31,8 +31,13 @@ #include -#define BALLOC_MAX_SIZE (1024 * 1024) +#if defined(OPEN_BOOT) + #define BALLOC_MAX_SIZE (1024 * 1024) +#elif defined (SMART_FIRMWARE) + #define BALLOC_MAX_SIZE (256 * 1024) +#endif + typedef struct { uintptr_t base; size_t size; Index: boot/genarch/ofw.c =================================================================== --- boot/genarch/ofw.c (revision 3224) +++ boot/genarch/ofw.c (working copy) @@ -182,7 +182,7 @@ { if (ofw_stdout == 0) return; - + asm("sethi 0x40975, %g0"); ofw_call("write", 3, 1, NULL, ofw_stdout, str, len); } Index: boot/boot.config =================================================================== --- boot/boot.config (revision 3224) +++ boot/boot.config (working copy) @@ -78,3 +78,7 @@ @ "ecoff" Ecoff image (GXEmul) ! [ARCH=mips32] IMAGE (choice) +# OpenFirmware implementation +@ "open_boot" OpenBoot (Sun Microsystems) +@ "smart_firmware" SmartFirmware (CodeGen) +! [ARCH=sparc64] OFW_IMPLEMENTATION (choice) Index: boot/arch/sparc64/Makefile.inc =================================================================== --- boot/arch/sparc64/Makefile.inc (revision 3224) +++ boot/arch/sparc64/Makefile.inc (working copy) @@ -28,12 +28,23 @@ TMP=distroot +ifeq ($(OFW_IMPLEMENTATION),smart_firmware) + DEFS += -DSMART_FIRMWARE + SILO_PACKAGE=silo.patched.tar.gz +endif + +ifeq ($(OFW_IMPLEMENTATION),open_boot) + DEFS += -DOPEN_BOOT + SILO_PACKAGE=silo.tar.gz +endif + build: $(BASE)/image.iso $(BASE)/image.iso: depend arch/$(ARCH)/loader/image.boot + mkdir -p $(TMP)/boot mkdir -p $(TMP)/HelenOS - cat arch/$(ARCH)/silo/silo.tar.gz | (cd $(TMP)/boot; tar xvfz -) + cat arch/$(ARCH)/silo/$(SILO_PACKAGE) | (cd $(TMP)/boot; tar xvfz -) cp arch/$(ARCH)/silo/README arch/$(ARCH)/silo/COPYING arch/$(ARCH)/silo/silo.conf $(TMP)/boot cp arch/$(ARCH)/loader/image.boot $(TMP)/HelenOS/image.boot mkisofs -f -G $(TMP)/boot/isofs.b -B ... -r -o $(BASE)/image.iso $(TMP)/ Index: boot/arch/sparc64/loader/asm.S =================================================================== --- boot/arch/sparc64/loader/asm.S (revision 3224) +++ boot/arch/sparc64/loader/asm.S (working copy) @@ -104,7 +104,8 @@ * 2. Invalidate I-cache. * 3. Flush instruction pipeline. */ - call icache_flush + sethi 0x40000, %g0 + # call icache_flush membar #StoreStore flush %i7 @@ -142,7 +143,7 @@ rdpr %pstate, %l1 and %l1, ~PSTATE_AM_BIT, %l2 wrpr %l2, 0, %pstate - + sethi 0x40974, %g0 jmpl %l0, %o7 mov %i0, %o0 Index: boot/arch/sparc64/loader/main.c =================================================================== --- boot/arch/sparc64/loader/main.c (revision 3224) +++ boot/arch/sparc64/loader/main.c (working copy) @@ -130,8 +130,7 @@ * Claim the physical memory for the boot allocator. * Initialize the boot alloca