linksos-commit Mailing List for Links OS: Swift, Secure, Straightforward (Page 9)
Status: Inactive
Brought to you by:
terencevs
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(57) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(135) |
Feb
(3) |
Mar
(86) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ke...@to...> - 2003-01-03 21:24:39
|
Update of /cvsroot/linksos/linksos/hal In directory router-internal.tossell.net:/tmp/cvs-serv19726 Modified Files: Makefile Added Files: include.mk Log Message: Title: Basic HAL layout Changes: Added the new makefile and kstdio.c. Added x86 makefile and include.mk makefile include. Effects: kprintf should be ready to link into the kernel... once the kernel is ready to be linked :P a=kennyt --- NEW FILE: include.mk --- INCDIRS += ../prototypes Index: Makefile =================================================================== RCS file: /cvsroot/linksos/linksos/hal/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 3 Jan 2003 20:46:02 -0000 1.1 --- Makefile 3 Jan 2003 21:24:34 -0000 1.2 *************** *** 1,2 **** --- 1,6 ---- + TOPDIR = ../ + + include $(TOPDIR)/machine.mk + LD = ld *************** *** 6,12 **** hal: hal-$(ARCH).o hal-$(ARCH).o: ! cd $(ARCH) ! gmake hal ! cp hal.o ../ \ No newline at end of file --- 10,16 ---- hal: hal-$(ARCH).o + rm -f hal.o + cp $(ARCH)/hal.o ./ hal-$(ARCH).o: ! cd $(ARCH) && make hal |
|
From: <ke...@to...> - 2003-01-03 20:46:06
|
Update of /cvsroot/linksos/linksos/hal In directory router-internal.tossell.net:/tmp/cvs-serv17282 Added Files: Makefile Log Message: Title: Makefile Changes: Added initial Makefile to pick up on the arch and go to the correct dir and `make`. Effects: Portability Notes: need to define arch a=kennyt --- NEW FILE: Makefile --- LD = ld GCC = gcc ASM = NASM hal: hal-$(ARCH).o hal-$(ARCH).o: cd $(ARCH) gmake hal cp hal.o ../ |
|
From: <ke...@to...> - 2003-01-03 20:35:40
|
Update of /cvsroot/linksos/linksos/boot/x86 In directory router-internal.tossell.net:/tmp/cvs-serv17143 Added Files: strap.asm Log Message: Title: strap.asm Changes: added bootstrap code to this directory (from main/) Effects: Portability dude a=kennyt --- NEW FILE: strap.asm --- ;----------------------------------------------------------------------------- ; filename: strap.asm ; creation date: unknown ; author: Charles Banas ; Edited by Kye Lewis (kye...@us...) ; version: 0.02 ;----------------------------------------------------------------------------- ; revision history: ; 12/22/2002 - 1136 MST - Charles Banas ; prepared for CVS commit. added comments. ; 20021229 - 0738GMT - Kye Lewis (kye...@us...) ; Changed so the file links and compiles on NASM correctly ; Changed BITS 16 to BITS 32, and fixed 3 other lines. ;----------------------------------------------------------------------------- ; description: ; this file provides the ability for the kernel to boot with a ; minimal bootloader that does not provide A20 or p-mode support. ;----------------------------------------------------------------------------- ;[BITS 16] [BITS 32] [SECTION .text] [GLOBAL _start] ; this part is meant for compatibility with the standard BeFS bootloader. ; the BeFS bootloader loads the kernel image at 1000h:0000h and jumps to ; 1000h:0200h. the DOS-compatible bootloader i use jumps to 1000h:0000h. jmp _start times (0x1fd) nop ;---------------------------- ; _start function ;---------------------------- ; default symbol name used by the linker _start: mov ax,0x1000 mov ds,ax mov es,ax mov fs,ax mov gs,ax cli mov ax,0x9000 mov ss,ax mov sp,ax sti mov si,[booting] call _disp_str call _set_a20 ; call _check_a20 jnc a20_good ; alternately, using the _check_a20 code, jz must be used. call _a20_dump a20_good: call _check_mem xor ebx,ebx mov bx,cs shl ebx,4 mov eax,ebx lea eax,[ebx] ; jmp $ mov [gdt2 + 2],ax ; set descriptor base address=EAX mov [gdt3 + 2],ax shr eax,16 mov [gdt2 + 4],al mov [gdt3 + 4],al mov [gdt2 + 7],ah mov [gdt3 + 7],ah lea eax,[ebx + gdt] ; point gdt_ptr to the gdt mov [gdt_ptr + 2],eax ; EAX=linear address of gdt push dword 0 ; zero EFLAGS (interrupts off, popfd ; IOPL=0, NT bit=0) lgdt [gdt_ptr] mov eax,cr0 or al,1 mov cr0,eax mov si,[pmodeswitch] call _disp_str jmp SYS_CODE_SEL:do_pm ;---------------------------- ; _a20_dump function ;---------------------------- ; dumps because a20 is not set _a20_dump: mov si,[a20fail] call _disp_str ; xor ax,ax ; int 0x16 ; int 0x19 ret ; for now. it's a pain to test on Bochs when a20 never enables. ; besides, using a BIOS function works on all tested machines. ;---------------------------- ; _disp_str function ;---------------------------- ; input: ; ds:si location of string to print ; clobbers: ; ax, bx ;---------------------------- ; default "print string" function for use before pmode _disp_str: lodsb or al,al jz done_str mov ah,0x0E ; mov bx,0x7 db 0xBB, 0x07, 0x00 ; why not "mov bx, 0x7" you ask? try it for yourself using int 0x10 ; NASM 0.98.35. then disassemble. then look. closely. jmp _disp_str done_str: ret ;---------------------------- ; _set_a20 function ;---------------------------- ; sets the a20 line to make all memory available ; right now, ONLY BIOS code is used. should this start failing, i will rewrite ; the code to try alternate methods. *DOES NOT WORK ON BOCHS.* in fact, none of ; this code does. but, the BIOS code works on most tested systems, so i have ; rather high hopes. ; ignore the messiness. _set_a20: ; push si ; push ax mov ax,2401h int 15h ; jnc saf3 ; in al,92h ; or ah,ah ; jne saf1 ; BIOS bug: do NOT clear b1 if it's already clear ; test al,02h ; je saf3 ; and al,0FDh ; jmp short saf2 ;saf1: ; BIOS bug: do NOT set b1 if it's already set ; test al,02h ; jne saf3 ; or al,02h ;saf2: ; out 92h,al ;saf3: ; pop ax ; pop si ret ;---------------------------- ; _check_a20 function ;---------------------------- ; output: ; ZF 1 if a20 off, 0 if on. ;---------------------------- ; verifies a20 status ;_check_a20: ; mov ax,2402h ; int 15h ; jnc check_done ; ; push ax ; push ds ; push es ; xor ax,ax ; mov ds,ax ; dec ax ; mov es,ax ; ; mov ax,[es:10h] ; read word at FFFF:0010 (1 meg) ; not ax ; 1's complement ; push word [0] ; save word at 0000:0000 (0) ; mov [0],ax ; word at 0 = ~(word at 1 meg) ; mov ax,[0] ; read it back ; cmp ax,[es:10h] ; fail if word at 0 == word at 1 meg ; pop word [0] ; pop es ; pop ds ; pop ax ; ;check_done: ; ret ; if ZF=1, the A20 gate is NOT enabled ;---------------------------- ; _check_mem function ;---------------------------- ; uses BIOS calls to get memory size - falls back to manual scans if needbe. ; i've elected to not use INT15h, AH=88h because of its severe limitations. ; i'll implement a manual scan only if the need arises. i don't expect this ; to be executed on ancient machines, so the need for antiquated methods may ; not even arise. we'll see. i need to print the contents of "_availmem" ; very soon, though. in the kernel init maybe? _check_mem: mem1: ;------- INT 15h AX=E801h xor eax,eax mov ax,0xe801 int 15h jc mem2 cmp ax,0xe801 je mem2 shl ebx,8 add eax,ebx mov [_availmem],eax jmp mem_done mem2: ;------- INT 15h AH=8Ah xor eax,eax xor edx,edx mov ah,0x8A int 15h cmp eax,0x0 jz mem3 shl edx,16 or eax,edx mov [_availmem],eax jmp mem_done mem3: ;------- alternate method mem_done: ret [SECTION .data] ; strings booting: db 'Initializing LinksOS kernel...',0xd,0xa,0x0 a20fail: db 'Failed setting A20!',0xd,0xa,0x0 pmodeswitch: db 'Switching to protected mode...',0xd,0xa,0x0 pmodefail: db 'P-mode failed!',0xd,0xa,0x0 _availmem: dd 0 ; to be filled with amount of memory available in K [GLOBAL _availmem] ; null descriptor gdt: dw 0 ; limit 15:0 dw 0 ; base 15:0 db 0 ; base 23:16 db 0 ; type db 0 ; limit 19:16, flags db 0 ; base 31:24 ; linear data segment descriptor LINEAR_SEL equ $-gdt dw 0xFFFF ; limit 0xFFFFF (1 meg? 4 gig?) dw 0 ; base for this one is always 0 db 0 db 0x92 ; present,ring 0,data,expand-up,writable db 0xCF ; page-granular (4 gig limit), 32-bit db 0 ; code segment descriptor SYS_CODE_SEL equ $-gdt gdt2: dw 0xFFFF dw 0 ; (base gets set above) db 0 db 0x9A ; present,ring 0,code,non-conforming,readable db 0xCF db 0 ; data segment descriptor SYS_DATA_SEL equ $-gdt gdt3: dw 0xFFFF dw 0 ; (base gets set above) db 0 db 0x92 ; present,ring 0,data,expand-up,writable db 0xCF db 0 gdt_end: gdt_ptr: dw gdt_end - gdt - 1 ; GDT limit dd gdt ; linear, physical address of GDT ;--------------- ; Protected-mode segment ;--------------- do_pm: mov ax,SYS_DATA_SEL ; now in 32-bit pmode mov ds,eax ; EAX works, one byte smaller :) mov ss,eax nop mov es,eax mov fs,eax mov gs,eax xor eax,eax ; zero top 16 bits of ESP mov ax,sp mov esp,eax ;[EXTERN _main] ; call _main ; call C code jmp $ ; freeze ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; time to link to C code now! ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
From: <ke...@to...> - 2003-01-03 20:34:47
|
Update of /cvsroot/linksos/linksos/fs In directory router-internal.tossell.net:/tmp/cvs-serv17083 Removed Files: makeboot.c Log Message: Title: makeboot.c Changes: Removed makeboot.c Effects: We'll do this right later. a=kennyt --- makeboot.c DELETED --- |
|
From: <ke...@to...> - 2003-01-03 20:31:33
|
Update of /cvsroot/linksos/linksos/main In directory router-internal.tossell.net:/tmp/cvs-serv16972 Removed Files: strap.asm Log Message: Title: strap.asm Changes: Removed strap.asm Effects: ^ will appear in boot/x86/ a=kennyt --- strap.asm DELETED --- |
|
From: <ke...@to...> - 2003-01-03 20:29:44
|
Update of /cvsroot/linksos/linksos/main/include In directory router-internal.tossell.net:/tmp/cvs-serv16893/include Removed Files: kstdio.h Log Message: Title: Removed kernel stdio. Changes: Removed kstdio.{c,h} Effects: Moving to the hal structure a=kennyt --- kstdio.h DELETED --- |
|
From: <ke...@to...> - 2003-01-03 20:29:44
|
Update of /cvsroot/linksos/linksos/main In directory router-internal.tossell.net:/tmp/cvs-serv16893 Removed Files: kstdio.c Log Message: Title: Removed kernel stdio. Changes: Removed kstdio.{c,h} Effects: Moving to the hal structure a=kennyt --- kstdio.c DELETED --- |
|
From: <ke...@to...> - 2003-01-03 20:27:48
|
Update of /cvsroot/linksos/linksos/hal/prototypes In directory router-internal.tossell.net:/tmp/cvs-serv16849 Added Files: kstdio.h Log Message: Title: kstdio.h Changes: added header and removed the DOORS reference in the header guard. Effects: global header for kernel stdio a=kennyt --- NEW FILE: kstdio.h --- /****************************************************************************\ ** filename: kstdio.h ** ** creation date: 11/29/2002, 0103 MST ** ** author: Charles Banas ** ** version: 0.01 ** ****************************************************************************** ** revision history: ** ** 11/29/2002 - 0103 MST - Charles ** ** added kprintf(). let's see if this baby links, eh. ** \****************************************************************************/ #ifndef __KSTDIO_H__ #define __KSTDIO_H__ void kprintf(char* text); #endif /* __KSTDIO_H__ */ |
|
From: <ke...@to...> - 2003-01-03 20:22:31
|
Update of /cvsroot/linksos/linksos/hal/x86 In directory router-internal.tossell.net:/tmp/cvs-serv16785 Added Files: kstdio.c Log Message: Title: kernel stdio Changes: Moved a copy of kstdio.c (kprintf so far) to the x86 hal dir. Effects: Portability dude a=kennyt --- NEW FILE: kstdio.c --- /****************************************************************************\ ** filename: kstdio.c ** ** creation date: 11/29/2002, 0109 MST ** ** author: Charles Banas ** ** version: 0.01 ** ****************************************************************************** ** revision history: ** ** 11/29/2002 - 0109 MST - Charles ** ** added kprintf(). let's see if this baby links, eh. ** \****************************************************************************/ #include "include/kstdio.h" typedef unsigned char u_char; /* this needs to be moved to a "types" header file. */ void kprintf(char* text) /* kernel-mode printf: to be used ONLY within the kernel and ONLY in text-mode. any other mode can be disastrous, as this code does not check what mode it is in. optimization is pointless and makes no sense anyway. version 0.02 will have extended parameters. :) */ { /* write 'text' to screen. */ static char* screen = (char*)0xB8000; int j; static int i = 0; static u_char prev; for(j=0;text[j]!=0;++i,j++) { /* don't be scared. it's kosher. :) */ if (((text[j]==0xa) || (text[j]==0xd)) && ((prev==0xa) || (prev==0xd))) { continue; prev = text[j]; } else if ((text[j]==0xa) || (text[j]==0xd)) { i = i + (0xa0); prev = text[j]; continue; } prev = text[j]; screen[i*2] = text[j]; screen[i*2+1] = 7; } } |
|
From: <ke...@to...> - 2003-01-03 20:21:03
|
Update of /cvsroot/linksos/linksos/hal/prototypes In directory router-internal.tossell.net:/tmp/cvs-serv16736/prototypes Log Message: Directory /cvsroot/linksos/linksos/hal/prototypes added to the repository |
|
From: <ke...@to...> - 2003-01-03 20:10:43
|
Update of /cvsroot/linksos/linksos/boot In directory router-internal.tossell.net:/tmp/cvs-serv16580 Removed Files: bootsec.asm Log Message: Title: Unused File Changes: Removed unused bootsec.asm - boot code is done elsewhere. Effects: Cleanup a=kennyt --- bootsec.asm DELETED --- |
|
From: <ke...@to...> - 2003-01-03 20:09:24
|
Update of /cvsroot/linksos/linksos/hw/x86/extended In directory router-internal.tossell.net:/tmp/cvs-serv16537/extended Log Message: Directory /cvsroot/linksos/linksos/hw/x86/extended added to the repository |
|
From: <ke...@to...> - 2003-01-03 20:09:23
|
Update of /cvsroot/linksos/linksos/hw/x86/native In directory router-internal.tossell.net:/tmp/cvs-serv16537/native Log Message: Directory /cvsroot/linksos/linksos/hw/x86/native added to the repository |
|
From: <ke...@to...> - 2003-01-03 20:08:45
|
Update of /cvsroot/linksos/linksos/hw/x86 In directory router-internal.tossell.net:/tmp/cvs-serv16511/x86 Log Message: Directory /cvsroot/linksos/linksos/hw/x86 added to the repository |
|
From: <ke...@to...> - 2003-01-03 20:08:27
|
Update of /cvsroot/linksos/linksos/hal/x86 In directory router-internal.tossell.net:/tmp/cvs-serv16493/x86 Log Message: Directory /cvsroot/linksos/linksos/hal/x86 added to the repository |
|
From: <ke...@to...> - 2003-01-03 20:07:13
|
Update of /cvsroot/linksos/linksos/hal In directory router-internal.tossell.net:/tmp/cvs-serv16472/hal Log Message: Directory /cvsroot/linksos/linksos/hal added to the repository |
|
From: <ke...@to...> - 2003-01-03 20:06:52
|
Update of /cvsroot/linksos/linksos/boot/x86 In directory router-internal.tossell.net:/tmp/cvs-serv16451/x86 Log Message: Directory /cvsroot/linksos/linksos/boot/x86 added to the repository |
|
From: <ke...@to...> - 2003-01-03 20:05:33
|
Update of /cvsroot/linksos/linksos/hw In directory router-internal.tossell.net:/tmp/cvs-serv16425/hw Log Message: Directory /cvsroot/linksos/linksos/hw added to the repository |
|
From: <ke...@to...> - 2003-01-02 01:41:02
|
Update of /cvsroot/linksos/website/content In directory router-internal.tossell.net:/tmp/cvs-serv28780/content Modified Files: time.php Log Message: Title: Time Plotter Changes: Added plottime() and devsbyhour() - plottime shows the local times for all timezones, and the people in those timezones. Effects: People can now enter a time of day and timezone, and have the current time in many timezones displayed to them. This could assist in planning meetings, etc. Future work: It'd be nice to have the sunlight shown for each timezone. a=kennyt Index: time.php =================================================================== RCS file: /cvsroot/linksos/website/content/time.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** time.php 30 Dec 2002 09:18:08 -0000 1.2 --- time.php 2 Jan 2003 01:40:56 -0000 1.3 *************** *** 1,15 **** - <table style="font-size: 12px"><tr> <? ! /* go through by the hour and list devs */ ! for ( $h = -12; $h < 13; $h++ ) { ! echo '<td valign="top"' . ( is_integer($h/2) ? 'bgcolor="#CCCCCC"' : '' ). '><b>' . ( $h>0 ? '+' . $h : $h ) . '</b><br>'; ! $tzd_people = mysql_query('SELECT unixname,fullname FROM linksos_people WHERE gmt = ' . $h); ! if (mysql_num_rows($tzd_people)) { ! while ( $person = mysql_fetch_row($tzd_people ) ) { ! echo $person[1] . '<div align="right">(' . $person[0] . ')</div>'; } } echo '</td>'; } ! ?> ! </tr></table> \ No newline at end of file --- 1,46 ---- <? ! function devsbyhour() { ! echo '<table style="font-size: 12px"><tr>'; ! ! /* go through by the hour and list devs */ ! for ( $h = -12; $h < 13; $h++ ) { ! echo '<td valign="top"' . ( is_integer($h/2) ? 'bgcolor="#CCCCCC"' : '' ). '><b>' . ( $h>0 ? '+' . $h : $h ) . '</b><br>'; ! $tzd_people = mysql_query('SELECT unixname,fullname FROM linksos_people WHERE gmt = ' . $h); ! if (mysql_num_rows($tzd_people)) { ! while ( $person = mysql_fetch_row($tzd_people ) ) { ! echo $person[1] . '<div align="right">(' . $person[0] . ')</div>'; ! } } + echo '</td>'; } + echo '</tr></table>'; + } + + function plottime($time, $tz){ + /* Show the local times of developers for a given time $time at $tz */ + echo '<b>At ' . $time . ':00 GMT ' . $tz . '</b><br>'; + echo '<table style="font-size: 12px"><tr>'; + $gmt = $time - $tz; + for ( $t = -12; $t < 13; $t++ ) { + $tzd_people = mysql_query('SELECT unixname,fullname FROM linksos_people WHERE gmt = ' . $t); + echo '<td valign="top"' . (is_integer($t/2) ? 'bgcolor="#cccccc"' : '' ) . '><b>' . ( ($gmt + $t) < 24 ? ($gmt+$t) : ( ($gmt+$t)-24 ) ) . '</b><p />'; + while ( $tz_person = mysql_fetch_row($tzd_people) ) { + echo $tz_person[0] . '<br>'; + } echo '</td>'; + } + echo '</tr></table>'; } ! ! if (isSet($_REQUEST["time"])) { ! if ( isSet($_REQUEST["tz"]) ) ! plottime($_REQUEST["time"], $_REQUEST["tz"]); ! else { ! if ($_SESSION["user"][0] && $_SESSION["user"][6] != 25) ! plottime($_REQUEST["time"], $_SESSION["user"][6]); ! else ! echo 'You must specify a timezone (tz), or be logged in and have your timezone set.'; ! } ! } else ! devsbyhour(); ! ?> \ No newline at end of file |
|
From: <ke...@to...> - 2003-01-02 01:26:23
|
Update of /cvsroot/linksos/website/content In directory router-internal.tossell.net:/tmp/cvs-serv28576/content Modified Files: person_edit.php Log Message: Title: Timezone Specification Changes: Added timezone field and code to write the selection to DB. Effects: Users can set their timezone by themselves. a=kennyt Index: person_edit.php =================================================================== RCS file: /cvsroot/linksos/website/content/person_edit.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** person_edit.php 24 Dec 2002 01:48:23 -0000 1.2 --- person_edit.php 2 Jan 2003 01:26:16 -0000 1.3 *************** *** 7,12 **** if ($_REQUEST["newpassword"] && $_REQUEST["newpasswordconfirm"] && $_REQUEST["newpassword"] = $_REQUEST["newpasswordconfirm"] ) { mysql_query('UPDATE linksos_people SET password = PASSWORD(\'' . $_REQUEST["newpassword"] . '\') WHERE uid = ' . $user[0]) or die('Couldn\'t set password.'); ! } else ! echo $lang['pass_conf_req']; break; default: --- 7,20 ---- if ($_REQUEST["newpassword"] && $_REQUEST["newpasswordconfirm"] && $_REQUEST["newpassword"] = $_REQUEST["newpasswordconfirm"] ) { mysql_query('UPDATE linksos_people SET password = PASSWORD(\'' . $_REQUEST["newpassword"] . '\') WHERE uid = ' . $user[0]) or die('Couldn\'t set password.'); ! echo 'Password changed.<br>'; ! } else { ! if ( $_REQUEST["newpassword"] || $_REQUEST["newpasswordconfirm"] ) ! echo $lang['pass_conf_req']; } ! // if ( $REQUEST["newtimezone"] ) { ! if ( $_REQUEST["newtimezone"] != $_SESSION["user"][6] ) { ! mysql_query('UPDATE linksos_people SET gmt = \'' . $_REQUEST["newtimezone"] . '\' WHERE uid = ' . $_SESSION["user"][0]) or die('Could not update timezone.<br>'); ! echo 'Timezone updated.<br>'; ! } ! // } break; default: *************** *** 15,18 **** --- 23,31 ---- $lang['password'] . ': <input type="password" name="newpassword"><br>' . $lang['confirm'] . ': <input type="password" name="newpasswordconfirm"><br>' . + 'Timezone: <select name="newtimezone">'; + for ( $t = -12; $t < 13; $t++ ) { + echo '<option value="' . $t . '"' . ( $t == $_SESSION["user"][6] ? ' selected' : '' ) . '>GMT ' . ($t > 0 ? '+' : ($t == 0 ? '+-' : '-') ) . abs($t) . '</option>'; + } + echo '</select><br>' . '<input type="submit" value="' . $lang['commit'] . '"></form>'; break; |
|
From: <ke...@us...> - 2003-01-01 07:27:45
|
Update of /cvsroot/linksos/linksos/main
In directory sc8-pr-cvs1:/tmp/cvs-serv18351
Modified Files:
Makefile kernel.ls kstdio.c main.c strap.asm
Removed Files:
boot.S io.c
Log Message:
Title: Backed Out
Changes: Backed out changes from the most recent commit. 1- server has moved (this
repository shouldn't be used), 2- a= is *always* applicable :P
Effects: This code will need to be checked into the new cvs.
a=kennyt,kyethespy
Index: Makefile
===================================================================
RCS file: /cvsroot/linksos/linksos/main/Makefile,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Makefile 1 Jan 2003 06:49:06 -0000 1.5
--- Makefile 1 Jan 2003 07:27:39 -0000 1.6
***************
*** 8,12 ****
#The assembler
! AS = as
# The linker
--- 8,12 ----
#The assembler
! ASM = nasm
# The linker
***************
*** 14,24 ****
# The kernel filename
! KERNELFN = kernel.elf
# The object files
! OBJS = kstdio.o main.o boot.o io.o
#Compiler parameters
! CFLAGS = -Wall -O -fomit-frame-pointer -c -o
--- 14,25 ----
# The kernel filename
! KERNELFN = kernel.bin
# The object files
! OBJS = kstdio.o main.o strap.o
#Compiler parameters
! CFLAGS = -I$(INCLUDE) -Wall -O -fomit-frame-pointer -c -o
! ASMFLAGS = -f elf
***************
*** 28,38 ****
$(KERNELFN): $(OBJS)
! $(LD) -Bstatic -o $(KERNELFN) $(OBJS) -Map kernel.map -Ttext 0x100000
.c.o:
$(CC) $(CFLAGS) $@ $<
! .S.o:
! $(CC) $(CFLAGS) $@ $<
clean:
--- 29,39 ----
$(KERNELFN): $(OBJS)
! $(LD) -Bstatic -o $(KERNELFN) $(OBJS) -Map kernel.map -T kernel.ls
.c.o:
$(CC) $(CFLAGS) $@ $<
! .asm.o:
! $(ASM) $(ASMFLAGS) $<
clean:
Index: kernel.ls
===================================================================
RCS file: /cvsroot/linksos/linksos/main/kernel.ls,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** kernel.ls 1 Jan 2003 06:49:07 -0000 1.3
--- kernel.ls 1 Jan 2003 07:27:39 -0000 1.4
***************
*** 1,6 ****
! OUTPUT_FORMAT("elf32")
ENTRY(_start)
SECTIONS
! { .text 0x000100000:
{ *(.text)
. = ALIGN(4096);
--- 1,6 ----
! OUTPUT_FORMAT("binary")
ENTRY(_start)
SECTIONS
! { .text 0x00010000 :
{ *(.text)
. = ALIGN(4096);
Index: kstdio.c
===================================================================
RCS file: /cvsroot/linksos/linksos/main/kstdio.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** kstdio.c 1 Jan 2003 06:49:07 -0000 1.2
--- kstdio.c 1 Jan 2003 07:27:39 -0000 1.3
***************
*** 11,15 ****
#include "include/kstdio.h"
- #include "include/io.h"
typedef unsigned char u_char; /* this needs to be moved to a "types"
--- 11,14 ----
***************
*** 25,57 ****
{
/* write 'text' to screen. */
! static char* screen = (char*)0xB8000;
! static int curchar,off;
!
! /*First get the cursor's current position on screen*/
! outportb(0x3d4, 0x0e); /* Get cursor Y position */
! off = inportb(0x3d5);
! off <<= 8;
! outportb(0x3d4, 0x0f); /* And add cursor X position */
! off += inportb(0x3d5);
! off <<= 1;
!
! while((curchar = *text++)){ /*Process text char by char*/
! switch(curchar){
!
! case '\n': /*It is a carriage return*/
! off = 160 + (off/160)*160;
! break;
!
! default: /*Just spit character onto screen*/
! screen[off++] = curchar;
! screen[off++] = 0x07;
! }
! }
! /*Move cursor to new screen position*/
! off >>= 1;
! outportb(0x3d4,0x0f);
! outportb(0x3d5,off & 0x0ff);
! outportb(0x3d4,0x0e);
! outportb(0x3d5,off >> 8);
}
--- 24,45 ----
{
/* write 'text' to screen. */
! static char* screen = (char*)0xB8000;
! int j;
! static int i = 0;
! static u_char prev;
! for(j=0;text[j]!=0;++i,j++) { /* don't be scared. it's kosher. :) */
! if (((text[j]==0xa) || (text[j]==0xd)) && ((prev==0xa) || (prev==0xd))) {
! continue;
! prev = text[j];
! }
! else if ((text[j]==0xa) || (text[j]==0xd)) {
! i = i + (0xa0);
! prev = text[j];
! continue;
! }
! prev = text[j];
! screen[i*2] = text[j];
! screen[i*2+1] = 7;
! }
}
Index: main.c
===================================================================
RCS file: /cvsroot/linksos/linksos/main/main.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** main.c 1 Jan 2003 06:49:07 -0000 1.3
--- main.c 1 Jan 2003 07:27:39 -0000 1.4
***************
*** 13,25 ****
#include "include/kstdio.h"
- #include "include/multiboot.h"
! void cmain(unsigned long magic, multiboot_info_t addr)
{
! if(magic != MULTIBOOT_BOOTLOADER_MAGIC)
! {
! kprintf("Invalid bootloader magic number\n");
! return;
! }
! kprintf("LinksOS v0.0.1a kernel booted.\n");
}
--- 13,20 ----
#include "include/kstdio.h"
! void main(void)
{
! while(1);
! kprintf("LinksOS v0.0.1a kernel booted.");
}
Index: strap.asm
===================================================================
RCS file: /cvsroot/linksos/linksos/main/strap.asm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** strap.asm 1 Jan 2003 06:49:07 -0000 1.5
--- strap.asm 1 Jan 2003 07:27:39 -0000 1.6
***************
*** 1,19 ****
;-----------------------------------------------------------------------------
! ;- filename: strap.asm --
! ;- creation date: unknown --
! ;- author: Charles Banas --
! ;- version: 0.01 --
;-----------------------------------------------------------------------------
! ;- revision history: --
! ;- 12/22/2002 - 1136 MST - Charles Banas --
! ;- prepared for CVS commit. added comments. --
;-----------------------------------------------------------------------------
! ;- description: --
! ;- this file provides the ability for the kernel to boot with a --
! ;- minimal bootloader that does not provide A20 or p-mode support. --
! ;- if the kernel is used in conjunction with GRUB or similar --
! ;- bootloaders, multiboot.s is linked rather than this file. --
;-----------------------------------------------------------------------------
[BITS 32]
[SECTION .text]
--- 1,26 ----
;-----------------------------------------------------------------------------
! ; filename: strap.asm
! ; creation date: unknown
! ; author: Charles Banas
! ; Edited by Kye Lewis (kye...@us...)
! ; version: 0.02
;-----------------------------------------------------------------------------
! ; revision history:
! ; 12/22/2002 - 1136 MST - Charles Banas
! ; prepared for CVS commit. added comments.
!
! ; 20021229 - 0738GMT - Kye Lewis (kye...@us...)
!
! ; Changed so the file links and compiles on NASM correctly
! ; Changed BITS 16 to BITS 32, and fixed 3 other lines.
!
;-----------------------------------------------------------------------------
! ; description:
! ; this file provides the ability for the kernel to boot with a
! ; minimal bootloader that does not provide A20 or p-mode support.
!
;-----------------------------------------------------------------------------
+ ;[BITS 16]
[BITS 32]
[SECTION .text]
***************
*** 23,27 ****
; the BeFS bootloader loads the kernel image at 1000h:0000h and jumps to
; 1000h:0200h. the DOS-compatible bootloader i use jumps to 1000h:0000h.
- jmp $
jmp _start
times (0x1fd) nop
--- 30,33 ----
***************
*** 47,51 ****
call _disp_str
! call _set_a20
; call _check_a20
jnc a20_good ; alternately, using the _check_a20 code, jz must be used.
--- 53,57 ----
call _disp_str
! call _set_a20
; call _check_a20
jnc a20_good ; alternately, using the _check_a20 code, jz must be used.
***************
*** 282,286 ****
; Protected-mode segment
;---------------
! [BITS 32]
do_pm:
mov ax,SYS_DATA_SEL ; now in 32-bit pmode
--- 288,292 ----
; Protected-mode segment
;---------------
!
do_pm:
mov ax,SYS_DATA_SEL ; now in 32-bit pmode
--- boot.S DELETED ---
--- io.c DELETED ---
|
|
From: <ke...@us...> - 2003-01-01 07:27:45
|
Update of /cvsroot/linksos/linksos/main/include In directory sc8-pr-cvs1:/tmp/cvs-serv18351/include Removed Files: io.h multiboot.h Log Message: Title: Backed Out Changes: Backed out changes from the most recent commit. 1- server has moved (this repository shouldn't be used), 2- a= is *always* applicable :P Effects: This code will need to be checked into the new cvs. a=kennyt,kyethespy --- io.h DELETED --- --- multiboot.h DELETED --- |
|
From: <bg...@us...> - 2003-01-01 06:49:13
|
Update of /cvsroot/linksos/linksos/main
In directory sc8-pr-cvs1:/tmp/cvs-serv13409/main
Modified Files:
Makefile kernel.ls kstdio.c main.c strap.asm
Added Files:
boot.S io.c
Log Message:
Boot using GRUB
Added boot.S to replace strap.asm & changed kprintf() to handle cursor position and newlines. Now kernel works with GRUB ok.
Use Grub as boot loader
a = n/a yet
--- NEW FILE: boot.S ---
/* boot.S - bootstrap the kernel */
/* Copyright (C) 1999, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define ASM 1
#include "include/multiboot.h"
.text
.globl start, _start
start:
_start:
jmp multiboot_entry
/* Align 32 bits boundary. */
.align 4
/* Multiboot header. */
multiboot_header:
/* magic */
.long MULTIBOOT_HEADER_MAGIC
/* flags */
.long MULTIBOOT_HEADER_FLAGS
/* checksum */
.long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
#ifndef __ELF__
/* header_addr */
.long multiboot_header
/* load_addr */
.long _start
/* load_end_addr */
.long _edata
/* bss_end_addr */
.long _end
/* entry_addr */
.long multiboot_entry
#endif /* ! __ELF__ */
multiboot_entry:
/* Initialize the stack pointer. */
movl $(stack + STACK_SIZE), %esp
/* Reset EFLAGS. */
pushl $0
popf
/* Push the pointer to the Multiboot information structure. */
pushl %ebx
/* Push the magic value. */
pushl %eax
/* Now enter the C main function... */
call EXT_C(cmain)
/* Halt. */
pushl $halt_message
call EXT_C(kprintf)
loop: hlt
jmp loop
halt_message:
.asciz "Halted."
/* Our stack area. */
.comm stack, STACK_SIZE
--- NEW FILE: io.c ---
#include "include/io.h"
inline unsigned char inportb(unsigned int port) /* Input a byte from a port */
{
unsigned char ret;
asm volatile ("inb %%dx,%%al":"=a" (ret):"d" (port));
return ret;
}
inline void outportb(unsigned int port,unsigned char value) /* Output a byte to a port */
{
asm volatile ("outb %%al,%%dx"::"d" (port), "a" (value));
}
Index: Makefile
===================================================================
RCS file: /cvsroot/linksos/linksos/main/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Makefile 28 Dec 2002 21:23:25 -0000 1.4
--- Makefile 1 Jan 2003 06:49:06 -0000 1.5
***************
*** 8,12 ****
#The assembler
! ASM = nasm
# The linker
--- 8,12 ----
#The assembler
! AS = as
# The linker
***************
*** 14,25 ****
# The kernel filename
! KERNELFN = kernel.bin
# The object files
! OBJS = kstdio.o main.o strap.o
#Compiler parameters
! CFLAGS = -I$(INCLUDE) -Wall -O -fomit-frame-pointer -c -o
! ASMFLAGS = -f elf
--- 14,24 ----
# The kernel filename
! KERNELFN = kernel.elf
# The object files
! OBJS = kstdio.o main.o boot.o io.o
#Compiler parameters
! CFLAGS = -Wall -O -fomit-frame-pointer -c -o
***************
*** 29,39 ****
$(KERNELFN): $(OBJS)
! $(LD) -Bstatic -o $(KERNELFN) $(OBJS) -Map kernel.map -T kernel.ls
.c.o:
$(CC) $(CFLAGS) $@ $<
! .asm.o:
! $(ASM) $(ASMFLAGS) $<
clean:
--- 28,38 ----
$(KERNELFN): $(OBJS)
! $(LD) -Bstatic -o $(KERNELFN) $(OBJS) -Map kernel.map -Ttext 0x100000
.c.o:
$(CC) $(CFLAGS) $@ $<
! .S.o:
! $(CC) $(CFLAGS) $@ $<
clean:
Index: kernel.ls
===================================================================
RCS file: /cvsroot/linksos/linksos/main/kernel.ls,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** kernel.ls 28 Dec 2002 16:53:16 -0000 1.2
--- kernel.ls 1 Jan 2003 06:49:07 -0000 1.3
***************
*** 1,6 ****
! OUTPUT_FORMAT("binary")
ENTRY(_start)
SECTIONS
! { .text 0x00010000 :
{ *(.text)
. = ALIGN(4096);
--- 1,6 ----
! OUTPUT_FORMAT("elf32")
ENTRY(_start)
SECTIONS
! { .text 0x000100000:
{ *(.text)
. = ALIGN(4096);
Index: kstdio.c
===================================================================
RCS file: /cvsroot/linksos/linksos/main/kstdio.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** kstdio.c 22 Dec 2002 18:42:12 -0000 1.1
--- kstdio.c 1 Jan 2003 06:49:07 -0000 1.2
***************
*** 11,14 ****
--- 11,15 ----
#include "include/kstdio.h"
+ #include "include/io.h"
typedef unsigned char u_char; /* this needs to be moved to a "types"
***************
*** 24,45 ****
{
/* write 'text' to screen. */
! static char* screen = (char*)0xB8000;
! int j;
! static int i = 0;
! static u_char prev;
! for(j=0;text[j]!=0;++i,j++) { /* don't be scared. it's kosher. :) */
! if (((text[j]==0xa) || (text[j]==0xd)) && ((prev==0xa) || (prev==0xd))) {
! continue;
! prev = text[j];
! }
! else if ((text[j]==0xa) || (text[j]==0xd)) {
! i = i + (0xa0);
! prev = text[j];
! continue;
! }
! prev = text[j];
! screen[i*2] = text[j];
! screen[i*2+1] = 7;
! }
}
--- 25,57 ----
{
/* write 'text' to screen. */
! static char* screen = (char*)0xB8000;
! static int curchar,off;
! /*First get the cursor's current position on screen*/
! outportb(0x3d4, 0x0e); /* Get cursor Y position */
! off = inportb(0x3d5);
! off <<= 8;
! outportb(0x3d4, 0x0f); /* And add cursor X position */
! off += inportb(0x3d5);
! off <<= 1;
!
! while((curchar = *text++)){ /*Process text char by char*/
! switch(curchar){
!
! case '\n': /*It is a carriage return*/
! off = 160 + (off/160)*160;
! break;
!
! default: /*Just spit character onto screen*/
! screen[off++] = curchar;
! screen[off++] = 0x07;
! }
! }
!
! /*Move cursor to new screen position*/
! off >>= 1;
! outportb(0x3d4,0x0f);
! outportb(0x3d5,off & 0x0ff);
! outportb(0x3d4,0x0e);
! outportb(0x3d5,off >> 8);
}
Index: main.c
===================================================================
RCS file: /cvsroot/linksos/linksos/main/main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** main.c 28 Dec 2002 16:53:16 -0000 1.2
--- main.c 1 Jan 2003 06:49:07 -0000 1.3
***************
*** 13,20 ****
#include "include/kstdio.h"
! void main(void)
{
! while(1);
! kprintf("LinksOS v0.0.1a kernel booted.");
}
--- 13,25 ----
#include "include/kstdio.h"
+ #include "include/multiboot.h"
! void cmain(unsigned long magic, multiboot_info_t addr)
{
! if(magic != MULTIBOOT_BOOTLOADER_MAGIC)
! {
! kprintf("Invalid bootloader magic number\n");
! return;
! }
! kprintf("LinksOS v0.0.1a kernel booted.\n");
}
Index: strap.asm
===================================================================
RCS file: /cvsroot/linksos/linksos/main/strap.asm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** strap.asm 29 Dec 2002 07:54:00 -0000 1.4
--- strap.asm 1 Jan 2003 06:49:07 -0000 1.5
***************
*** 1,26 ****
;-----------------------------------------------------------------------------
! ; filename: strap.asm
! ; creation date: unknown
! ; author: Charles Banas
! ; Edited by Kye Lewis (kye...@us...)
! ; version: 0.02
;-----------------------------------------------------------------------------
! ; revision history:
! ; 12/22/2002 - 1136 MST - Charles Banas
! ; prepared for CVS commit. added comments.
!
! ; 20021229 - 0738GMT - Kye Lewis (kye...@us...)
!
! ; Changed so the file links and compiles on NASM correctly
! ; Changed BITS 16 to BITS 32, and fixed 3 other lines.
!
;-----------------------------------------------------------------------------
! ; description:
! ; this file provides the ability for the kernel to boot with a
! ; minimal bootloader that does not provide A20 or p-mode support.
!
;-----------------------------------------------------------------------------
- ;[BITS 16]
[BITS 32]
[SECTION .text]
--- 1,19 ----
;-----------------------------------------------------------------------------
! ;- filename: strap.asm --
! ;- creation date: unknown --
! ;- author: Charles Banas --
! ;- version: 0.01 --
;-----------------------------------------------------------------------------
! ;- revision history: --
! ;- 12/22/2002 - 1136 MST - Charles Banas --
! ;- prepared for CVS commit. added comments. --
;-----------------------------------------------------------------------------
! ;- description: --
! ;- this file provides the ability for the kernel to boot with a --
! ;- minimal bootloader that does not provide A20 or p-mode support. --
! ;- if the kernel is used in conjunction with GRUB or similar --
! ;- bootloaders, multiboot.s is linked rather than this file. --
;-----------------------------------------------------------------------------
[BITS 32]
[SECTION .text]
***************
*** 30,33 ****
--- 23,27 ----
; the BeFS bootloader loads the kernel image at 1000h:0000h and jumps to
; 1000h:0200h. the DOS-compatible bootloader i use jumps to 1000h:0000h.
+ jmp $
jmp _start
times (0x1fd) nop
***************
*** 53,57 ****
call _disp_str
! call _set_a20
; call _check_a20
jnc a20_good ; alternately, using the _check_a20 code, jz must be used.
--- 47,51 ----
call _disp_str
! call _set_a20
; call _check_a20
jnc a20_good ; alternately, using the _check_a20 code, jz must be used.
***************
*** 288,292 ****
; Protected-mode segment
;---------------
!
do_pm:
mov ax,SYS_DATA_SEL ; now in 32-bit pmode
--- 282,286 ----
; Protected-mode segment
;---------------
! [BITS 32]
do_pm:
mov ax,SYS_DATA_SEL ; now in 32-bit pmode
|
|
From: <bg...@us...> - 2003-01-01 06:49:13
|
Update of /cvsroot/linksos/linksos/main/include
In directory sc8-pr-cvs1:/tmp/cvs-serv13409/main/include
Added Files:
io.h multiboot.h
Log Message:
Boot using GRUB
Added boot.S to replace strap.asm & changed kprintf() to handle cursor position and newlines. Now kernel works with GRUB ok.
Use Grub as boot loader
a = n/a yet
--- NEW FILE: io.h ---
#ifndef _IO_H
#define _IO_H
inline unsigned char inportb(unsigned int port);
inline void outportb(unsigned int port, unsigned char value);
#endif
--- NEW FILE: multiboot.h ---
/* multiboot.h - the header for Multiboot */
/* Copyright (C) 1999, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Macros. */
/* The magic number for the Multiboot header. */
#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
/* The flags for the Multiboot header. */
#ifdef __ELF__
# define MULTIBOOT_HEADER_FLAGS 0x00000003
#else
# define MULTIBOOT_HEADER_FLAGS 0x00010003
#endif
/* The magic number passed by a Multiboot-compliant boot loader. */
#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
/* The size of our stack (16KB). */
#define STACK_SIZE 0x4000
/* C symbol format. HAVE_ASM_USCORE is defined by configure. */
#ifdef HAVE_ASM_USCORE
# define EXT_C(sym) _ ## sym
#else
# define EXT_C(sym) sym
#endif
#ifndef ASM
/* Do not include here in boot.S. */
/* Types. */
/* The Multiboot header. */
typedef struct multiboot_header
{
unsigned long magic;
unsigned long flags;
unsigned long checksum;
unsigned long header_addr;
unsigned long load_addr;
unsigned long load_end_addr;
unsigned long bss_end_addr;
unsigned long entry_addr;
} multiboot_header_t;
/* The symbol table for a.out. */
typedef struct aout_symbol_table
{
unsigned long tabsize;
unsigned long strsize;
unsigned long addr;
unsigned long reserved;
} aout_symbol_table_t;
/* The section header table for ELF. */
typedef struct elf_section_header_table
{
unsigned long num;
unsigned long size;
unsigned long addr;
unsigned long shndx;
} elf_section_header_table_t;
/* The Multiboot information. */
typedef struct multiboot_info
{
unsigned long flags;
unsigned long mem_lower;
unsigned long mem_upper;
unsigned long boot_device;
unsigned long cmdline;
unsigned long mods_count;
unsigned long mods_addr;
union
{
aout_symbol_table_t aout_sym;
elf_section_header_table_t elf_sec;
} u;
unsigned long mmap_length;
unsigned long mmap_addr;
} multiboot_info_t;
/* The module structure. */
typedef struct module
{
unsigned long mod_start;
unsigned long mod_end;
unsigned long string;
unsigned long reserved;
} module_t;
/* The memory map. Be careful that the offset 0 is base_addr_low
but no size. */
typedef struct memory_map
{
unsigned long size;
unsigned long base_addr_low;
unsigned long base_addr_high;
unsigned long length_low;
unsigned long length_high;
unsigned long type;
} memory_map_t;
#endif /* ! ASM */
|
|
From: <ke...@us...> - 2002-12-30 09:18:11
|
Update of /cvsroot/linksos/website/include
In directory sc8-pr-cvs1:/tmp/cvs-serv10170/include
Modified Files:
func_general.php news.php top.php
Log Message:
Title: Site Comments
Changes: Added lots and lots of delicious comments for you!
Effects: Other website-code users can (possibly) understand what's going on in my (twisted) mind.
a=kennyt
Index: func_general.php
===================================================================
RCS file: /cvsroot/linksos/website/include/func_general.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** func_general.php 28 Dec 2002 19:52:37 -0000 1.3
--- func_general.php 30 Dec 2002 09:18:08 -0000 1.4
***************
*** 1,4 ****
--- 1,5 ----
<?
function makelink($mod, $arg, $text) {
+ /* return a link (<a> tag) to the module with arguments, as text */
return "<a href=\"$PHP_SELF?module=$mod" . ( $arg ? "&$arg" : "" ) . '">'
. $text . '</a>';
***************
*** 6,13 ****
--- 7,16 ----
function perslink($uid, $txt) {
+ /* return a link to the person summary of uid, as txt. */
return '<a href="' . $PHP_SELF . '?module=person_summary&uid=' . $uid . '">' . $txt . '</a>';
}
function doclink($docid, $txt) {
+ /* return a link to the document docid, as txt */
return '<a href="' . $PHP_SELF . '?module=doc&doc_id=' . $docid . '">' . $txt . '</a>';
}
Index: news.php
===================================================================
RCS file: /cvsroot/linksos/website/include/news.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** news.php 27 Dec 2002 21:21:19 -0000 1.2
--- news.php 30 Dec 2002 09:18:08 -0000 1.3
***************
*** 2,5 ****
--- 2,8 ----
class news {
function show($num_art) {
+ /* Show the num_art most recent articles. *
+ * If num_art is not defined, show all articles, *
+ * most recent first. Direct echo. */
$news_result = mysql_query('SELECT UNIX_TIMESTAMP(linksos_news.date),linksos_news.title,linksos_news.body,linksos_people.uid,linksos_people.fullname FROM linksos_news,linksos_people WHERE linksos_news.poster = linksos_people.uid ORDER BY linksos_news.news_id DESC');
Index: top.php
===================================================================
RCS file: /cvsroot/linksos/website/include/top.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** top.php 28 Dec 2002 03:32:47 -0000 1.11
--- top.php 30 Dec 2002 09:18:08 -0000 1.12
***************
*** 4,8 ****
<title>LinksOS</title>
<link rel="stylesheet" href="style.css" type="text/css">
! <? if ( $_REQUEST["module"] == 'logout')
echo '<meta http-equiv="refresh" content="5; URL=./?module=welcome">';
?>
--- 4,8 ----
<title>LinksOS</title>
<link rel="stylesheet" href="style.css" type="text/css">
! <? if ( $_REQUEST["module"] == 'logout') // logging out - forward to index
echo '<meta http-equiv="refresh" content="5; URL=./?module=welcome">';
?>
***************
*** 15,19 ****
</td>
<td style="text-align: center" valign="top">
! <? //echo
makelink('team_summary', 'team_id=1', '<img src="image/kernelteam.jpg" align="top">') .
makelink('team_summary', 'team_id=2', '<img src="image/webteam.jpg" align="top">') .
--- 15,19 ----
</td>
<td style="text-align: center" valign="top">
! <? //echo /* teams are replaced with user-oriented links */
makelink('team_summary', 'team_id=1', '<img src="image/kernelteam.jpg" align="top">') .
makelink('team_summary', 'team_id=2', '<img src="image/webteam.jpg" align="top">') .
***************
*** 21,29 ****
makelink('team_summary', 'team_id=4', '<img src="image/hardwareteam.jpg" align="top">') .
"";
! echo makelink('docs_index', '', '<img src="image/icons/documentation-small.png">') . ' ' .
! makelink('doc', 'doc_id=1', '<img src="image/icons/faq-small.png">') . ' ' .
! makelink('teams', '', '<img src="image/icons/teams-small.png">') .
! '<a href="http://www.linksos.org/bugzilla/"><img src="image/icons/bugtracking-small.png"></a>' .
! '<a href="http://www.linksos.org/forums/"><img src="image/icons/forums-small.png"></a>';
?>
</td>
--- 21,30 ----
makelink('team_summary', 'team_id=4', '<img src="image/hardwareteam.jpg" align="top">') .
"";
!
! echo makelink('docs_index', '', '<img src="image/icons/documentation-small.png">') . ' ' . // docs
! makelink('doc', 'doc_id=1', '<img src="image/icons/faq-small.png">') . ' ' . //faq
! makelink('teams', '', '<img src="image/icons/teams-small.png">') . // teams list
! '<a href="http://www.linksos.org/bugzilla/"><img src="image/icons/bugtracking-small.png"></a>' . // bugzilla
! '<a href="http://www.linksos.org/forums/"><img src="image/icons/forums-small.png"></a>'; // forums
?>
</td>
***************
*** 31,43 ****
<tr>
<td align="center" style="font-size: 12px; font-family: arial;" colspan="1" nowrap="nowrap">
! <? if (!$_POST["username"] && !$_SESSION["user"][0]) {
echo makelink('login', '', $lang['login_v'] ) . ' / ';
! } else {
echo makelink('logout', '', $lang['logout_v'] ) . ' / ' . makelink('person_edit', '', $lang['acct_options']) . ' / ';
}
! echo makelink('lang_switch', '', $lang['language']) . ' / ';
! ?>
! <a href="http://linksos.sourceforge.net/bugzilla/"><? echo $lang['got_bugs']; ?></a>
! <? if ($f_st) echo '</form>'; ?>
</td>
</tr>
--- 32,45 ----
<tr>
<td align="center" style="font-size: 12px; font-family: arial;" colspan="1" nowrap="nowrap">
! <?
! /* if not logging in and not logged in, print the login link. */
! if (!$_POST["username"] && !$_SESSION["user"][0]) {
echo makelink('login', '', $lang['login_v'] ) . ' / ';
! } else { /* logged in or logging in, print logout link and acct options link */
echo makelink('logout', '', $lang['logout_v'] ) . ' / ' . makelink('person_edit', '', $lang['acct_options']) . ' / ';
}
! echo makelink('lang_switch', '', $lang['language']) . ' / '; // everyone can change language
! echo '<a href="http://linksos.sourceforge.net/bugzilla/">' . $lang['got_bugs'] . '</a>';
! if ($f_st) echo '</form>'; ?>
</td>
</tr>
|