chore: disable pic

This commit is contained in:
d0p1 🏳️‍⚧️ 2024-07-13 10:17:36 +02:00
parent 90e1d2818d
commit 649b68ee39
6 changed files with 39 additions and 26 deletions

View file

@ -11,7 +11,8 @@ SRCS = kernel.asm \
mm/pmm.inc \ mm/pmm.inc \
lock.inc \ lock.inc \
gdt.inc \ gdt.inc \
isr.inc isr.inc \
pic.inc
.PHONY: all .PHONY: all
all: $(KERNEL) all: $(KERNEL)

View file

@ -56,6 +56,9 @@ kmain:
lgdt [pGDT] lgdt [pGDT]
; I don't think i need to reload segment cuz their value are already correct ; I don't think i need to reload segment cuz their value are already correct
xchg bx, bx
call pic_disable
call idt_setup call idt_setup
@ -75,6 +78,7 @@ kmain:
include 'lock.inc' include 'lock.inc'
include 'gdt.inc' include 'gdt.inc'
include 'isr.inc' include 'isr.inc'
include 'pic.inc'
szMsgKernelAlive db "Kernel is alive", 0 szMsgKernelAlive db "Kernel is alive", 0
szErrorBootProtocol db "Error: wrong magic number", 0 szErrorBootProtocol db "Error: wrong magic number", 0

View file

@ -10,17 +10,18 @@ CMOS_REG_HOUR = 0x04
COM1 = 0x3F8 COM1 = 0x3F8
;klog_kputc: klog_kputc:
; mov dx, COM1 + 5 mov dx, COM1 + 5
; push eax push eax
;@@: @@:
; in al, dx in al, dx
; and al, 0x20 and al, 0x20
; jnz @b jnz @b
; pop eax pop eax
; mov dx, COM1 mov dx, COM1
; out dx, al out dx, al
; ret ret
;; Function: klog_print ;; Function: klog_print
;; ;;
@ -33,6 +34,7 @@ klog_print:
or al, al or al, al
jz @f jz @f
out dx, al out dx, al
;call klog_kputc
jmp @b jmp @b
@@: @@:
ret ret

View file

@ -31,7 +31,6 @@ pmm_init:
;; Out: ;; Out:
;; EAX - page address (return zero on error) ;; EAX - page address (return zero on error)
pmm_alloc_page: pmm_alloc_page:
xchg bx, bx
mov eax, uPmmLock mov eax, uPmmLock
call lock_acquire call lock_acquire

View file

@ -8,6 +8,13 @@ PIC2_DATA = 0xA1
PIC_EOI = 0x20 PIC_EOI = 0x20
pic_init: pic_init:
ret ret
pic_disable:
mov al, 0xFF
out PIC1_DATA, al
out PIC2_DATA, al
ret

View file

@ -142,7 +142,7 @@ reduced the family relation to a mere money relation.
The bourgeoisie has disclosed how it came to pass that the brutal display of The bourgeoisie has disclosed how it came to pass that the brutal display of
vigour in the Middle Ages, which reactionaries so much admire, found its vigour in the Middle Ages, which reactionaries so much admire, found its
fitting complement in the most slothful indolence. It has been the first to fitting complement in the most slothful indolence. It has been the first to
show what mans activity can bring about. It has accomplished wonders far show what man's activity can bring about. It has accomplished wonders far
surpassing Egyptian pyramids, Roman aqueducts, and Gothic cathedrals; it has surpassing Egyptian pyramids, Roman aqueducts, and Gothic cathedrals; it has
conducted expeditions that put in the shade all former Exoduses of nations and conducted expeditions that put in the shade all former Exoduses of nations and
crusades. crusades.
@ -186,7 +186,7 @@ The bourgeoisie, by the rapid improvement of all instruments of production, by
the immensely facilitated means of communication, draws all, even the most the immensely facilitated means of communication, draws all, even the most
barbarian, nations into civilisation. The cheap prices of commodities are the barbarian, nations into civilisation. The cheap prices of commodities are the
heavy artillery with which it batters down all Chinese walls, with which it heavy artillery with which it batters down all Chinese walls, with which it
forces the barbarians intensely obstinate hatred of foreigners to capitulate. forces the barbarians' intensely obstinate hatred of foreigners to capitulate.
It compels all nations, on pain of extinction, to adopt the bourgeois mode of It compels all nations, on pain of extinction, to adopt the bourgeois mode of
production; it compels them to introduce what it calls civilisation into their production; it compels them to introduce what it calls civilisation into their
midst, i.e., to become bourgeois themselves. In one word, it creates a world midst, i.e., to become bourgeois themselves. In one word, it creates a world
@ -211,7 +211,7 @@ one frontier, and one customs-tariff.
The bourgeoisie, during its rule of scarce one hundred years, has created more The bourgeoisie, during its rule of scarce one hundred years, has created more
massive and more colossal productive forces than have all preceding massive and more colossal productive forces than have all preceding
generations together. Subjection of Natures forces to man, machinery, generations together. Subjection of Nature's forces to man, machinery,
application of chemistry to industry and agriculture, steam-navigation, application of chemistry to industry and agriculture, steam-navigation,
railways, electric telegraphs, clearing of whole continents for cultivation, railways, electric telegraphs, clearing of whole continents for cultivation,
canalisation of rivers, whole populations conjured out of the ground — what canalisation of rivers, whole populations conjured out of the ground — what
@ -352,7 +352,7 @@ ever more fluctuating. The increasing improvement of machinery, ever more
rapidly developing, makes their livelihood more and more precarious; the rapidly developing, makes their livelihood more and more precarious; the
collisions between individual workmen and individual bourgeois take more and collisions between individual workmen and individual bourgeois take more and
more the character of collisions between two classes. Thereupon, the workers more the character of collisions between two classes. Thereupon, the workers
begin to form combinations (Trades Unions) against the bourgeois; they club begin to form combinations (Trades' Unions) against the bourgeois; they club
together in order to keep up the rate of wages; they found permanent together in order to keep up the rate of wages; they found permanent
associations in order to make provision beforehand for these occasional associations in order to make provision beforehand for these occasional
revolts. Here and there, the contest breaks out into riots. revolts. Here and there, the contest breaks out into riots.
@ -373,7 +373,7 @@ political party, is continually being upset again by the competition between
the workers themselves. But it ever rises up again, stronger, firmer, the workers themselves. But it ever rises up again, stronger, firmer,
mightier. It compels legislative recognition of particular interests of the mightier. It compels legislative recognition of particular interests of the
workers, by taking advantage of the divisions among the bourgeoisie itself. workers, by taking advantage of the divisions among the bourgeoisie itself.
Thus, the ten-hours bill in England was carried. Thus, the ten-hours' bill in England was carried.
Altogether collisions between the classes of the old society further, in many Altogether collisions between the classes of the old society further, in many
ways, the course of development of the proletariat. The bourgeoisie finds ways, the course of development of the proletariat. The bourgeoisie finds
@ -543,7 +543,7 @@ In this sense, the theory of the Communists may be summed up in the single
sentence: Abolition of private property. sentence: Abolition of private property.
We Communists have been reproached with the desire of abolishing the right of We Communists have been reproached with the desire of abolishing the right of
personally acquiring property as the fruit of a mans own labour, which personally acquiring property as the fruit of a man's own labour, which
property is alleged to be the groundwork of all personal freedom, activity and property is alleged to be the groundwork of all personal freedom, activity and
independence. independence.
@ -655,7 +655,7 @@ identical with the disappearance of all culture.
That culture, the loss of which he laments, is, for the enormous majority, a That culture, the loss of which he laments, is, for the enormous majority, a
mere training to act as a machine. mere training to act as a machine.
But dont wrangle with us so long as you apply, to our intended abolition of But don't wrangle with us so long as you apply, to our intended abolition of
bourgeois property, the standard of your bourgeois notions of freedom, bourgeois property, the standard of your bourgeois notions of freedom,
culture, law, &c. Your very ideas are but the outgrowth of the conditions of culture, law, &c. Your very ideas are but the outgrowth of the conditions of
your bourgeois production and bourgeois property, just as your jurisprudence your bourgeois production and bourgeois property, just as your jurisprudence
@ -720,7 +720,7 @@ introduce community of women; it has existed almost from time immemorial.
Our bourgeois, not content with having wives and daughters of their Our bourgeois, not content with having wives and daughters of their
proletarians at their disposal, not to speak of common prostitutes, take the proletarians at their disposal, not to speak of common prostitutes, take the
greatest pleasure in seducing each others wives. greatest pleasure in seducing each other's wives.
Bourgeois marriage is, in reality, a system of wives in common and thus, at Bourgeois marriage is, in reality, a system of wives in common and thus, at
the most, what the Communists might possibly be reproached with is that they the most, what the Communists might possibly be reproached with is that they
@ -756,8 +756,8 @@ The charges against Communism made from a religious, a philosophical and,
generally, from an ideological standpoint, are not deserving of serious generally, from an ideological standpoint, are not deserving of serious
examination. examination.
Does it require deep intuition to comprehend that mans ideas, views, and Does it require deep intuition to comprehend that man's ideas, views, and
conception, in one word, mans consciousness, changes with every change in the conception, in one word, man's consciousness, changes with every change in the
conditions of his material existence, in his social relations and in his conditions of his material existence, in his social relations and in his
social life? social life?
@ -854,7 +854,7 @@ abolition of all the distinction between town and country by a more equable
distribution of the populace over the country. distribution of the populace over the country.
@item Free education for all children in public schools. Abolition of @item Free education for all children in public schools. Abolition of
childrens factory labour in its present form. Combination of education with children's factory labour in its present form. Combination of education with
industrial production, &c, &c. industrial production, &c, &c.
@end enumerate @end enumerate
@ -900,7 +900,7 @@ and whispering in his ears sinister prophesies of coming catastrophe.
In this way arose feudal Socialism: half lamentation, half lampoon; half an In this way arose feudal Socialism: half lamentation, half lampoon; half an
echo of the past, half menace of the future; at times, by its bitter, witty echo of the past, half menace of the future; at times, by its bitter, witty
and incisive criticism, striking the bourgeoisie to the very hearts core; but and incisive criticism, striking the bourgeoisie to the very heart's core; but
always ludicrous in its effect, through total incapacity to comprehend the always ludicrous in its effect, through total incapacity to comprehend the
march of modern history. march of modern history.
@ -1116,7 +1116,7 @@ societies for the prevention of cruelty to animals, temperance fanatics,
hole-and-corner reformers of every imaginable kind. This form of socialism hole-and-corner reformers of every imaginable kind. This form of socialism
has, moreover, been worked out into complete systems. has, moreover, been worked out into complete systems.
We may cite Proudhons Philosophie de la Misère as an example of this form. We may cite Proudhon's Philosophie de la Misère as an example of this form.
The Socialistic bourgeois want all the advantages of modern social conditions The Socialistic bourgeois want all the advantages of modern social conditions
without the struggles and dangers necessarily resulting therefrom. They desire without the struggles and dangers necessarily resulting therefrom. They desire