Skip to content

Commit

Permalink
Nuke data.S, since we do have a custom linker script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin Clements committed Sep 2, 2011
1 parent ce6dd9d commit dd4438b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 31 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ initcode: initcode.S
$(OBJCOPY) -S -O binary initcode.out initcode
$(OBJDUMP) -S initcode.o > initcode.asm

kernel: $(OBJS) entry.o data.o entryother initcode
$(LD) $(LDFLAGS) -T kernel.ld -e entry -o kernel entry.o data.o $(OBJS) -b binary initcode entryother
kernel: $(OBJS) entry.o entryother initcode
$(LD) $(LDFLAGS) -T kernel.ld -e entry -o kernel entry.o $(OBJS) -b binary initcode entryother
$(OBJDUMP) -S kernel > kernel.asm
$(OBJDUMP) -t kernel | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > kernel.sym

Expand All @@ -121,8 +121,8 @@ kernel: $(OBJS) entry.o data.o entryother initcode
# great for testing the kernel on real hardware without
# needing a scratch disk.
MEMFSOBJS = $(filter-out ide.o,$(OBJS)) memide.o
kernelmemfs: $(MEMFSOBJS) entry.o data.o entryother initcode fs.img
$(LD) $(LDFLAGS) -Ttext 0x100000 -e main -o kernelmemfs entry.o data.o $(MEMFSOBJS) -b binary initcode entryother fs.img
kernelmemfs: $(MEMFSOBJS) entry.o entryother initcode fs.img
$(LD) $(LDFLAGS) -Ttext 0x100000 -e main -o kernelmemfs entry.o $(MEMFSOBJS) -b binary initcode entryother fs.img
$(OBJDUMP) -S kernelmemfs > kernelmemfs.asm
$(OBJDUMP) -t kernelmemfs | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > kernelmemfs.sym

Expand Down
26 changes: 0 additions & 26 deletions data.S

This file was deleted.

8 changes: 8 additions & 0 deletions kernel.ld
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ SECTIONS
/* Adjust the address for the data segment to the next page */
. = ALIGN(0x1000);

/* Conventionally, Unix linkers provide pseudo-symbols
* etext, edata, and end, at the end of the text, data, and bss.
* For the kernel mapping, we need the address at the beginning
* of the data section, but that's not one of the conventional
* symbols, because the convention started before there was a
* read-only rodata section between text and data. */
PROVIDE(data = .);

/* The data segment */
.data : {
*(.data)
Expand Down
2 changes: 1 addition & 1 deletion vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "proc.h"
#include "elf.h"

extern char data[]; // defined in data.S
extern char data[]; // defined by kernel.ld
pde_t *kpgdir; // for use in scheduler()
struct segdesc gdt[NSEGS];

Expand Down

0 comments on commit dd4438b

Please sign in to comment.