diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/Makefile | 13 | ||||
-rw-r--r-- | core/graphics.inc | 71 | ||||
-rw-r--r-- | core/parsecmd.inc | 4 | ||||
-rw-r--r-- | core/pxelinux.asm | 2 | ||||
-rw-r--r-- | core/symbols.S | 5 |
5 files changed, 55 insertions, 40 deletions
diff --git a/core/Makefile b/core/Makefile index 2f1418c0..7b03ef6a 100644 --- a/core/Makefile +++ b/core/Makefile @@ -41,7 +41,7 @@ BTARGET = kwdhash.gen \ NASMSRC := $(wildcard *.asm) NASMHDR := $(wildcard *.inc) CSRC := $(wildcard *.c) -SSRC := $(filter-out symbols.S,$(wildcard *.S lzo/*.S)) +SSRC := $(wildcard *.S lzo/*.S) CHDR := $(wildcard *.h) OTHERSRC := keywords ALLSRC = $(NASMSRC) $(NASMHDR) $(CSRC) $(SSRC) $(CHDR) $(OTHERSRC) @@ -86,16 +86,9 @@ kwdhash.gen: keywords genhash.pl -DHEXDATE="$(HEXDATE)" \ -l $(@:.o=.lsr) -o $@ -MP -MD .$@.d $< -%.elf: %.o $(LIBS) syslinux.ld symbols.S - $(LD) $(LDFLAGS) -T syslinux.ld -o $*.elf.tmp $< $(LIBS) - $(OBJCOPY) -x --extract-symbol $*.elf.tmp $*.sym - $(CC) $(CFLAGS) -DSYMFILE=\"$*.sym\" -c -o $*.sym.o symbols.S - $(LD) $(LDFLAGS) -T syslinux.ld -o $*.elf.tmp $< $*.sym.o $(LIBS) - $(OBJCOPY) -x --extract-symbol $*.elf.tmp $*.sym - $(CC) $(CFLAGS) -DSYMFILE=\"$*.sym\" -c -o $*.sym.o symbols.S - $(LD) $(LDFLAGS) -T syslinux.ld -M -o $@ $< $*.sym.o $(LIBS) \ +%.elf: %.o $(LIBS) syslinux.ld + $(LD) $(LDFLAGS) -T syslinux.ld -M -o $@ $< $(LIBS) \ > $(@:.elf=.map) - -rm -f $*.elf.tmp $(OBJDUMP) -h $@ > $(@:.elf=.sec) $(PERL) lstadjust.pl $(@:.elf=.lsr) $(@:.elf=.sec) $(@:.elf=.lst) diff --git a/core/graphics.inc b/core/graphics.inc index d530193f..a8d28515 100644 --- a/core/graphics.inc +++ b/core/graphics.inc @@ -75,22 +75,26 @@ vgadisplayfile: mov di,VGARowBuffer ; Pre-clear the row buffer push di + push di mov cx,640/4 xor eax,eax rep stosd pop di - push di mov cx,[GraphXSize] call rledecode ; Decode one row pop si + mov di,VGAPlaneBuffer + push di + mov bp,640 + call packedpixel2vga + pop si push es mov di,0A000h ; VGA segment mov es,di mov di,[VGAPos] - mov bp,640 - call packedpixel2vga - add word [VGAPos],80 + call outputvga pop es + add word [VGAPos],640/8 pop cx loop .drawpixelrow @@ -160,39 +164,57 @@ rledecode: ; ; DS:SI -> packed pixel string ; BP -> pixel count (multiple of 8) -; ES:DI -> output +; DS:DI -> output (four planes) ; packedpixel2vga: - mov dx,3C4h ; VGA Sequencer Register select port - mov al,2 ; Sequencer mask - out dx,al ; Select the sequencer mask - inc dx ; VGA Sequencer Register data port - mov al,1 - mov bl,al + xor cx,cx .planeloop: - pusha - out dx,al + inc cx + push si + push bp .loop1: - mov cx,8 + mov bx,8 .loop2: - xchg cx,bx lodsb shr al,cl - rcl ch,1 ; VGA is bigendian. Sigh. - xchg cx,bx - loop .loop2 - mov al,bh - stosb + rcl dl,1 ; VGA is bigendian. Sigh. + dec bx + jnz .loop2 + mov [di],dl + inc di sub bp,byte 8 ja .loop1 - popa - inc bl - shl al,1 - cmp bl,4 + pop bp + pop si + cmp cl,3 jbe .planeloop ret ; +; outputvga: +; Output four subsequent lines of VGA data +; +; DS:SI -> four planes @ 640/8=80 bytes +; ES:DI -> pointer into VGA memory +; +outputvga: + mov dx,3C4h ; VGA Sequencer Register select port + mov al,2 ; Sequencer mask + out dx,al ; Select the sequencer mask + inc dx ; VGA Sequencer Register data port + dec ax ; AL <- 1 +.loop1: + out dx,al ; Select the bit plane to write + push di + mov cx,640/32 + rep movsd + pop di + add ax,ax + cmp al,8 + jbe .loop1 + ret + +; ; vgasetmode: ; Enable VGA graphics, if possible; return ZF=1 on success ; DS must be set to the base segment; ES is set to DS. @@ -328,3 +350,4 @@ VGAFileMBuf resb FILENAME_MAX ; Mangled VGA image name alignb 4 VGARowBuffer resb 640+80 ; Decompression buffer +VGAPlaneBuffer resb (640/8)*4 ; Plane buffers diff --git a/core/parsecmd.inc b/core/parsecmd.inc index 7e0ac5c0..ab5a7df9 100644 --- a/core/parsecmd.inc +++ b/core/parsecmd.inc @@ -118,6 +118,8 @@ VKernelBuf: resb vk_size ; "Current" vkernel AppendBuf resb max_cmd_len+1 ; append= Ontimeout resb max_cmd_len+1 ; ontimeout Onerror resb max_cmd_len+1 ; onerror + ; This could be in .uibss but that makes PXELINUX overflow + section .bss16 KbdMap resb 256 ; Keyboard map FKeyName resb MAX_FKEYS*FILENAME_MAX ; File names for F-key help KernelCNameLen resw 1 ; Length of unmangled kernel name @@ -133,3 +135,5 @@ InitRDCName resb FILENAME_MAX ; Unmangled initrd name %endif MNameBuf resb FILENAME_MAX InitRD resb FILENAME_MAX + + section .text16 diff --git a/core/pxelinux.asm b/core/pxelinux.asm index 34121e59..1da65be5 100644 --- a/core/pxelinux.asm +++ b/core/pxelinux.asm @@ -29,7 +29,7 @@ ; Some semi-configurable constants... change on your own risk. ; my_id equ pxelinux_id -FILENAME_MAX_LG2 equ 7 ; log2(Max filename size Including final null) +FILENAME_MAX_LG2 equ 8 ; log2(Max filename size Including final null) FILENAME_MAX equ (1 << FILENAME_MAX_LG2) NULLFILE equ 0 ; Zero byte == null file name NULLOFFSET equ 4 ; Position in which to look diff --git a/core/symbols.S b/core/symbols.S deleted file mode 100644 index 00cd3e80..00000000 --- a/core/symbols.S +++ /dev/null @@ -1,5 +0,0 @@ - .section ".dynlink","a" -_dynamic_symbols: - .globl _dynamic_symbols - .incbin SYMFILE - .size _dynamic_symbols, .-_dynamic_symbols |