[LinksOS CVS Commit]linksos/main Makefile,1.5,1.6 kernel.ls,1.3,1.4 kstdio.c,1.2,1.3 main.c,1.3,1.4
Status: Inactive
Brought to you by:
terencevs
|
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 ---
|