diff -NEBwr linux/boot/head.s linux.last/boot/head.s
9,10c9,10
< .globl idt,gdt,pg_dir
< pg_dir:
---
> .globl _idt,_gdt,_pg_dir
> _pg_dir:
17c17
< 	lss stack_start,%esp
---
> 	lss _stack_start,%esp
25c25
< 	lss stack_start,%esp
---
> 	lss _stack_start,%esp
56c56
< 	lea idt,%edi
---
> 	lea _idt,%edi
98c98
< 	pushl $main
---
> 	pushl $_main
142,143c142,143
< 	movl $pg0+7,pg_dir		/* set present bit/user r/w */
< 	movl $pg1+7,pg_dir+4		/*  --------- " " --------- */
---
> 	movl $pg0+7,_pg_dir		/* set present bit/user r/w */
> 	movl $pg1+7,_pg_dir+4		/*  --------- " " --------- */
161c161
< 	.long idt
---
> 	.long _idt
166c166
< 	.long gdt		# magic number, but it works for me :^)
---
> 	.long _gdt		# magic number, but it works for me :^)
168,169c168,169
< 	.align 8
< idt:	.fill 256,8,0		# idt is uninitialized
---
> 	.align 3
> _idt:	.fill 256,8,0		# idt is uninitialized
171c171
< gdt:	.quad 0x0000000000000000	/* NULL descriptor */
---
> _gdt:	.quad 0x0000000000000000	/* NULL descriptor */
diff -NEBwr linux/fs/bitmap.c linux.last/fs/bitmap.c
11c11
< 	::"a" (0),"c" (BLOCK_SIZE/4),"D" ((long) (addr)))
---
> 	::"a" (0),"c" (BLOCK_SIZE/4),"D" ((long) (addr)):"cx","di")
36c36
< 	:"=c" (__res):"c" (0),"S" (addr)); \
---
> 	:"=c" (__res):"c" (0),"S" (addr):"ax","dx","si"); \
diff -NEBwr linux/fs/exec.c linux.last/fs/exec.c
30c30
< 	)
---
> 	:"cx","di","si")
diff -NEBwr linux/fs/Makefile linux.last/fs/Makefile
2c2
< AS	=gcc
---
> AS	=gas
4,6c4,6
< LD	=ld
< CFLAGS	=-Wall -O -fstrength-reduce -fomit-frame-pointer \
< 	-nostdinc -I../include
---
> LD	=gld
> CFLAGS	=-Wall -O -fstrength-reduce -fcombine-regs -fomit-frame-pointer \
> 	-mstring-insns -nostdinc -I../include
diff -NEBwr linux/fs/namei.c linux.last/fs/namei.c
66c66
< 		);
---
> 		:"cx","di","si");
diff -NEBwr linux/fs/super.c linux.last/fs/super.c
10c10
< int __res __asm__("eax"); \
---
> register int __res __asm__("ax"); \
diff -NEBwr linux/include/linux/sched.h linux.last/include/linux/sched.h
170c170
< __asm__("cmpl %%ecx,current\n\t" \
---
> __asm__("cmpl %%ecx,_current\n\t" \
172c172
< 	"xchgl %%ecx,current\n\t" \
---
> 	"xchgl %%ecx,_current\n\t" \
194c194
< 	)
---
> 	:"dx")
206c206
< 	)
---
> 	:"dx")
diff -NEBwr linux/include/string.h linux.last/include/string.h
34c34
< 	::"S" (src),"D" (dest));
---
> 	::"S" (src),"D" (dest):"si","di","ax");
50c50
< 	::"S" (src),"D" (dest),"c" (count));
---
> 	::"S" (src),"D" (dest),"c" (count):"si","di","ax","cx");
64c64
< 	::"S" (src),"D" (dest),"a" (0),"c" (0xffffffff));
---
> 	::"S" (src),"D" (dest),"a" (0),"c" (0xffffffff):"si","di","ax","cx");
84c84
< 	);
---
> 	:"si","di","ax","cx");
103c103
< 	:"=a" (__res):"D" (cs),"S" (ct));
---
> 	:"=a" (__res):"D" (cs),"S" (ct):"si","di");
124c124
< 	:"=a" (__res):"D" (cs),"S" (ct),"c" (count));
---
> 	:"=a" (__res):"D" (cs),"S" (ct),"c" (count):"si","di","cx");
141c141
< 	:"=a" (__res):"S" (s),"0" (c));
---
> 	:"=a" (__res):"S" (s),"0" (c):"si");
157c157
< 	:"=d" (__res):"0" (0),"S" (s),"a" (c));
---
> 	:"=d" (__res):"0" (0),"S" (s),"a" (c):"ax","si");
181c181
< 	);
---
> 	:"ax","cx","dx","di");
205c205
< 	);
---
> 	:"ax","cx","dx","di");
232c232
< 	);
---
> 	:"ax","cx","dx","di");
238c238
< char * __res __asm__("ax");
---
> register char * __res __asm__("ax");
259c259
< 	);
---
> 	:"cx","dx","di","si");
271c271
< 	:"=c" (__res):"D" (s),"a" (0),"0" (0xffffffff));
---
> 	:"=c" (__res):"D" (s),"a" (0),"0" (0xffffffff):"di");
279c279
< char * __res __asm__("si");
---
> register char * __res __asm__("si");
332c332
< 	);
---
> 	:"ax","cx","dx","di");
342c342
< 	);
---
> 	:"cx","si","di");
353c353
< 	);
---
> 	:"cx","si","di");
359c359
< 	);
---
> 	:"cx","si","di");
375c375
< 	);
---
> 	:"si","di","cx");
391c391
< 	);
---
> 	:"cx");
401c401
< 	);
---
> 	:"cx","di");
diff -NEBwr linux/init/main.c linux.last/init/main.c
17,20c17,20
< inline _syscall0(int,fork)
< inline _syscall0(int,pause)
< inline _syscall0(int,setup)
< inline _syscall0(int,sync)
---
> static inline _syscall0(int,fork)
> static inline _syscall0(int,pause)
> static inline _syscall0(int,setup)
> static inline _syscall0(int,sync)
diff -NEBwr linux/kernel/asm.s linux.last/kernel/asm.s
8,11c8,11
< .globl divide_error,debug,nmi,int3,overflow,bounds,invalid_op
< .globl device_not_available,double_fault,coprocessor_segment_overrun
< .globl invalid_TSS,segment_not_present,stack_segment
< .globl general_protection,coprocessor_error,reserved
---
> .globl _divide_error,_debug,_nmi,_int3,_overflow,_bounds,_invalid_op
> .globl _device_not_available,_double_fault,_coprocessor_segment_overrun
> .globl _invalid_TSS,_segment_not_present,_stack_segment
> .globl _general_protection,_coprocessor_error,_reserved
13,14c13,14
< divide_error:
< 	pushl $do_divide_error
---
> _divide_error:
> 	pushl $_do_divide_error
47,48c47,48
< debug:
< 	pushl $do_int3		# do_debug
---
> _debug:
> 	pushl $_do_int3		# _do_debug
51,52c51,52
< nmi:
< 	pushl $do_nmi
---
> _nmi:
> 	pushl $_do_nmi
55,56c55,56
< int3:
< 	pushl $do_int3
---
> _int3:
> 	pushl $_do_int3
59,60c59,60
< overflow:
< 	pushl $do_overflow
---
> _overflow:
> 	pushl $_do_overflow
63,64c63,64
< bounds:
< 	pushl $do_bounds
---
> _bounds:
> 	pushl $_do_bounds
67,68c67,68
< invalid_op:
< 	pushl $do_invalid_op
---
> _invalid_op:
> 	pushl $_do_invalid_op
73c73
< 	pushl $do_device_not_available
---
> 	pushl $_do_device_not_available
75c75
< device_not_available:
---
> _device_not_available:
81,82c81,82
< 	movl current,%eax
< 	cmpl last_task_used_math,%eax
---
> 	movl _current,%eax
> 	cmpl _last_task_used_math,%eax
89c89
< 	call math_state_restore
---
> 	call _math_state_restore
96,97c96,97
< coprocessor_segment_overrun:
< 	pushl $do_coprocessor_segment_overrun
---
> _coprocessor_segment_overrun:
> 	pushl $_do_coprocessor_segment_overrun
100,101c100,101
< reserved:
< 	pushl $do_reserved
---
> _reserved:
> 	pushl $_do_reserved
104,105c104,105
< coprocessor_error:
< 	pushl $do_coprocessor_error
---
> _coprocessor_error:
> 	pushl $_do_coprocessor_error
108,109c108,109
< double_fault:
< 	pushl $do_double_fault
---
> _double_fault:
> 	pushl $_do_double_fault
142,143c142,143
< invalid_TSS:
< 	pushl $do_invalid_TSS
---
> _invalid_TSS:
> 	pushl $_do_invalid_TSS
146,147c146,147
< segment_not_present:
< 	pushl $do_segment_not_present
---
> _segment_not_present:
> 	pushl $_do_segment_not_present
150,151c150,151
< stack_segment:
< 	pushl $do_stack_segment
---
> _stack_segment:
> 	pushl $_do_stack_segment
154,155c154,155
< general_protection:
< 	pushl $do_general_protection
---
> _general_protection:
> 	pushl $_do_general_protection
diff -NEBwr linux/kernel/console.c linux.last/kernel/console.c
26c26
< #define __columns 80
---
> #define COLUMNS 80
32c32
< static unsigned long scr_end=SCREEN_START+LINES*__columns*2;
---
> static unsigned long scr_end=SCREEN_START+LINES*COLUMNS*2;
36c36
< static unsigned long lines=LINES,_columns=__columns;
---
> static unsigned long lines=LINES,columns=COLUMNS;
50c50
< 	if (new_x>=_columns || new_y>=lines)
---
> 	if (new_x>=columns || new_y>=lines)
54c54
< 	pos=origin+((y*_columns+x)<<1);
---
> 	pos=origin+((y*columns+x)<<1);
70,72c70,72
< 		origin += _columns<<1;
< 		pos += _columns<<1;
< 		scr_end += _columns<<1;
---
> 		origin += columns<<1;
> 		pos += columns<<1;
> 		scr_end += columns<<1;
81c81
< 				"c" ((lines-1)*_columns>>1),
---
> 				"c" ((lines-1)*columns>>1),
84c84
< 				);
---
> 				:"cx","di","si");
93,95c93,95
< 				"c" (_columns>>1),
< 				"D" (scr_end-(_columns<<1))
< 				);
---
> 				"c" (columns>>1),
> 				"D" (scr_end-(columns<<1))
> 				:"cx","di");
106,109c106,109
< 			"c" ((bottom-top-1)*_columns>>1),
< 			"D" (origin+(_columns<<1)*top),
< 			"S" (origin+(_columns<<1)*(top+1))
< 			);
---
> 			"c" ((bottom-top-1)*columns>>1),
> 			"D" (origin+(columns<<1)*top),
> 			"S" (origin+(columns<<1)*(top+1))
> 			:"cx","di","si");
123,126c123,126
< 		"c" ((bottom-top-1)*_columns>>1),
< 		"D" (origin+(_columns<<1)*bottom-4),
< 		"S" (origin+(_columns<<1)*(bottom-1)-4)
< 		);
---
> 		"c" ((bottom-top-1)*columns>>1),
> 		"D" (origin+(columns<<1)*bottom-4),
> 		"S" (origin+(columns<<1)*(bottom-1)-4)
> 		:"ax","cx","di","si");
133c133
< 		pos += _columns<<1;
---
> 		pos += columns<<1;
143c143
< 		pos -= _columns<<1;
---
> 		pos -= columns<<1;
166c166
< 	long count __asm__("ecx");
---
> 	long count __asm__("cx");
179c179
< 			count = _columns*lines;
---
> 			count = columns*lines;
190c190
< 		);
---
> 		:"cx","di");
195c195
< 	long count __asm__("ecx");
---
> 	long count __asm__("cx");
200c200
< 			if (x>=_columns)
---
> 			if (x>=columns)
202c202
< 			count = _columns-x;
---
> 			count = columns-x;
207c207
< 			count = (x<_columns)?x:_columns;
---
> 			count = (x<columns)?x:columns;
211c211
< 			count = _columns;
---
> 			count = columns;
221c221
< 		);
---
> 		:"cx","di");
267c267
< 	while (i++<_columns) {
---
> 	while (i++<columns) {
293c293
< 	if (x>=_columns)
---
> 	if (x>=columns)
296c296
< 	while (++i < _columns) {
---
> 	while (++i < columns) {
318,319c318,319
< 	if (nr>_columns)
< 		nr=_columns;
---
> 	if (nr>columns)
> 		nr=columns;
338,339c338,339
< 	if (nr>_columns)
< 		nr=_columns;
---
> 	if (nr>columns)
> 		nr=columns;
369c369
< 	pos=origin+((y*_columns+x)<<1);
---
> 	pos=origin+((y*columns+x)<<1);
383,385c383,385
< 					if (x>=_columns) {
< 						x -= _columns;
< 						pos -= _columns<<1;
---
> 					if (x>=columns) {
> 						x -= columns;
> 						pos -= columns<<1;
388c388
< 					__asm__("movb attr,%%ah\n\t"
---
> 					__asm__("movb _attr,%%ah\n\t"
391c391
< 						);
---
> 						:"ax");
411,413c411,413
< 					if (x>_columns) {
< 						x -= _columns;
< 						pos -= _columns<<1;
---
> 					if (x>columns) {
> 						x -= columns;
> 						pos -= columns<<1;
diff -NEBwr linux/kernel/hd.c linux.last/kernel/hd.c
69c69
< __asm__("cld;rep;insw"::"d" (port),"D" (buf),"c" (nr))
---
> __asm__("cld;rep;insw"::"d" (port),"D" (buf),"c" (nr):"cx","di")
72c72
< __asm__("cld;rep;outsw"::"d" (port),"S" (buf),"c" (nr))
---
> __asm__("cld;rep;outsw"::"d" (port),"S" (buf),"c" (nr):"cx","si")
diff -NEBwr linux/kernel/keyboard.s linux.last/kernel/keyboard.s
6c6
< .globl keyboard_interrupt
---
> .globl _keyboard_interrupt
27c27
< keyboard_interrupt:
---
> _keyboard_interrupt:
37c37
< 	xorb %al,%al		/* %eax is scan code */
---
> 	xorl %al,%al		/* %eax is scan code */
59c59
< 	call do_tty_interrupt
---
> 	call _do_tty_interrupt
81c81
< 	movl table_list,%edx		# read-queue for console
---
> 	movl _table_list,%edx		# read-queue for console
diff -NEBwr linux/kernel/Makefile linux.last/kernel/Makefile
10,11c10,11
< AS	=gcc
< LD	=ld
---
> AS	=gas
> LD	=gld
14,15c14,15
< CFLAGS	=-Wall -O -fstrength-reduce -fomit-frame-pointer \
< 	-finline-functions -nostdinc -I../include
---
> CFLAGS	=-Wall -O -fstrength-reduce -fomit-frame-pointer -fcombine-regs \
> 	-finline-functions -mstring-insns -nostdinc -I../include
27c27
< OBJS  = sched.o system_call.o traps.o asm.o \
---
> OBJS  = sched.o system_call.o traps.o asm.o fork.o \
30c30
< 	mktime.o fork.o
---
> 	mktime.o
diff -NEBwr linux/kernel/printk.c linux.last/kernel/printk.c
25c25
< 		"pushl $buf\n\t"
---
> 		"pushl $_buf\n\t"
27c27
< 		"call tty_write\n\t"
---
> 		"call _tty_write\n\t"
diff -NEBwr linux/kernel/rs_io.s linux.last/kernel/rs_io.s
8c8
< .globl rs1_interrupt,rs2_interrupt
---
> .globl _rs1_interrupt,_rs2_interrupt
28,29c28,29
< rs1_interrupt:
< 	pushl $table_list+8
---
> _rs1_interrupt:
> 	pushl $_table_list+8
32,33c32,33
< rs2_interrupt:
< 	pushl $table_list+16
---
> _rs2_interrupt:
> 	pushl $_table_list+16
70c70
< 	addl $4,%esp		# jump over table_list entry
---
> 	addl $4,%esp		# jump over _table_list entry
92c92
< 	subl $table_list,%edx
---
> 	subl $_table_list,%edx
103c103
< 	call do_tty_interrupt
---
> 	call _do_tty_interrupt
diff -NEBwr linux/kernel/system_call.s linux.last/kernel/system_call.s
50c50
< .globl system_call,sys_fork,timer_interrupt,hd_interrupt,sys_execve
---
> .globl _system_call,_sys_fork,_timer_interrupt,_hd_interrupt,_sys_execve
59c59
< 	jmp schedule
---
> 	jmp _schedule
61c61
< system_call:
---
> _system_call:
75c75
< 	call sys_call_table(,%eax,4)
---
> 	call _sys_call_table(,%eax,4)
77c77
< 	movl current,%eax
---
> 	movl _current,%eax
83,84c83,84
< 	movl current,%eax		# task[0] cannot have signals
< 	cmpl task,%eax
---
> 	movl _current,%eax		# task[0] cannot have signals
> 	cmpl _task,%eax
109c109
< 	call verify_area
---
> 	call _verify_area
140c140
< 	call do_exit		# remember to set bit 7 when dumping core
---
> 	call _do_exit		# remember to set bit 7 when dumping core
145c145
< timer_interrupt:
---
> _timer_interrupt:
158c158
< 	incl jiffies
---
> 	incl _jiffies
164c164
< 	call do_timer		# 'do_timer(long CPL)' does everything from
---
> 	call _do_timer		# 'do_timer(long CPL)' does everything from
169c169
< sys_execve:
---
> _sys_execve:
172c172
< 	call do_execve
---
> 	call _do_execve
177,178c177,178
< sys_fork:
< 	call find_empty_process
---
> _sys_fork:
> 	call _find_empty_process
186c186
< 	call copy_process
---
> 	call _copy_process
190c190
< hd_interrupt:
---
> _hd_interrupt:
207c207
< 	movl do_hd,%eax
---
> 	movl _do_hd,%eax
210c210
< 	movl $unexpected_hd_interrupt,%eax
---
> 	movl $_unexpected_hd_interrupt,%eax
diff -NEBwr linux/lib/Makefile linux.last/lib/Makefile
9,11c9,11
< AR	=ar
< AS	=gcc
< LD	=ld
---
> AR	=gar
> AS	=gas
> LD	=gld
14,15c14,15
< CFLAGS	=-Wall -O -fstrength-reduce -fomit-frame-pointer \
< 	-finline-functions -nostdinc -I../include
---
> CFLAGS	=-Wall -O -fstrength-reduce -fomit-frame-pointer -fcombine-regs \
> 	-finline-functions -mstring-insns -nostdinc -I../include
diff -NEBwr linux/Makefile linux.last/Makefile
7,9c7,9
< AS86	=gcc
< CC86	=cc
< LD86	=ld
---
> AS86	=as -0 -a
> CC86	=cc -0
> LD86	=ld -0
11,12c11,12
< AS	=gcc
< LD	=ld
---
> AS	=gas
> LD	=gld
15c15
< CFLAGS	=-Wall -O -fstrength-reduce -fomit-frame-pointer
---
> CFLAGS	=-Wall -O -fstrength-reduce -fomit-frame-pointer -fcombine-regs
diff -NEBwr linux/mm/Makefile linux.last/mm/Makefile
2c2
< CFLAGS	=-O -Wall -fstrength-reduce -fomit-frame-pointer \
---
> CFLAGS	=-O -Wall -fstrength-reduce -fcombine-regs -fomit-frame-pointer \
4c4
< AS	=gcc
---
> AS	=gas
6c6
< LD	=ld
---
> LD	=gld
13c13
< 	$(AS) -o $*.o -c $<
---
> 	$(AS) -o $*.o $<
diff -NEBwr linux/mm/memory.c linux.last/mm/memory.c
29c29
< __asm__("cld ; rep ; movsl"::"S" (from),"D" (to),"c" (1024))
---
> __asm__("cld ; rep ; movsl"::"S" (from),"D" (to),"c" (1024):"cx","di","si")
55c55
< 	);
---
> 	:"di","cx","dx");
diff -NEBwr linux/mm/page.s linux.last/mm/page.s
6c6
< .globl page_fault
---
> .globl _page_fault
8c8
< page_fault:
---
> _page_fault:
24c24
< 	call do_no_page
---
> 	call _do_no_page
26c26
< 1:	call do_wp_page
---
> 1:	call _do_wp_page
diff -NEBwr linux/README linux.last/README
1,76d0
< 
< 
< 		Linux 0.01 New Generation
< 
< I. Introduction
< ===============
< 
< We are trying to compile and run Linux 0.01, the first release
< of the Linux Kernel.
< 
< II. Compile errors
< ==================
< 
< 1. gas?
< -------
< 
< 	Remplace gas to gcc in Makefile.
< 
< 	Do not forgot to add -c on line to not link.
< 
< 2. Problem with flags
< ---------------------
< 
< 	Just remove the flags that gcc doesn't recognize.
< 
< 3. Static on inline functions
< -----------------------------
< 
< 	Here you have this lines:
< 
< 		static inline _syscall0(int,fork)
< 		static inline _syscall0(int,pause)
< 		static inline _syscall0(int,setup)
< 		static inline _syscall0(int,sync)
< 
< 	First, read the definition of èsyscall* macros,
< 	then remove the 'static' before.
< 
< 4. error: can't find a register in class ‘DIREG’ while reloading ‘asm’
< ----------------------------------------------------------------------
< 
< 	For each message, remove in the asm code all reference to ax,
< 	cx, dx and sx.
< 
< 	Read http://my.execpc.com/~geezer/osd/gotchas/index.htm for
< 	more informations.
< 
< 5. keyboard.s:37: Error: `%al' not allowed with `xorl'
< ------------------------------------------------------
< 
< 	Change this line to:
< 		xorb %al,%al
< 
< 	Because %al is a byte.
< 
< 6. Linking errors
< -----------------
< 
< 	A big problem with compilers, is with the asm code generated.
< 
< 	The compiler used by Linus Torvalds added a '_' as prefix
< 	on each symbols.
< 
< 	Our last favorite gcc compilator doesn't add it...
< 
< 	So we must remove all '_' on begin of functions in
< 	asm code.
< 
< 	Good luck:)
< 
< 7. A lot of errors when trying to create the boot image
< -------------------------------------------------------
< 
< 	GCC apparently doesn't like boot/boot.s file...
< 
< 	I don't know anymore how to resolv this.

