Skip to content

Instantly share code, notes, and snippets.

@dileks
dileks / lll-project (llvm-linux with clang)
Created April 18, 2011 15:23
localversion-lll + CONFIG_LOCALVERSION_AUTO=y
rom 72a672de14b87697e1e7acddbd3c34a655652eee Mon Sep 17 00:00:00 2001
From: Sedat Dilek <[email protected]>
Date: Mon, 18 Apr 2011 17:20:35 +0200
Subject: [PATCH] Add localversion-lll file and adapt EXTRAVERSION
---
Makefile | 2 +-
localversion-lll | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)
create mode 100644 localversion-lll
@dileks
dileks / lll-project (llvm-linux with clang)
Created April 18, 2011 17:31
kernel: build with i386 kernel-config (base was edwin's amd64 config)
clang -Wp,-MD,drivers/scsi/.fdomain.o.d -nostdinc -isystem /usr/lib/gcc/i486-linux-gnu/4.6.0/include -I/home/sd/src/lll-project/kernel/arch/x86/include -Iinclude -include include/generated/autoconf.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Werror-unused-arguments -Wno-missing-field-initializers -Wno-initializer-overrides -Wno-shift-overflow -Wno-unused -Wno-unused-value -Wno-unused-parameter -Wno-unused-variable -Wno-uninitialized -Wno-format -Wno-format-security -Wno-unknown-warning-option -fno-strict-aliasing -fno-common -mno-sse -Werror-implicit-function-declaration -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -Wno-strict-overflow -Os -m32 -msoft-float -mregparm=3 -march=i686 -mtune=generic -ffreestanding -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fomit-frame-pointer -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_ST
@dileks
dileks / lll-project (llvm-linux with clang)
Created April 18, 2011 18:12
edwin config: Fix for BROKEN scsi/in2000 (suggested by pipacs)
diff --git a/drivers/scsi/in2000.h b/drivers/scsi/in2000.h
index 5821e1f..4252ed1 100644
--- a/drivers/scsi/in2000.h
+++ b/drivers/scsi/in2000.h
@@ -87,7 +87,7 @@ int __dummy_1,__dummy_2; \
orl %%ecx, %%ecx \n \
jz 1f \n \
rep \n \
- outsw %%ds:(%%esi),(%%dx) \n \
+ outsw %%ds:(%%esi),%%dx \n \
@dileks
dileks / lll-project (llvm-linux with clang)
Created April 18, 2011 18:16
edwin config: Fix for BROKEN scsi/in2000 (suggested by pipacs) V2
diff --git a/drivers/scsi/in2000.h b/drivers/scsi/in2000.h
index 5821e1f..cd8d852 100644
--- a/drivers/scsi/in2000.h
+++ b/drivers/scsi/in2000.h
@@ -72,7 +72,7 @@ int __dummy_1,__dummy_2; \
orl %%ecx, %%ecx \n \
jz 1f \n \
rep \n \
- insw (%%dx),%%es:(%%edi) \n \
+ insw %%dx,%%es:(%%edi) \n \
@dileks
dileks / lll-project (llvm-linux with clang)
Created April 18, 2011 18:26
[20:05:49] <pipacs> dileks, can you do x/8i 0xc11bee47 ?
$ LANG=C gdb vmlinux
GNU gdb (GDB) 7.2-debian
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
@dileks
dileks / qemu
Created April 18, 2011 18:40
x/8i 0xc11bee47 plus x/13i memcpy
(gdb) x/8i 0xc11bee47
0xc11bee47 <memcpy+23>: rep movsl %ds:(%esi),%es:(%edi)
0xc11bee49 <memcpy+25>: mov (%esp),%ecx
0xc11bee4c <memcpy+28>: and $0x3,%ecx
0xc11bee4f <memcpy+31>: je 0xc11bee53 <memcpy+35>
0xc11bee51 <memcpy+33>: rep movsb %ds:(%esi),%es:(%edi)
0xc11bee53 <memcpy+35>: add $0x4,%esp
0xc11bee56 <memcpy+38>: pop %esi
0xc11bee57 <memcpy+39>: pop %edi
(gdb) x/13i memcpy
@dileks
dileks / qemu
Created April 18, 2011 19:10
$ qemu-system-i386 -kernel bzImage -m 128 -append "root=/dev/ram console=ttyS0 earlyprintk=ttyS0 early_ioremap_debug" -serial stdio
$ qemu-system-i386 -kernel bzImage -m 128 -append "root=/dev/ram console=ttyS0 earlyprintk=ttyS0 early_ioremap_debug" -serial stdio
Decompressing Linux... Parsing ELF... done.
Booting the kernel.
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.38.2-lll+ (sd@tbox) (clang: error: argument unused during compilation: '-g') #2 SMP Mon Apr 18 15:48:03 CEST 2011
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009f400 (usable)
[ 0.000000] BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved)
@dileks
dileks / qemu
Created April 18, 2011 19:22
$ qemu-system-i386 -kernel bzImage -m 128 -append "root=/dev/ram console=ttyS0 earlyprintk=ttyS0 early_ioremap_debug loglevel=8" -serial stdio
$ qemu-system-i386 -kernel bzImage -m 128 -append "root=/dev/ram console=ttyS0 earlyprintk=ttyS0 early_ioremap_debug loglevel=8" -serial stdio
Decompressing Linux... Parsing ELF... done.
Booting the kernel.
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.38.2-lll+ (sd@tbox) (clang: error: argument unused during compilation: '-g') #2 SMP Mon Apr 18 15:48:03 CEST 2011
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009f400 (usable)
[ 0.000000] BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved)
@dileks
dileks / kernel
Created April 18, 2011 19:27
$ LANG=C grep bm_pte -rn arch/x86/
$ LANG=C grep bm_pte -rn arch/x86/
Binary file arch/x86/built-in.o matches
Binary file arch/x86/mm/built-in.o matches
arch/x86/mm/ioremap.c:347:static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss;
arch/x86/mm/ioremap.c:362: return &bm_pte[pte_index(addr)];
arch/x86/mm/ioremap.c:367: return ptep >= &bm_pte[0] && ptep < &bm_pte[PAGE_SIZE/sizeof(pte_t)];
arch/x86/mm/ioremap.c:384: memset(bm_pte, 0, sizeof(bm_pte));
arch/x86/mm/ioremap.c:385: pmd_populate_kernel(&init_mm, pmd, bm_pte);
Binary file arch/x86/mm/ioremap.o matches
@dileks
dileks / qemu
Created April 18, 2011 19:30
(gdb) x/33i early_ioremap_init
(gdb) x/33i early_ioremap_init
0xc14b476d <early_ioremap_init>: push %ebp
0xc14b476e <early_ioremap_init+1>: mov %esp,%ebp
0xc14b4770 <early_ioremap_init+3>: push %ebx
0xc14b4771 <early_ioremap_init+4>: push %edi
0xc14b4772 <early_ioremap_init+5>: push %esi
0xc14b4773 <early_ioremap_init+6>: sub $0xc,%esp
0xc14b4776 <early_ioremap_init+9>: mov 0xc1523f28,%al
0xc14b477b <early_ioremap_init+14>: cmp $0x1,%al
0xc14b477d <early_ioremap_init+16>: jne 0xc14b478b <early_ioremap_init+30>